@import url('https://fonts.googleapis.com/css2?family=Audiowide&family=Exo+2:ital,wght@0,100..900;1,100..900&family=Manrope:wght@200..800&display=swap');



:root {
    --max-content-width: 700px;

    --primary: #0092db;
    /* Main accent color */
    --secondary: #005f99;
    /* Slightly darker accent */
    --secondary-dark: #034f7f;

    --background: #121212;
    /* Main background */
    --surface: #1a1a1a;
    /* Cards, modals, elevated surfaces */
    --popup: #222222;
    /* General popups */
    --popup-highlight: #333333;
    /* Popups that need to stand out */
    --popup-alert: #ff4444;
    /* A really strong attention grabber */

    --text-primary: #e0e0e0;
    /* Main text */
    --text-secondary: #a0a0a0;
    /* Slightly dimmed text */
    --text-muted: #707070;
    /* Low emphasis text */

    --border: #2e2e2e;
    /* Standard border */
    --button-bg: #0088cc;
    /* Button background */
    --button-hover: #0077b3;
    --button-active: #00689c;
    /* Button hover */
    --button-text: #ffffff;
    /* Button text */

}


* {
    font-family: 'Exo 2', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    background-color: var(--background);
    color: var(--text-primary);
    overflow: hidden;
}



button {
    /* dark colors */
    border: none;
    color: white;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    margin: 4px 2px;
    padding: 13px 27px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    background-color: var(--button-bg);
    transition: background 300ms ease;
}

button:hover {
    background-color: var(--button-hover);
}

button:active,
button:focus {
    background-color: var(--button-active);
    outline: 1px solid white;
}


input {
    background-color: var(--surface);
    border: none;
    color: white;
    padding: 13px 20px;
    text-align: left;
    text-decoration: none;
    display: inline-block;
    font-size: 1.3rem;
    font-weight: normal;
    text-transform: capitalize;
    margin: 4px 2px;
    cursor: text;
    border-radius: 8px;
    border: 2px solid var(--border);
}

input:focus {
    outline: none;
}

.divider {
    width: 100%;
    height: 1px;
    background-color: var(--text-secondary);
    margin-block: 1rem;
}

.tall-divider {
    width: 1px;
    height: 100%;
    min-height: 10rem;
    max-height: 15rem;
    margin-inline: 1rem;
    background-color: var(--text-secondary);
}

label {
    width: 100%;
    display: flex;

    gap: 15px;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;

    input {
        flex: 1
    }
}

.title {
    font-family: "Audiowide", sans-serif;
    font-size: 2.4rem;
    margin-bottom: 2rem;
}

.title:has(+ .subtitle) {
    margin-bottom: 0.1rem;
}

.title+.subtitle {
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    background-color: transparent;
    width: 100%;
    border: none;
    padding: 0;
    outline: none;

    margin-bottom: 1.3rem;
    user-select: none;
}

.title+.subtitle:focus {
    text-decoration: underline;
}

.title+.subtitle svg {
    height: 1.3rem;
    width: 1.3rem;
    fill: var(--text-secondary);
    rotate: -90deg;
    transition: rotate 120ms ease;
}

.title+.subtitle.open svg {
    rotate: 0deg;
}


#genreSelector {
    position: absolute;
    z-index: 20;
    translate: -50%;
    width: 300px;
    background-color: var(--popup);
    border-radius: 10px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    /* display: none; */
    flex-direction: column;
    gap: 0.8rem;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    outline: none;
}


#genreSelector label {
    font-size: 1.1rem;
    font-weight: normal;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: flex-start;
    padding: 0.8rem;
    border-radius: 6px;
    transition: background-color 150ms ease;
    user-select: none;
}

#genreSelector label:hover {
    background-color: var(--popup-highlight);
}

#genreSelector input[type="checkbox"] {
    max-width: 20px;
    max-height: 20px;

    margin: 0px;
    /* accent-color: var(--primary); */
    cursor: pointer;

    appearance: none;
    display: none;
}

#genreSelector label::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background-color: var(--surface);
    border: 2px solid var(--border);
    transition: background-color 100ms ease, border-color 100ms ease;
}

#genreSelector label:has(input[type="checkbox"]:checked)::before {
    background-color: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3' fill='white'/%3E%3Ccircle cx='12' cy='12' r='6' fill='none' stroke='white' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='white' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 20px;
    background-repeat: no-repeat;
    background-position: center;
}







.page {
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
}



@starting-style {

    /* This is the starting style for the search popup */
    /* It will be replaced by the actual style in the final version */
    .inputs #searchPopup {
        display: none;
        opacity: 0;
        bottom: -102%;
    }
}




@keyframes wave {
    0% {
        scale: 1 1;
    }

    50% {
        scale: 1.15 1.3;
    }

    100% {
        scale: 1 1;
    }
}

