/**
 * Karaoke v2 - Game Display Styles
 *
 * LED-optimized fullscreen styling for live event karaoke
 *
 * @package MadBoostPlayground
 */

/* Import Archivo Black from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap');

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.karaoke-v2-game {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    color: #fff;
    overflow: hidden;
    font-family: 'Archivo Black', 'Arial Black', 'Arial Bold', Gadget, sans-serif;
    z-index: 9999;
}

/* ==========================================================================
   Background Video Layer
   ========================================================================== */

.karaoke-bg-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

/* ==========================================================================
   Confetti Layer (Above video, below lyrics)
   ========================================================================== */

.karaoke-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10000;
    overflow: visible;
}

.karaoke-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.karaoke-bg-video.active {
    opacity: 1;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Darken videos slightly for better lyrics visibility */
}

/* ==========================================================================
   Content Layer (Above Videos)
   ========================================================================== */

.karaoke-content-layer {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5vh 5vw;
}

/* ==========================================================================
   Song Info Display (Before Playing)
   ========================================================================== */

.karaoke-song-info {
    text-align: center;
    max-width: 80%;
    animation: fadeInUp 1s ease-out;
}

.song-title {
    font-size: 4rem !important;
    font-weight: 900;
    margin: 0 0 1rem 0;
    text-shadow: 3px 3px 0px #ff0000, 6px 6px 0px #0000ff;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.song-description {
    font-size: 2rem;
    font-weight: 400;
    margin: 0 0 2rem 0;
    text-shadow: 2px 2px 0px #000;
    line-height: 1.3;
}


@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================================================
   Lyrics Display
   ========================================================================== */

.karaoke-lyrics-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 90vw;
}

.current-lyric {
    margin-bottom: 3vh;
    text-align: center;
}

.lyric-text {
    font-size: 7vw;
    font-weight: 900;
    line-height: 1.3;
    text-shadow:
        0 0 10px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.6),
        2px 2px 4px rgba(0, 0, 0, 1);
    display: inline-block;
}

.next-lyric {
    font-size: 3vw;
    opacity: 0.6;
    font-weight: 400;
    text-align: center;
    font-style: italic;
}

/* ==========================================================================
   Hidden Words Styling
   ========================================================================== */

.hidden-word {
    display: inline-block;
    position: relative;
    padding: 0.2em 0.5em;
    margin: 0 0.2em;
    background: #ffffff;
    border-radius: 0.3em;
    color: transparent;
    text-shadow: none;
    vertical-align: baseline;
    transition: all 0.3s ease;
}

.hidden-word::before {
    content: attr(data-placeholder);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1em;
    letter-spacing: 0.1em;
}

/* Hidden word states */
.hidden-word.wrong {
    background: #dc3545;
    animation: shake 0.3s;
}

.hidden-word.wrong::before {
    content: "X";
    background: #fff;
    color: #dc3545;
    border: 2px solid #dc3545;
    border-radius: 0.2em;
    padding: 0.1em 0.3em;
    font-weight: bold;
    font-size: 0.9em;
    min-width: 1.2em;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hidden-word.revealed {
    background: #28a745;
    color: #fff;
    text-shadow: 0 0 10px rgba(40, 167, 69, 0.8);
    animation: revealBounce 0.5s ease-out;
}

.hidden-word.revealed::before {
    content: none;
}


/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes revealBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.karaoke-progress-container {
    position: absolute;
    bottom: 8vh;
    left: 10vw;
    right: 10vw;
    z-index: 15;
}

.progress-bar {
    position: relative;
    height: 1vh;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5vh;
    overflow: visible;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #0073aa 0%, #00a0d2 100%);
    border-radius: 0.5vh;
    transition: width 0.1s linear;
    width: 0%;
}

.progress-cursor {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2vh;
    height: 2vh;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    left: 0%;
    transition: left 0.1s linear;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    margin-top: 1vh;
    font-size: 2vw;
    font-family: 'Courier New', monospace;
    opacity: 0.8;
}

.time-separator {
    margin: 0 1vw;
}

/* ==========================================================================
   Status Indicators
   ========================================================================== */

.karaoke-status {
    position: absolute;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.status-message {
    padding: 2vh 4vw;
    background: rgba(255, 185, 0, 0.9);
    color: #000;
    font-size: 3vw;
    font-weight: 700;
    border-radius: 1vh;
    box-shadow: 0 0 20px rgba(255, 185, 0, 0.6);
    animation: pulse 1.5s infinite;
}

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

/* ==========================================================================
   Keyboard Controls Help
   ========================================================================== */

.karaoke-controls-help {
    position: absolute;
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2vw;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 80vw;
    opacity: 1;
    transition: opacity 0.5s ease;
    z-index: 15;
}

.control-hint {
    padding: 1vh 1.5vw;
    background: rgba(0, 0, 0, 0.7);
    border: 0.2vh solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5vh;
    font-size: 1.5vw;
    display: flex;
    align-items: center;
    gap: 0.5vw;
}

.control-hint .key {
    padding: 0.5vh 1vw;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.3vh;
    font-family: 'Courier New', monospace;
    font-weight: 700;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.karaoke-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4vw;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ==========================================================================
   Paused State
   ========================================================================== */

.karaoke-v2-game.paused .current-lyric {
    opacity: 0.7;
}

.karaoke-v2-game.paused .karaoke-bg-video.active {
    filter: blur(5px);
}

/* ==========================================================================
   Auto-Paused State (Waiting for Answer)
   ========================================================================== */

.karaoke-v2-game.auto-paused .current-lyric {
    animation: glow 1.5s infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(0, 0, 0, 0.8),
            0 0 20px rgba(0, 0, 0, 0.6);
    }
    50% {
        text-shadow:
            0 0 20px rgba(255, 255, 255, 0.4),
            0 0 30px rgba(255, 255, 255, 0.2);
    }
}

/* ==========================================================================
   Responsive Adjustments (for smaller screens/testing)
   ========================================================================== */

@media screen and (max-width: 1024px) {
    .lyric-text {
        font-size: 6vw;
    }

    .next-lyric {
        font-size: 2.5vw;
    }

    .control-hint {
        font-size: 2vw;
    }
}

/* ==========================================================================
   Very Large Displays (LED Walls)
   ========================================================================== */

@media screen and (min-width: 2560px) {
    .lyric-text {
        font-size: 180px;
    }

    .next-lyric {
        font-size: 80px;
    }

    .control-hint {
        font-size: 40px;
    }

    .progress-time {
        font-size: 50px;
    }
}

/* ==========================================================================
   Print Styles (Disable)
   ========================================================================== */

@media print {
    .karaoke-v2-game {
        display: none;
    }
}
