/* --- General Styles & Reset --- */
body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; /* Modern, readable font */
    background-color: #0A0A0A; /* Deep black background for consistency */
    color: #E0E0E0; /* Off-white for general text */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0; /* Let quiz-container handle padding */
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Quiz Container --- */
.quiz-container {
    background: linear-gradient(135deg, #1C1C1E 0%, #111111 100%); /* Dark, subtle gradient */
    border-radius: 20px; /* More rounded corners */
    padding: 40px 35px; /* Increased padding */
    width: 90%;
    max-width: 750px; /* Slightly wider */
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7); /* Deeper shadow */
    border: 1px solid #282828; /* Subtle border */
    animation: fadeInScale 0.6s ease-out forwards; /* Animation on load */
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

h1 {
    color: #FFFFFF; /* Pure white for the main title */
    margin-bottom: 30px;
    font-size: 3em; /* Larger, more impactful title */
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
    position: relative;
    padding-bottom: 10px;
}

h1::after { /* Decorative line under the title */
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80px;
    height: 4px;
    background-color: #2E8B57; /* Kinema+ Green */
    border-radius: 2px;
}

/* --- Quiz Screen Transitions --- */
.quiz-screen {
    display: none;
    animation: fadeIn 0.5s ease-out forwards;
}

.quiz-screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Start and End Screen Styles --- */
#startScreen p, #endScreen p {
    font-size: 1.15em; /* Slightly larger text */
    line-height: 1.7;
    margin-bottom: 20px;
    color: #B0B0B0; /* Softer gray for descriptions */
}

#endScreen h2 {
    color: #FFFFFF; /* White for end screen heading */
    font-size: 2.5em; /* Larger heading */
    margin-bottom: 25px;
    font-weight: 700;
}

#finalScoreText {
    font-size: 2.5em; /* Prominent score */
    font-weight: bold;
    color: #2E8B57; /* Kinema+ Green for final score */
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(46, 139, 87, 0.5); /* Subtle glow */
}

#finalRemarks {
    font-style: italic;
    color: #A0A0A0;
    margin-bottom: 30px;
}

/* --- Quiz Game Screen Styles --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #282828; /* Darker, more consistent border */
}

#questionCounter, #timer, #score {
    font-size: 1.4em; /* Slightly larger stats */
    font-weight: 600;
    color: #B0B0B0; /* Softer gray for info text */
}

#timer {
    color: #FF6B6B; /* A more subtle red for timer */
    font-size: 1.8em; /* More prominent timer */
    font-weight: 700;
}

.question-box {
    background-color: #0F0F0F; /* Very dark background for question box */
    padding: 30px; /* More padding */
    border-radius: 12px; /* More rounded */
    margin-bottom: 30px;
    min-height: 100px; /* Ensure better height */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3); /* Subtle inner shadow */
    border: 1px solid #282828;
}

#questionText {
    font-size: 1.6em; /* Larger question text */
    font-weight: 600;
    color: #FFFFFF; /* Pure white for question text */
    margin: 0;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* More flexible grid, can be 1 or 2 columns */
    gap: 18px; /* Increased gap */
    margin-bottom: 30px;
}

.answer-btn {
    background-color: #1C1C1E; /* Dark grey for answer buttons */
    color: #E0E0E0; /* Off-white text */
    border: 1px solid #282828; /* Subtle border */
    border-radius: 10px; /* More rounded */
    padding: 18px 25px; /* More padding */
    font-size: 1.15em; /* Slightly larger font */
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    word-wrap: break-word;
    min-height: 70px; /* Consistent height */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Subtle shadow */
}

.answer-btn:hover:not(:disabled) {
    background-color: #2E8B57; /* Kinema+ Green on hover */
    transform: translateY(-5px); /* More pronounced lift */
    box-shadow: 0 8px 18px rgba(46, 139, 87, 0.4); /* Green glow */
    color: #fff; /* White text on hover */
}

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6; /* Slightly more opaque when disabled */
    transform: none; /* No lift */
    box-shadow: none; /* No shadow */
}

