/* --- FONT IMPORTS --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500&display=swap');

/* --- GLOBAL STYLES & VARIABLES --- */
:root {
    --color: #161742;
    --color1: #2b3b58;
    --color2: #122525;
    --sb-track-color: #232E33;
    --sb-thumb-color: var(--color);
    --sb-size: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    color: #fff;
    background-color: #000000;
    overflow-x: hidden;
    scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
}

body::-webkit-scrollbar {
    width: var(--sb-size);
}

body::-webkit-scrollbar-track {
    background: var(--sb-track-color);
    border-radius: 10px;
}

body::-webkit-scrollbar-thumb {
    background: var(--sb-thumb-color);
    border-radius: 10px;
}

/* --- PRELOADER --- */
.preloader {
    background: black url(img/0001.gif) no-repeat center;
    height: 100vh;
    width: 100%;
    position: fixed;
    z-index: 300;
}

/* --- MAIN LAYOUT & CONTAINER --- */
.main {
    min-height: 100vh;
    transition: filter 0.5s ease, transform 0.5s ease;
    pointer-events: auto;
}

.main.active {
    filter: blur(10px);
    transform: scale(0.95);
    pointer-events: none;
}

.container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* --- HOME SCREEN --- */
.home {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(315deg, #130f40 0%, #000000 74%);
}

.home-content {
    max-width: 600px;
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

.home-content h1 {
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
}

.home-content p {
    font-size: 1.1em;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
    color: #ccc;
}

.home-content .start-btn {
    width: 190px;
    height: 55px;
    background: var(--color);
    border: 2px solid #fff;
    border-radius: 6px;
    box-shadow: 0 0 10px var(--color);
    font-size: 1.5em;
    color: #fff;
    letter-spacing: 1px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s;
}

.home-content .start-btn:hover {
    background: #09001d;
    box-shadow: none;
}

/* --- POPUP INFO BOX --- */
.popup-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    background: #fff;
    border-radius: 6px;
    padding: 25px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
    z-index: 200;
}

.popup-info.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.popup-info h2 {
    font-size: 2.5em;
    color: var(--color);
}

.popup-info .info {
    display: block;
    font-size: 1.1em;
    color: #333;
    font-weight: 500;
    margin: 10px 0;
}

.popup-info .btn-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #ccc;
    margin-top: 20px;
    padding-top: 15px;
}

.popup-info .info-btn {
    width: 130px;
    height: 45px;
    border: 2px solid var(--color);
    outline: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.popup-info .exit-btn {
    background: transparent;
    color: var(--color);
}

.popup-info .exit-btn:hover {
    background: var(--color);
    color: #fff;
}

.popup-info .continue-btn {
    background: var(--color);
    color: #fff;
}

.popup-info .continue-btn:hover {
    background: #09001d;
    border-color: #09001d;
}

/* --- QUIZ SECTION --- */
.quiz-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0);
    transition: transform 0.4s ease-in-out;
    z-index: 100;
}

.quiz-section.active {
    transform: scale(1);
}

/* MODIFICATION: Changed quiz box to be full-screen and black */
.quiz-box {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    background: #000; /* Black background */
    border-radius: 0; /* No rounded corners for full screen */
    display: flex;
    flex-direction: column;
    padding: 20px 30px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
    transition: all 0.4s ease;
    color: #fff; /* White text for visibility */
}

.quiz-section.active .quiz-box.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.quiz-box h1 {
    font-size: 1.5em;
    text-align: center;
    background: linear-gradient(45deg, var(--color2), var(--color), var(--color2));
    border-radius: 6px;
    color: #fff;
    padding: 8px;
}

.quiz-box .quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #444; /* Lighter border for black background */
    margin-bottom: 20px;
}

.quiz-header span {
    font-size: 1.2em;
    font-weight: 500;
}

.quiz-header .header-score {
    background: var(--color);
    color: #fff;
    border-radius: 3px;
    padding: 7px;
}

.quiz-box .question-text img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* MODIFICATION: Adjusted option border for black background */
.option-list .option {
    width: 100%;
    padding: 10px;
    border: 2px solid #555; /* Lighter border */
    border-radius: 5px;
    margin: 15px 0;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
}

