/* ==================== STREAK TRACKING STYLES ==================== */

/* Streak Card Hover Effect */
.streak-card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.streak-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.streak-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.streak-card:hover::before {
    left: 100%;
}

.stat-sublabel {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-weight: 500;
}

/* Pulse Animation for Streak Card */
@keyframes streakPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 24px rgba(255, 107, 107, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

.streak-card.streak-pulse {
    animation: streakPulse 0.6s ease-in-out;
}

/* Glow effect for high activity days */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(79, 172, 254, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(79, 172, 254, 0.8), 0 0 30px rgba(79, 172, 254, 0.6);
    }
}

.calendar-day.has-activity.high {
    animation: glow 2s ease-in-out infinite;
}

/* Quiz Count Badge */
.quiz-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 32px;
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    padding: 0 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.quiz-count-badge.badge-show {
    opacity: 1;
    transform: scale(1);
}

.quiz-count-badge.badge-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.quiz-count-badge.badge-orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.quiz-count-badge.badge-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.quiz-count-badge.badge-gold {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
    }
}

/* Enhanced Stat Sublabel with Animation */
.stat-sublabel strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Streak Modal */
.streak-modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.streak-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.streak-stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.streak-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.streak-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.streak-stat-content {
    flex: 1;
}

.streak-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.streak-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Calendar Section */
.streak-calendar-section {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.streak-calendar-section h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-day .day-name {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
}

.calendar-day .day-num {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

.calendar-day.has-activity {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.calendar-day.has-activity .day-name,
.calendar-day.has-activity .day-num {
    color: white;
}

.calendar-day.has-activity.medium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f093fb;
}

.calendar-day.has-activity.high {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: #4facfe;
}

.calendar-day .activity-dot {
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
}

.legend-box.has-activity {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.legend-box.has-activity.medium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f093fb;
}

.legend-box.has-activity.high {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: #4facfe;
}

/* Motivation Card */
.streak-motivation {
    margin-top: 30px;
}

.motivation-card {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    text-align: center;
}

.motivation-card i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.motivation-card h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
}

.motivation-card p {
    margin: 0;
    font-size: 15px;
    opacity: 0.95;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .streak-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .streak-stat-item {
        padding: 15px;
    }
    
    .streak-stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .streak-stat-value {
        font-size: 20px;
    }
    
    .streak-calendar {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }
    
    .calendar-day .day-num {
        font-size: 14px;
    }
    
    .calendar-legend {
        gap: 10px;
    }
    
    .motivation-card {
        padding: 20px;
    }
    
    .motivation-card i {
        font-size: 36px;
    }
    
    .motivation-card h4 {
        font-size: 18px;
    }
    
    .motivation-card p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .streak-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .streak-calendar {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
    }
    
    .calendar-day .day-name {
        font-size: 8px;
    }
    
    .calendar-day .day-num {
        font-size: 12px;
    }
}

/* Dark Mode Support */
body.dark-mode .calendar-day {
    background: var(--bg-secondary);
}

body.dark-mode .calendar-day.no-activity {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .streak-calendar-section {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .streak-stat-item {
    background: rgba(255, 255, 255, 0.05);
}