/* Styles for correct/incorrect answers */
.answer-btn.correct {
    background-color: #2E8B57; /* Kinema+ Green for correct */
    color: #ffffff;
    pointer-events: none;
    animation: pulseGreen 0.6s ease-out forwards; /* Pulse animation */
}

.answer-btn.incorrect {
    background-color: #DC3545; /* Standard red for incorrect */
    color: #ffffff;
    pointer-events: none;
    animation: shakeRed 0.4s ease-out forwards; /* Shake animation */
}

@keyframes pulseGreen {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(46, 139, 87, 0.7); }
    50% { transform: scale(1.03); box-shadow: 0 0 15px rgba(46, 139, 87, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(46, 139, 87, 0); }
}

@keyframes shakeRed {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* --- Control Buttons --- */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px; /* Space above controls */
}

.controls button, #startQuizBtn, #restartQuizBtn, #goToStatsBtn, #backToHomeBtn {
    background-color: #2E8B57; /* Kinema+ Green for primary actions */
    color: #fff;
    border: none;
    border-radius: 30px; /* Fully rounded buttons */
    padding: 15px 30px; /* More padding */
    font-size: 1.15em; /* Larger font */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.controls button:hover, #startQuizBtn:hover, #restartQuizBtn:hover, #goToStatsBtn:hover, #backToHomeBtn:hover {
    background-color: #246B44; /* Darker green on hover */
    transform: translateY(-3px); /* Lift effect */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.controls button:active, #startQuizBtn:active, #restartQuizBtn:active, #goToStatsBtn:active, #backToHomeBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) inset;
    background-color: #1A5432;
}

.quit-btn {
    background-color: #6C757D !important; /* Muted grey for quit */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.quit-btn:hover {
    background-color: #5A6268 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.quit-btn:active {
    background-color: #495057 !important;
}

/* --- Top-Right Buttons (Profile, Share, Notification) --- */
/* Assuming these are part of a global header/layout, adjusted for quiz page if needed */
.top-right-buttons {
    position: absolute; /* Position relative to quiz-container if it's the main context */
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 10; /* Ensure they are above quiz content */
}

.icon-btn {
    background: linear-gradient(to bottom right, #1A1A1A, #0A0A0A);
    border: 1px solid #282828;
    padding: 12px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to bottom right, #2E8B57, #246B44); /* Green on hover */
}
.icon-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) inset;
}

.icon-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1); /* Makes icon white */
}
.icon-btn:hover img {
    filter: brightness(100%) invert(0); /* Removes filter to show original (white) */
}

/* --- Header Ads Navigation (if applicable to quiz) --- */
/* Renamed to avoid conflicts if this is a separate navigation section */
.header-ads-nav {
    /* If this navigation is also on the quiz page, place it appropriately */
    /* For a quiz page, it might be better removed or placed within the main layout, not quiz container */
    /* For now, assuming it's not directly in the quiz container's scope */
}

/* --- Bottom Navigation (Global, usually not in quiz container) --- */
/* Assuming this is a global element, not directly within the quiz-container */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #111111; /* Dark background */
    display: flex;
    justify-content: space-around;
    padding: 12px 0; /* More padding */
    z-index: 999;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.4);
    border-top-left-radius: 20px; /* More rounded */
    border-top-right-radius: 20px; /* More rounded */
    border-top: 1px solid #282828; /* Subtle top border */
}

.bottom-nav .nav-item {
    color: #888888; /* Muted gray for inactive items */
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    padding: 8px 5px;
    border-radius: 12px; /* More rounded */
    transition: all 0.3s ease;
    flex-grow: 1;
    max-width: 90px; /* Max width for each item */
}

.bottom-nav .nav-item img {
    filter: invert(70%); /* Grayish filter for inactive icons */
    margin-bottom: 5px;
    width: 26px; /* Larger icons */
    height: 26px;
    transition: filter 0.3s ease;
}

.bottom-nav .nav-item span {
    font-size: 0.9em;
    font-weight: 500;
}

