/* ========================================
   PREMIUM MILESTONE CELEBRATIONS
   Mobile-First, YouTube-Optimized Design
   (Uses existing lower-third progress bar - no duplication)
   ======================================== */

/* ===== MILESTONE CELEBRATIONS (Fullscreen Overlay) ===== */

.milestone-celebration {
    position: fixed;
    inset: 0;
    z-index: 200; /* Above everything */
    pointer-events: none;

    /* Nakama Duo branding image with subtle dark tint for text readability */
    background:
        linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),  /* Subtle dark overlay */
        url('../config/branding/nakama_duo_playlist_closer_square.png') center/cover no-repeat;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;

    /* Entrance animation */
    opacity: 0;
    animation: celebrationFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes celebrationFadeIn {
    to { opacity: 1; }
}

.milestone-celebration.exiting {
    animation: celebrationFadeOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes celebrationFadeOut {
    to { opacity: 0; }
}

/* Main Message - Premium YouTube Style */
.milestone-message {
    font-size: 8rem; /* 128px - MASSIVE for YouTube visibility */
    font-weight: 900;
    color: #FFD700; /* Gold color for premium feel */
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;

    /* Premium multi-layer shadow for depth */
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.8),    /* Gold glow */
        0 0 40px rgba(255, 215, 0, 0.6),    /* Outer gold glow */
        0 4px 8px rgba(0, 0, 0, 0.8),       /* Sharp shadow */
        0 8px 20px rgba(0, 0, 0, 0.9);      /* Deep shadow */

    /* Bounce in + pulse animation */
    transform: scale(0.8);
    animation:
        celebrationBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
        celebrationPulse 1.5s ease-in-out 0.6s infinite;
}

@keyframes celebrationBounce {
    to { transform: scale(1); }
}

@keyframes celebrationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Character Image */
.milestone-character {
    width: 250px;
    height: 250px;
    object-fit: contain;
    filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.9));

    /* Pop in animation */
    transform: scale(0);
    animation: characterPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

@keyframes characterPop {
    to { transform: scale(1); }
}

/* Encouragement Text - Premium Style */
.milestone-encouragement {
    font-size: 4rem; /* 64px - Even bigger for YouTube */
    font-weight: 700;
    color: rgba(255, 255, 255, 1);
    text-align: center;
    letter-spacing: 0.03em;
    text-shadow:
        0 0 15px rgba(255, 255, 255, 0.6),
        0 4px 30px rgba(0, 0, 0, 0.9),
        0 6px 40px rgba(0, 0, 0, 1);

    /* Fade in animation */
    opacity: 0;
    animation: textFadeIn 0.4s ease-out 0.4s forwards;
}

@keyframes textFadeIn {
    to { opacity: 1; }
}

/* Progress Counter - Gold Premium Style */
.milestone-counter {
    font-size: 3.5rem; /* 56px - Bigger for YouTube */
    font-weight: 700;
    color: rgba(255, 215, 0, 0.95); /* Gold to match main message */
    text-align: center;
    letter-spacing: 0.05em;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.6),
        0 2px 20px rgba(0, 0, 0, 0.9),
        0 4px 30px rgba(0, 0, 0, 1);

    /* Fade in animation */
    opacity: 0;
    animation: textFadeIn 0.4s ease-out 0.5s forwards;
}

/* Milestone-Specific Colors */
.milestone-celebration[data-milestone="50"] .milestone-message {
    color: #FFA500; /* Orange - halfway energy */
}

.milestone-celebration[data-milestone="75"] .milestone-message {
    color: #FF6B6B; /* Coral - almost there urgency */
}

.milestone-celebration[data-milestone="100"] .milestone-message {
    color: #4CAF50; /* Green - completion success */
}

/* ===== PARTICLE EFFECTS (Optional Premium Touch) ===== */

.milestone-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: particleBurst 1.5s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 1200px) {
    .progress-bar-container {
        top: 30px;
        width: calc(100% - 60px);
        padding: 15px 20px;
    }

    .progress-lesson-badge {
        font-size: 1.8rem;
    }

    .progress-text {
        font-size: 2rem;
    }

    .progress-percentage {
        font-size: 1.8rem;
    }

    .milestone-message {
        font-size: 4.5rem;
    }

    .milestone-character {
        width: 180px;
        height: 180px;
    }

    .milestone-encouragement {
        font-size: 2.8rem;
    }

    .milestone-counter {
        font-size: 2.4rem;
    }
}

/* ===== HIDE DURING INTROS ===== */

body.playing-intro .progress-bar-container {
    display: none;
}