.option-list .option:hover {
    border-color: #fff;
}

.option-list .option img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* This style matches the user's image for a selected answer */
.option-list .option.selected {
    border-color: #00a63d;
    background-color: #e7f3e7;
}

/* --- QUIZ FOOTER --- */
.quiz-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #444; /* Lighter border */
    padding-top: 20px;
    margin-top: 25px;
}

/* MODIFICATION: Ensured footer text is white */
.quiz-footer .question-total {
    font-size: 1em;
    font-weight: 600;
    color: #fff;
}

.quiz-footer .next-btn {
    width: 100px;
    height: 45px;
    background: #555;
    border: none;
    outline: none;
    border-radius: 6px;
    font-size: 1em;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    pointer-events: none;
    transition: background 0.3s;
}

.quiz-footer .next-btn.active {
    pointer-events: auto;
    background: var(--color);
}

.quiz-footer .next-btn.active:hover {
    background: var(--color2);
}

/* --- RESULT BOX --- */
.result-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 6px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    color: var(--color);
}

.result-box.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.result-box h2 {
    font-size: 3em;
}

.result-box .percentage-container {
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0 40px;
}

.percentage-container .circular-progress {
    position: relative;
    width: 250px;
    height: 250px;
    background: conic-gradient(var(--color) 3.6deg, rgba(0, 0, 0, 0.1) 0deg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.percentage-container .circular-progress::before {
    content: '';
    position: absolute;
    width: 210px;
    height: 210px;
    background: white;
    border-radius: 50%;
}

.circular-progress .progress-value {
    position: relative;
    font-size: 3em;
    font-weight: 600;
}

.percentage-container .score-text {
    font-size: 1.5em;
    font-weight: 600;
    margin-top: 20px;
}

.result-box .buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.buttons button {
    width: 140px;
    height: 47px;
    background: var(--color);
    border: 2px solid var(--color);
    outline: none;
    border-radius: 6px;
    font-size: 1em;
    color: #fff;
    font-weight: 600;
    margin: 0 10px 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.buttons .tryAgain-btn:hover {
    background: #fff;
    color: var(--color);
}

.buttons .goHome-btn {
    background: transparent;
    color: var(--color);
}

.buttons .goHome-btn:hover {
    background: var(--color);
    color: #fff;
}

/* --- LOGIN MODAL --- */
.login-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-modal-content {
    background: #fff;
    color: #222;
    border-radius: 10px;
    padding: 32px 28px 24px 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 300px;
    max-width: 90vw;
}
.login-modal-content h2 {
    margin-bottom: 18px;
    color: var(--color);
}
#usernameInput {
    border: 1px solid #bbb;
    border-radius: 5px;
    outline: none;
    margin-bottom: 10px;
}
#loginBtn {
    background: var(--color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}
#loginBtn:hover {
    background: var(--color2);
}

/* --- ANIMATIONS & UI POLISH --- */
.option-list .option {
    transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s, transform 0.15s;
}
.option-list .option.selected {
    border-color: #00a63d;
    background-color: #e7f3e7;
    box-shadow: 0 0 8px #00a63d44;
    transform: scale(1.03);
}
.option-list .option:active {
    transform: scale(0.97);
}

/* --- RESPONSIVE DESIGN ENHANCEMENTS --- */
@media (max-width: 700px) {
    .container, .quiz-box, .result-box, .popup-info {
        padding: 8px !important;
        min-width: 0 !important;
        max-width: 100vw !important;
    }
    .quiz-box h1, .result-box h2, .popup-info h2 {
        font-size: 1.2em !important;
    }
    .option-list .option {
        font-size: 0.95em;
        padding: 7px;
    }
    .percentage-container .circular-progress {
        width: 120px;
        height: 120px;
    }
    .percentage-container .circular-progress::before {
        width: 90px;
        height: 90px;
    }
    .result-box .percentage-container {
        width: 100%;
    }
}
@media (max-width: 480px) {
    .login-modal-content {
        min-width: 90vw;
        padding: 18px 6px 12px 6px;
    }
    .option-list .option {
        font-size: 0.9em;
        padding: 5px;
    }
}