#loadingPopup[open] {
    display: flex;
    opacity: 1;

}

#loadingPopup {
    transition: opacity 200ms ease, display 200ms ease allow-discrete;
    opacity: 0;
    display: none;
    z-index: 100;
    pointer-events: all;
    position: fixed;
    inset: 0;
    background-color: transparent;
    color: white;
    border: none;
    outline: none;
    margin: auto;

    #loadingContent {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        width: 500px;
        height: 500px;
    }

    .wave {
        display: flex;
        gap: 13px;
        align-items: center;
        justify-content: center;

        .waveline {
            width: 20px;
            height: 90px;
            border-radius: 10px;
            background-color: var(--primary);
            animation: wave 700ms infinite ease;
        }

        .waveline:nth-child(odd) {
            height: 80px;
        }

        .waveline:last-of-type,
        .waveline:first-of-type {
            height: 50px;
            /* animation-delay: 0.2s; */
        }

        .waveline:nth-child(2) {
            animation-delay: 0.1s;
        }

        .waveline:nth-child(3) {
            animation-delay: 0.2s;
        }

        .waveline:nth-child(4) {
            animation-delay: 0.3s;
        }

        .waveline:nth-child(5) {
            animation-delay: 0.4s;
        }

        .waveline:nth-child(6) {
            animation-delay: 0.5s;
        }

        .waveline:nth-child(7) {
            animation-delay: 0.6s;
        }

        .waveline:nth-child(8) {
            animation-delay: 0.7s;
        }
    }

    p {
        font-size: 1.7rem;
        font-weight: bold;
    }

    &::backdrop {
        background-color: rgb(0, 0, 0, 0.3);
        backdrop-filter: blur(5px);
    }
}

#pageControls {

    position: fixed;
    top: 0.4rem;
    left: 0.4rem;
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    /* cursor: pointer; */
    z-index: 100;

    display: flex;
    justify-content: space-between;
    left: 0;
    right: 0;
    padding-inline: 10px;

    &.controlsInside {
        position: absolute;
    }

    a {
        color: white;
        text-decoration: none;
        display: flex;
        align-items: center;
        cursor: pointer;
    }

    svg {
        fill: white;
        height: 2rem;
        width: 2rem;
        margin-right: -0.2rem;
    }

    svg:last-of-type {
        height: 1.5rem;
        width: 1.5rem;
    }

    #volumeSlider {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    input[type="range"] {
        position: relative;
        -webkit-appearance: none;
        cursor: pointer;
        margin: 0;
        width: 100px;
        height: 10px;
        padding: 0;
        border: none;
        background: transparent;
        /* Prevents background from interfering */
        outline: none;
    }

    /* The actual track */
    input[type="range"]::-webkit-slider-runnable-track {
        height: 10px;
        border-radius: 5px;
        background: var(--popup);
    }

    /* The thumb (dot) */
    input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 14px;
        height: 14px;
        background: var(--thumb, white);
        /* Default to white if not set */
        border-radius: 50%;
        margin-top: -2px;
        /* Aligns it with the track */
        position: relative;
        z-index: 2;
    }

    /* The filled progress bar */
    input[type="range"]::before {
        content: "";
        position: absolute;
        height: 10px;
        background: linear-gradient(to left, var(--primary), var(--secondary-dark));
        /* Default highlight color */
        border-radius: 5px;
        width: var(--progress, 0%);
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1;
        pointer-events: none;
        /* Prevent interaction */
    }


    /* Adjust progress dynamically */
    input[type="range"] {
        --progress: 80%;
        /* Default, updated dynamically */
    }
}


#gameOverPopup[open] {
    display: flex;
}

#gameOverPopup {
    display: none;
    z-index: 150;
    pointer-events: all;
    position: fixed;
    inset: 0;
    background-color: transparent;
    color: white;
    border: none;
    outline: none;
    margin: auto;

    #gameOverContent {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 10px;
        /* width: 500px;
        height: 550px; */
        background-color: var(--popup-highlight);

        border: 22px solid var(--primary);
        box-shadow: 0px 0px 20px 0 var(--primary), inset 0px 0px 20px -2px var(--primary);

        font-weight: bold;
        border-radius: 35px;
        padding: 2.5rem;
        margin: 50px;



    }

    #gameOverMessage {
        font-size: 4rem;
        margin-bottom: 0;
    }

    #gameOverSubtitle {
        font-size: 1.5rem;
        margin-bottom: 3rem;
    }

    p {
        font-size: 1.5rem;
        color: rgb(200, 200, 200);
        margin-bottom: 0.4rem;
    }

    #gameOverSong {
        border: 1px solid white;
        border-radius: 20px;
        padding: 30px 0.6rem;
        width: 580px;
        font-size: 1.7rem;
        margin-bottom: 4rem;
    }

    #gameOverButtons {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        gap: 2rem;
    }

    button {
        padding: 23px 50px;
        font-size: 1.7rem;
        background-color: var(--secondary-dark);
        border-radius: 10px;
        color: white;
        font-weight: bold;
        text-decoration: none;
        flex: 1
    }

    #gameOverNext {
        background-color: var(--primary);
        position: relative;

        &[disabled] {
            opacity: 0.5;
            cursor: default;
        }

        #gameOverNextCount {
            position: absolute;
            right: -9px;
            background: var(--popup);
            padding: 8px 18px;
            border-radius: 10px;
            top: -15px;
            rotate: 5deg;
            color: white;
        }
    }

    &::backdrop {
        background-color: rgb(0, 0, 0, 0.3);
        backdrop-filter: blur(5px);
    }
}

