/**
 * Smart Time Tracking Visual Styles
 * Playful and engaging visual feedback
 */

/* Lesson Completion Celebration */
.lesson-completion-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.lesson-completion-celebration.show {
    opacity: 1;
    transform: scale(1);
}

.celebration-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 3px solid #FEE300;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(254, 227, 0, 0.3);
}

.celebration-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.celebration-title {
    font-size: 2rem;
    font-weight: 700;
    color: #FEE300;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.celebration-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    gap: 20px;
}

.celebration-stats .stat {
    text-align: center;
}

.celebration-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #96D700;
    margin-bottom: 5px;
}

.celebration-stats .stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.celebration-message {
    font-size: 1.1rem;
    color: #FEE300;
    font-weight: 600;
    margin-top: 20px;
    padding: 15px;
    background: rgba(254, 227, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(254, 227, 0, 0.2);
}

/* Achievement Popup - Enhanced for Clarity */
.achievement-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #FEE300 0%, #96D700 100%);
    color: #1a1a1a;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(254, 227, 0, 0.4);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 320px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: achievementGlow 2s ease-in-out infinite alternate;
}

@keyframes achievementGlow {
    0% { box-shadow: 0 10px 30px rgba(254, 227, 0, 0.4); }
    100% { box-shadow: 0 15px 40px rgba(254, 227, 0, 0.6); }
}

.achievement-popup.show {
    transform: translateX(0);
    opacity: 1;
}

.achievement-content {
    text-align: center;
    position: relative;
}

/* Clear Achievement Header */
.achievement-content::before {
    content: "🏆 SUCCÈS DÉBLOQUÉ !";
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a1a1a;
    opacity: 0.8;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.achievement-title {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.achievement-description {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Achievement Points/Reward */
.achievement-content::after {
    content: "✨ +10 XP ✨";
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 15px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Playful Messages */
.playful-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(26, 26, 26, 0.95);
    color: #FEE300;
    padding: 20px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(254, 227, 0, 0.3);
    text-align: center;
    max-width: 80vw;
}

.playful-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.playful-message.focus {
    background: linear-gradient(135deg, rgba(150, 215, 0, 0.9) 0%, rgba(254, 227, 0, 0.9) 100%);
    color: #1a1a1a;
}

.playful-message.achievement-explanation {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(45, 45, 45, 0.95) 100%);
    color: #FEE300;
    border: 2px solid rgba(254, 227, 0, 0.5);
    font-size: 1rem;
    max-width: 400px;
    padding: 25px 30px;
}

/* Smart Time Display */
.smart-time-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(254, 227, 0, 0.1);
    color: #FEE300;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.smart-time-display::before {
    content: "⏱️";
    font-size: 0.8rem;
}

/* Time-based body classes for ambient feedback */
body.time-focused {
    --accent-glow: 0 0 20px rgba(254, 227, 0, 0.1);
}

body.time-deep {
    --accent-glow: 0 0 30px rgba(150, 215, 0, 0.15);
}

body.time-dedicated {
    --accent-glow: 0 0 40px rgba(150, 215, 0, 0.2);
}

body.time-focused .lesson-content,
body.time-deep .lesson-content,
body.time-dedicated .lesson-content {
    box-shadow: var(--accent-glow);
}

/* Enhanced Progress Indicators */
.smart-progress-indicator {
    position: relative;
    overflow: hidden;
}

.smart-progress-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(254, 227, 0, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Engagement Level Indicators */
.engagement-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.engagement-indicator.browsing {
    background: rgba(128, 128, 128, 0.2);
    color: #888;
}

.engagement-indicator.active {
    background: rgba(254, 227, 0, 0.2);
    color: #FEE300;
}

.engagement-indicator.engaged {
    background: rgba(150, 215, 0, 0.2);
    color: #96D700;
}

.engagement-indicator.expert {
    background: linear-gradient(135deg, rgba(254, 227, 0, 0.3), rgba(150, 215, 0, 0.3));
    color: #FEE300;
    box-shadow: 0 0 15px rgba(254, 227, 0, 0.3);
}

/* Focus Streak Indicator */
.focus-streak {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #96D700;
    font-weight: 600;
}

.focus-streak::before {
    content: "🔥";
    animation: flicker 1.5s ease-in-out infinite alternate;
}

@keyframes flicker {
    0% { opacity: 0.7; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* Smart Time Stats Panel */
.smart-time-stats {
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(254, 227, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    backdrop-filter: blur(10px);
}

.smart-time-stats h4 {
    color: #FEE300;
    margin: 0 0 10px 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.smart-time-stats h4::before {
    content: "📊";
}

.time-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.time-stat-item {
    text-align: center;
    padding: 8px;
    background: rgba(254, 227, 0, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(254, 227, 0, 0.1);
}

.time-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #FEE300;
    display: block;
}

.time-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .achievement-popup {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .achievement-popup.show {
        transform: translateY(0);
    }
    
    .playful-message {
        left: 10px;
        right: 10px;
        transform: translateY(-50%) scale(0.8);
        max-width: none;
    }
    
    .playful-message.show {
        transform: translateY(-50%) scale(1);
    }
    
    .celebration-content {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .celebration-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .time-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Subtle animations for enhanced UX */
.smart-time-display[data-seconds]:hover {
    background: rgba(254, 227, 0, 0.2);
    transform: scale(1.05);
}

.lesson-card.completed .smart-time-display {
    background: rgba(150, 215, 0, 0.2);
    color: #96D700;
}

.lesson-card.in_progress .smart-time-display {
    background: rgba(254, 227, 0, 0.2);
    color: #FEE300;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.playful-message.achievement-explanation {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(45, 45, 45, 0.95) 100%);
    color: #FEE300;
    border: 2px solid rgba(254, 227, 0, 0.5);
    font-size: 1rem;
    max-width: 400px;
    padding: 25px 30px;
}