.bottom-nav .nav-item:hover {
    background-color: #1A1A1A; /* Darker background on hover */
    color: #E0E0E0; /* Off-white on hover */
    transform: translateY(-3px); /* Subtle lift */
}
.bottom-nav .nav-item:hover img {
    filter: invert(100%); /* White icon on hover */
}

.bottom-nav .nav-item.active {
    background-color: #2E8B57; /* Kinema+ Green for active item */
    color: #fff;
    transform: translateY(-5px); /* More pronounced lift for active */
    box-shadow: 0 -5px 15px rgba(46, 139, 87, 0.3); /* Green glow */
}
.bottom-nav .nav-item.active img {
    filter: invert(0%) brightness(100%); /* Pure white icon for active */
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .quiz-container {
        padding: 30px 20px;
        border-radius: 15px;
        max-width: 95%;
    }
    h1 {
        font-size: 2.5em;
        margin-bottom: 25px;
    }
    h1::after {
        width: 70px;
    }
    #endScreen h2 {
        font-size: 2em;
        margin-bottom: 20px;
    }
    #finalScoreText {
        font-size: 2em;
    }
    .header {
        flex-direction: column;
        gap: 15px;
    }
    #questionCounter, #timer, #score {
        font-size: 1.2em;
    }
    #timer {
        font-size: 1.6em;
    }
    .question-box {
        padding: 25px;
        min-height: 90px;
    }
    #questionText {
        font-size: 1.4em;
    }
    .answers-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
        gap: 15px;
    }
    .answer-btn {
        font-size: 1.05em;
        padding: 15px 20px;
        min-height: 65px;
    }
    .controls {
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
    }
    .controls button, #startQuizBtn, #restartQuizBtn, #goToStatsBtn, #backToHomeBtn {
        width: 100%; /* Full width buttons */
        max-width: 300px; /* Limit max width */
        margin: 0 auto; /* Center buttons */
        font-size: 1.05em;
        padding: 14px 25px;
    }
    .top-right-buttons {
        top: 15px;
        right: 15px;
        gap: 10px;
    }
    .icon-btn {
        width: 45px;
        height: 45px;
        padding: 10px;
    }
    .icon-btn img {
        width: 22px;
        height: 22px;
    }
    .bottom-nav {
        padding: 10px 0;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
    }
    .bottom-nav .nav-item {
        font-size: 10px;
        padding: 5px 3px;
        max-width: 80px;
    }
    .bottom-nav .nav-item img {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        padding: 25px 15px;
        border-radius: 12px;
    }
    h1 {
        font-size: 2em;
        margin-bottom: 20px;
    }
    h1::after {
        width: 60px;
    }
    #startScreen p, #endScreen p {
        font-size: 1em;
        margin-bottom: 15px;
    }
    #endScreen h2 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    #finalScoreText {
        font-size: 1.8em;
    }
    .header {
        gap: 10px;
        margin-bottom: 25px;
    }
    #questionCounter, #timer, #score {
        font-size: 1.1em;
    }
    #timer {
        font-size: 1.4em;
    }
    .question-box {
        padding: 20px;
        min-height: 80px;
    }
    #questionText {
        font-size: 1.2em;
    }
    .answers-grid {
        gap: 12px;
    }
    .answer-btn {
        font-size: 1em;
        padding: 12px 15px;
        min-height: 60px;
    }
    .controls {
        gap: 12px;
        margin-top: 20px;
    }
    .controls button, #startQuizBtn, #restartQuizBtn, #goToStatsBtn, #backToHomeBtn {
        font-size: 1em;
        padding: 12px 20px;
    }
    .top-right-buttons {
        top: 10px;
        right: 10px;
        gap: 8px;
    }
    .icon-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    .icon-btn img {
        width: 20px;
        height: 20px;
    }
    .bottom-nav {
        padding: 8px 0;
    }
    .bottom-nav .nav-item {
        font-size: 9px;
        padding: 4px 2px;
        max-width: 70px;
    }
    .bottom-nav .nav-item img {
        width: 20px;
        height: 20px;
    }
}