#overlayVideos {
    position: fixed;
    inset: 0;
    z-index: -5;
    pointer-events: none;

    opacity: 0;
    transition: opacity 500ms ease-in;


    .overlayVideo {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: cover;
        /* mix-blend-mode: screen; */
        filter: brightness(1.4);
        pointer-events: none;
    }
}

.guessLines {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

.line {
    background-color: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    height: 60px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-weight: bold;
    font-size: 1.2rem;

    &.correct {
        filter: sepia(2) hue-rotate(62deg) saturate(2);
    }

    &.close {
        filter: sepia(2) hue-rotate(339deg) saturate(2);
    }

    &.incorrect {
        filter: sepia(2) hue-rotate(292deg) saturate(2);
    }


    &.skip {
        filter: brightness(2);
    }
}

@media (max-height: 600px) {
    .line {
        max-height: 50px;
    }
}



@media screen and (max-width: 800px) {

    #gameOverPopup #gameOverContent {
        zoom: 0.8;
    }
}

@media screen and (max-width: 550px) {
    .page .title {
        padding-top: 1rem;
    }

    #gameOverPopup #gameOverContent {
        zoom: 0.5;
    }
}

.controls {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-direction: column;
}

.inputs {
    display: flex;
    gap: 1rem;
    position: relative;
    width: 100%;
}

.inputs #searchInput {
    flex: 1;
    min-width: 0;
}

.inputs:focus-within #searchPopup:not(.hidden) {
    display: flex;
    opacity: 1;
    bottom: 102%;
}

.inputs #searchPopup {
    position: absolute;
    z-index: 3;
    background-color: var(--popup);
    width: 100%;
    border-radius: 10px;
    padding: 0.5rem;
    box-sizing: border-box;
    bottom: 10%;
    left: 0;
    margin-top: 1rem;
    display: none;
    flex-direction: column;
    display: none;
    gap: 1px;
    transition: opacity 100ms ease, display 100ms ease allow-discrete, bottom 100ms ease;
    opacity: 0;


    .result {
        padding: 10px 10px;
        background-color: var(--popup);
        border-radius: 7px;
        border: none;
        color: white;
        text-align: left;
        font-size: 1.1rem;
        font-weight: normal;
        cursor: pointer;
        transition: background-color 50ms ease;

        &:hover {
            background-color: var(--popup-highlight);
        }
    }
}

#guessBtn.guessSkip {
    padding: 13px 27px;
    font-size: 1.5rem;
    font-weight: bold;

    background-color: var(--text-secondary);
}

#guessBtn[disabled] {
    cursor: default;
    opacity: 0.5;
}


#playBtn {
    width: 45px;
    height: 45px;
    padding: 0;

    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.5rem;

    font-weight: bold;

    &:focus {
        outline: none;
    }
}

.timeline {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding-inline: 5px;

    .progress {
        flex: 1;
        height: 6px;
        border-radius: 3px;
        background-color: var(--popup);
        /* overflow: hidden; */
        position: relative;

        .progressLine {
            overflow: hidden;
            width: 100%;
            height: 6px;
            border-radius: 3px;
            position: relative;
        }

        .bar {
            width: 0%;
            height: 100%;
            position: absolute;
            /* border-radius: 3px; */
            background: linear-gradient(to left, var(--primary), var(--primary) 25%, var(--secondary-dark));
        }


        .indicator {
            position: absolute;
            top: -100%;
            border-radius: 2px 2px 50% 50%;
            translate: -50% -100%;
            left: 0;
            transition: left 250ms ease;
            padding: 2px 3px;
        }

        .markers {
            width: 100%;
            height: 6px;
            position: relative;
            inset: 0;

        }

        .marker {
            width: 2px;
            height: 6px;
            background-color: var(--text-secondary);
            position: absolute;
            top: 0;
            bottom: 0;
        }



    }
}