html, body {
    background-color: rgb(33, 37, 41);
    min-height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    position: sticky;
    z-index: 40;
    top: 0;
    width: 100%;
    height: 8dvh;
    background-color: rgb(19, 20, 20);
    color: white;
    align-items: center;
    box-shadow: black 0px 2px 10px;
}

main {
    width: 100%;
    flex: 1;
    background-color: rgb(32, 34, 34);
    color: white;
    position: relative;
    display: block;
    overflow-y: auto;
}

footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    height: 4dvh;
    background-color: rgb(19, 20, 20);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: black 0px 2px 10px;
}

#questions_wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px 0;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#questions_wrapper::-webkit-scrollbar {
    display: none;
}

.question_card {
    background: #222831;
    border: 0.5px solid #393e46;
    scroll-margin-top: 60px;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: border-color 0.2s, background 0.2s;
}

.question_card:hover {
    background: #2d333d;
    border-color: #555e6e;
}

.question_header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.question_unit {
    color: #3577a6;
    font-weight: 700;
}

.question_id {
    color: #555e6e;
    font-size: 0.85em;
}

.question_title {
    color: #eeeeee;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: black 0px 3px 5px;
    text-align: center;
}

.question_img, .question_video {
    max-width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    object-fit: contain;
}

.question_img.loaded, .question_video.loaded {
    aspect-ratio: auto;
    background: none;
}

.question_correct {
    background: #222831;
    border: 0.5px solid #97BE5A;
    border-radius: 10px;
    color: #97BE5A;
    font-weight: 700;
    text-align: center;
    text-shadow: none;
    align-self: center;
    cursor: default;
    letter-spacing: 0.03em;
    transition: background 0.2s;
    width: auto;
    max-width: 90%;
}

.question_correct:hover {
    background: #2d333d;
}

#search_bar {
    position: fixed;
    top: 8%;
    left: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1a1a1a;
    border-radius: 0 0 8px 0;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
}

#search_bar.sticky {
    top: 0;
}

#search_id {
    background: #222831;
    border: 0.5px solid #393e46;
    border-radius: 10px;
    color: #eeeeee;
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
}

#search_id:focus {
    border-color: #555e6e;
}

#search_btn {
    background: #222831;
    border: 0.5px solid #393e46;
    border-radius: 20px;
    color: #eeeeee;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}

#search_btn:hover {
    background: #2d333d;
    border-color: #555e6e;
}

@media screen and (orientation: landscape) {
    .question_correct {
        min-width: 15vw;
        padding: 10px 24px;
        font-size: clamp(10px, 1.5vh, 16px);
    }

    .question_card {
        width: 60vw;
    }

    .question_unit {
        font-size: clamp(11px, 1.5vh, 18px);
    }

    .question_title {
        font-size: clamp(13px, 2vh, 22px);
    }

    .question_id {
        font-size: clamp(10px, 1.2vh, 16px);
    }

    .question_img, .question_video {
        max-height: 30vh;
        max-width: 50%;
        align-self: center;
    }

    #search_id { width: 10vw; padding: 8px 16px; font-size: clamp(11px, 1.5vh, 16px); }
    #search_btn { padding: 8px 20px; font-size: clamp(11px, 1.5vh, 16px); }
}

@media screen and (orientation: portrait) {
    .question_correct {
        min-width: 50vw;
        padding: 10px 20px;
        font-size: clamp(10px, 2.8vw, 16px);
    }

    .question_card {
        width: 88vw;
    }

    .question_unit {
        font-size: clamp(11px, 2.5vw, 16px);
    }

    .question_title {
        font-size: clamp(13px, 3vw, 20px);
    }

    .question_id {
        font-size: clamp(10px, 2vw, 14px);
    }

    .question_img, .question_video {
        max-height: 25vh;
        max-width: 80%;
        align-self: center;
    }

    #search_id { width: 20vw; padding: 8px 16px; font-size: clamp(11px, 2.5vw, 16px); }
    #search_btn { padding: 8px 20px; font-size: clamp(11px, 2.5vw, 16px); }
}