/* ----- General Styles ----- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    background: url('https://images.jdmagicbox.com/rep/b2b/kids-wall-paper/kids-wall-paper-3.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Animation for sparkly effect */
@keyframes sparkle {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ----- Modal Styles ----- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 11px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Lato', sans-serif;
    width: 250px;
    height: 150px;
}

.modal-content h2 {
    color: #ff6680;
    margin-bottom: 15px;
    font-size: 18px;
}

.lang-btn {
    background: #ffccd5;
    border: none;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    width: 150px;
    padding: 6px 0;
    font-size: 12px;
    margin: 4px 0;
}

.lang-btn img {
    width: 14px;
}

.lang-btn:hover {
    background: #ffb3c1;
}

.lang-btn.active {
    background: #ff6680;
    color: white;
}

/* ----- Landing Styles ----- */
.landing {
    text-align: center;
    font-family: 'Lato', sans-serif;
}

.landing-hidden {
    display: none;
}

.landing h1 {
    color: #ff6680;
    line-height: 1.2;
    margin-bottom: 30px;
    background: linear-gradient(90deg, #ff6680, #ffccd5, #ff6680);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: sparkle 2s infinite linear;
}

#start-btn {
    background: #ffccd5;
    border: none;
    border-radius: 11px;
    color: #333;
    cursor: pointer;
    transition: background 0.3s;
    width: 250px;
    padding: 15px 30px;
    font-size: 21px;
}

#start-btn:hover {
    background: #ffb3c1;
}

/* ----- Quiz Container Styles ----- */
.quiz-container-hidden {
    display: none;
}

.container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 11px;
    box-shadow: 0 0 11px rgba(0, 0, 0, 0.2);
    text-align: center;
    overflow: hidden;
    position: relative;
    width: 525px;
    min-height: 338px;
    max-height: calc(97.5vh - 30px); /* Reserve space for footer (20px height + 10px spacing) */
    padding: 23px;
    box-sizing: border-box;
    /* overflow-y: auto; */
}

.container h1 {
    margin-bottom: 19px;
    color: #ff6680;
    background: linear-gradient(90deg, #ff6680, #ffccd5, #ff6680);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: sparkle 2s infinite linear;
    font-size: 30px;
}

.language-switch-hidden {
    display: none;
}

.language-switch {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.language-switch .lang-btn {
    background: #ffccd5;
    border: none;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    transition: background 0.3s;
    padding: 4px 8px;
    font-size: 14px;
}

.language-switch .lang-btn img {
    width: 15px;
}

.language-switch .lang-btn:hover {
    background: #ffb3c1;
}

.language-switch .lang-btn.active {
    background: #ff6680;
    color: white;
}

#score,
#question-number {
    margin: 11px 0;
    color: #333;
    font-size: 18px;
}

#question {
    margin: 19px 0;
    color: #333;
    font-family: 'Roboto', sans-serif;
    font-size: 21px;
    height: 63px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
}

#question-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 11px 0;
}

.nav-box {
    border: 2px solid rgb(105, 3, 51);
    cursor: pointer;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 19px;
    height: 19px;
    font-size: 14px;
}

.nav-box.answered-correct {
    background-color: #d4edda;
    border-color: #28a745;
}

.nav-box.answered-wrong {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.nav-box.current {
    border-width: 3px; /* Thicker border for active question */
}

.nav-box.current.answered-correct {
    background-color: #d4edda; /* Keep green for correct */
    border-color: #28a745;
    border-width: 3px; /* Thicker border */
}

.nav-box.current.answered-wrong {
    background-color: #f8d7da; /* Keep red for incorrect */
    border-color: #dc3545;
    border-width: 3px; /* Thicker border */
}

#options {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 0.4;
}

.option {
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    color: #333;
    border: 2px solid black;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    width: 50%;
    font-size: 18px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    margin: 11px 0;
}

.option:hover {
    background: #ecf01e;
}

.option.selected {
    background: #ecf01e;
}

.option.correct {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.option.wrong {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

.explanation-hidden {
    visibility: hidden;
    height: auto;
}

#explanation {
    font-style: oblique;
    font-weight: bold;
    margin-top: 15px;
    color: #555;
    min-height: 53px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
}

/* ----- Navigation Styles ----- */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
    min-height: 45px;
    position: relative;
}

.prev-btn-hidden {
    visibility: hidden;
}

.next-btn-hidden {
    visibility: hidden;
}

.confirm-btn-hidden,
.results-btn-hidden {
    display: none;
}

#prev-btn,
#next-btn {
    flex: 0 0 auto;
    width: 120px;
    height: 45px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    box-sizing: border-box;
    text-align: center;
    font-size: 19px;
    background: #2b1823;
    color: white;
}

#prev-btn:hover:not(:disabled),
#next-btn:hover:not(:disabled) {
    background: #4a2f3b;
}

#confirm-btn,
#results-btn,
#restart-btn,
#finish-btn {
    width: 188px;
    height: 45px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    box-sizing: border-box;
    text-align: center;
    font-size: 19px;
}

#confirm-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #ffc107; /* Yellow */
    color: #333;
}

#confirm-btn:disabled {
    background: #e0e0e0;
    cursor: not-allowed;
}

#confirm-btn:hover:not(:disabled) {
    background: #e0a800; /* Darker yellow */
}

#results-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #ffff99;
    color: #333;
}

#results-btn:hover {
    background: #ffee66;
}

#restart-btn,
#finish-btn {
    background: #007bff; /* Blue */
    color: #fff; /* White text for contrast */
    margin: 11px auto;
    display: block;
}

#restart-btn:hover:not(:disabled),
#finish-btn:hover:not(:disabled) {
    background: #0056b3; /* Darker blue */
}

#finish-btn.highlight Facetune {
    background: #ffff99;
    color: #333;
}

.quiz-func {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

/* ----- Footer Styles ----- */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 12px;
    padding: 8px 0; /* Ensure consistent height */
    background: transparent; /* Avoid overlap visibility */
}
