@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.quiz-container {
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    padding: 30px;
    box-sizing: border-box;
    position: relative; /* Needed for button positioning */
}

#quiz-header {
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

#quiz-header h1 {
    margin: 0 0 15px 0;
    color: #003366;
}

#category-filter-container {
    margin-bottom: 15px;
}

#category-filter-container label {
    margin-right: 10px;
    font-weight: 500;
}

#category-filter {
    padding: 8px 12px;
    border-radius: 5px;
    border: 2px solid #ced4da;
    font-size: 1em;
}

#quiz-progress {
    display: flex;
    justify-content: space-between;
    font-weight: 500;
    color: #555;
    margin-top: 10px;
}

#jump-navigation {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#question-jump-input {
    width: 120px;
    padding: 8px;
    border: 2px solid #ced4da;
    border-radius: 5px;
    text-align: center;
    font-size: 1em;
}

#jump-btn {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#jump-btn:hover {
    background-color: #218838;
}

#question-card {
    margin-bottom: 20px;
}

#question-category {
    background-color: #e7f3ff;
    color: #0056b3;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 15px;
}

#question-text {
    font-size: 1.4em;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 25px;
}

#options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    background-color: #f8f9fa;
    border: 2px solid #ced4da;
    border-radius: 8px;
    padding: 15px;
    text-align: left;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    width: 100%;
    display: flex;
    align-items: center;
}

.option-btn:hover:not([disabled]) {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.option-btn.selected {
    border-color: #007bff;
    background-color: #cce5ff;
}

.option-prefix {
    font-weight: 700;
    margin-right: 10px;
    color: #003366;
}

.option-btn.correct {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.option-btn.incorrect {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

#prev-btn, #submit-btn, #next-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

#prev-btn {
    background-color: #6c757d;
}

#prev-btn:hover {
    background-color: #5a6268;
}

#submit-btn:hover, #next-btn:hover {
    background-color: #0056b3;
}

.hide {
    display: none;
}

/* --- Theme Toggle Button --- */
#theme-toggle-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background-color: #f0f4f8;
    border: 2px solid #ced4da;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

#theme-toggle-btn:hover {
    background-color: #e9ecef;
}


/* --- Dark Mode Styles (Revised for Better Contrast) --- */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .quiz-container {
    background-color: #1e1e1e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

body.dark-mode #quiz-header {
    border-bottom: 2px solid #333;
}

body.dark-mode #quiz-header h1 {
    color: #ffffff;
}

body.dark-mode #quiz-progress {
    color: #bdbdbd;
}

body.dark-mode #theme-toggle-btn {
    background-color: #2c2c2c;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode #theme-toggle-btn:hover {
    background-color: #424242;
}

body.dark-mode #category-filter,
body.dark-mode #question-jump-input {
    background-color: #2c2c2c;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode #question-category {
    background-color: #2c5282;
    color: #bee3f8;
}

/* --- Improved Option Buttons (Main Fix) --- */
body.dark-mode .option-btn {
    background-color: #2c2c2c;
    border: 2px solid #555;
    color: #e0e0e0; /* High contrast text */
}

body.dark-mode .option-btn:hover:not([disabled]) {
    background-color: #424242;
    border-color: #777;
}

body.dark-mode .option-prefix {
    color: #64b5f6;
}

body.dark-mode .option-btn.selected {
    background-color: #0d47a1; /* Deeper blue for selection */
    border-color: #2196F3;   /* Bright blue border */
    color: #ffffff;
}

body.dark-mode .option-btn.correct {
    background-color: #1b5e20; /* Dark green background */
    border-color: #4CAF50;   /* Bright green border */
    color: #ffffff;
}

body.dark-mode .option-btn.incorrect {
    background-color: #b71c1c; /* Dark red background */
    border-color: #f44336;   /* Bright red border */
    color: #ffffff;
}
