/* Root Variables */
:root {
    --FontPrimary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --ColorPrimary: #007bff;
    --ColorSecondary: #0056b3;
    --ColorDark: #003d82;
}

/* Reset and Body */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    margin: 0;
    font-family: var(--FontPrimary);
    background: linear-gradient(135deg, #007bff 0%, #0056b3 50%, #003d82 100%);
    background-attachment: fixed;
    color: #ffffff;
}

body {
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
}

#logo {
    display: inline-block;
    text-decoration: none;
}

#logo-img {
    height: 35px;
    width: auto;
    transition: transform 0.3s ease;
}

#logo-img:hover {
    transform: scale(1.05);
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-end;
}

header nav ul li a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

header nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* Timer Styling */
#timeRemaining {
    color: white;
    font-weight: 600;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Main Content */
main {
    flex: 1;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Question Picker Styling */
#question-picker {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#question-picker h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #ffffff;
}

#question-picker p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

#form_nb_questions_picker .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

#form_nb_questions_picker .btn-group .btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

#form_nb_questions_picker .btn-group .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

#form_nb_questions_picker .btn-group input[type="radio"]:checked + .btn {
    background: #ffffff;
    color: #007bff;
    border-color: #ffffff;
}

#startQuizBtn {
    background: #ffffff;
    color: #007bff;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 18px;
    margin-top: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#startQuizBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Quiz Container */
#container {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 900px;
    margin: 20px auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#outerquestionholder {
    padding: 20px;
    transition: opacity 0.3s ease;
}

#questionNbHolder {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

#mainQuestion {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Options Styling */
.options {
    margin-top: 20px;
}

.options label {
    display: block;
    padding: 18px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.95);
}

.options label:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

.options input[type="radio"] {
    display: none;
}

.options input[type="radio"]:checked + label {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    color: #ffffff;
}

/* Only apply this class when explicitly set by JavaScript */
label.selectedOption {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    color: #ffffff;
}

/* Remove any default highlighting */
label.highlightChoice {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
}

/* Progress Bar */
#progressBarOuterContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    gap: 15px;
}

#progressBarContainer {
    flex: 1;
    max-width: 400px;
    height: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

#progressBar {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.8));
    width: 0%;
    transition: width 0.5s ease-in-out;
    border-radius: 15px;
}

#progressBarIndex {
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

/* Navigation Buttons */
#nav-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

#nav-bottom .btn {
    background: #ffffff;
    color: #007bff;
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    min-width: 120px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#nav-bottom .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#nav-bottom .btn:active {
    transform: scale(0.98);
}

/* Explanation Container (for review) */
#explanation_container {
    margin-top: 30px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#ansExplHeader {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #ffffff;
}

#ansText {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

footer p {
    margin: 0;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    #timeRemaining {
        order: 2;
        margin: 10px 0;
    }

    header nav ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    #question-picker,
    #container {
        padding: 25px;
    }

    #mainQuestion {
        font-size: 20px;
    }

    #nav-bottom {
        flex-direction: column;
        gap: 10px;
    }

    #nav-bottom .btn {
        width: 100%;
        padding: 15px;
    }

    #progressBarContainer {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    header nav ul li a {
        padding: 6px 12px;
        font-size: 14px;
    }

    #question-picker h2 {
        font-size: 26px;
    }

    #mainQuestion {
        font-size: 18px;
    }

    .options label {
        padding: 15px;
        font-size: 14px;
    }
}