/* Basic Reset & Font Imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Light Mode Colors */
    --primary-blue: #1877F2;
    --primary-blue-dark: #166ADA;
    --secondary-green: #36A420;
    --error-red: #FA383E;
    --text-color-dark: #1C1E21;
    --text-color-light: #F0F2F5;
    /* Used for text on dark backgrounds if needed, though dark-mode handles this */
    --bg-light-grey: #F0F2F5;
    --card-bg: #FFFFFF;
    --border-color: #DADDE1;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --input-bg: #F0F2F5;

    /* Concentric Button Colors (Light Mode) */
    --button-center-color: #2d7ff9;
    /* blue for center */
    --button-middle-ring-color: rgba(45, 127, 249, 0.3);
    /* slightly transparent blue */
    --button-outer-ring-color: rgba(45, 127, 249, 0.2);
    /* more transparent blue */

    /* Material You Blue Theme Variables */
    --bg-color-blue: #bbd6fd;
    --accentLightTint-blue: #e2eeff;
    --darkerColor-blue: #3569b2;
    --darkColor-blue: #4382ec;
    --textColorDark-blue: #1b3041;
    --whitishColor-blue: #ffffff;

    /* Material You Spacing */
    --gap: 30px;
    --round: 30px;

    --border-radius: 8px;
    
    /* Answer Colors (can be overridden by user settings) */
    --correct-answer-color: var(--darkColor-blue);
    --wrong-answer-color: var(--error-red);
}

/* MANUAL DARK MODE OVERRIDE */
/* This class will be added to the <html> tag by JavaScript based on user settings.
   It overrides the default light mode colors. */
html.dark-mode {
    --primary-blue: #3281E1;
    /* Lighter blue for dark mode */
    --primary-blue-dark: #2A6DC8;
    --secondary-green: #4CAF50;
    /* Adjust for better visibility */
    --error-red: #E57373;
    /* Adjust for better visibility */
    --text-color-dark: #E0E0E0;
    /* Light text on dark bg */
    --bg-light-grey: #121212;
    /* Dark background */
    --card-bg: #1E1E1E;
    /* Darker card background */
    --border-color: #333333;
    /* Darker borders */
    --shadow-light: rgba(255, 255, 255, 0.05);
    /* Lighter shadows */
    --shadow-medium: rgba(255, 255, 255, 0.1);
    --input-bg: #2C2C2C;
    /* Darker input fields */

    /* Concentric Button Colors (Dark Mode) */
    --button-center-color: #4a90e2;
    /* Lighter blue for dark mode center */
    --button-middle-ring-color: rgba(74, 144, 226, 0.3);
    /* Lighter transparent blue */
    --button-outer-ring-color: rgba(74, 144, 226, 0.2);
    /* Even lighter transparent blue */
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color-blue);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    color: var(--text-color-dark);
    line-height: 1.6;
    padding: 20px 20px 80px 20px;
    gap: 20px;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Smooth transition for theme changes */
}

.dark-mode body {
    background-color: #000000;
}

/* Quiz Controls Header */
.quiz-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px var(--shadow-light);
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    max-width: 700px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.control-header-button {
    background-color: var(--darkColor-blue);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.control-header-button:hover {
    background-color: var(--darkerColor-blue);
}

.control-header-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}


/* Top Progress Bar */
.quiz-top-progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.quiz-top-progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--darkColor-blue);
    border-radius: 4px;
    transition: width 0.3s ease-in-out, background-color 0.3s ease;
}


/* Main Quiz Container */
.quiz-container {
    background-color: var(--bg-light-grey);
    /* Should match body background for consistency */
    padding: 0;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 4px 15px var(--shadow-medium);
    opacity: 1;
    transition: opacity 0.3s ease-in-out, background-color 0.3s ease, box-shadow 0.3s ease;
}

.quiz-container.hidden {
    display: none;
}


/* Main Quiz Card */
.quiz-main-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow-light);
    display: flex;
    flex-direction: column;
    gap: 25px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.quiz-header {
    text-align: center;
    margin-bottom: 15px;
}

.quiz-header h1 {
    color: var(--primary-blue);
    margin-bottom: 5px;
    font-size: 2.5em;
    transition: color 0.3s ease;
}

.quiz-header .quiz-subtitle {
    color: var(--text-color-dark);
    /* Using variable for consistency */
    font-size: 1em;
    transition: color 0.3s ease;
}

/* Question Card */
.question-card {
    background-color: var(--bg-light-grey);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.question-number {
    font-size: 0.9em;
    color: var(--text-color-dark);
    /* Using variable for consistency */
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.question-card h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: var(--text-color-dark);
    transition: color 0.3s ease;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.option-button {
    background-color: var(--card-bg);
    color: var(--text-color-dark);
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: left;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.option-button:hover:not(.selected):not(.correct):not(.incorrect) {
    background-color: var(--bg-light-grey);
    border-color: var(--darkColor-blue);
}

.option-button.selected {
    border-color: var(--darkColor-blue);
    background-color: var(--darkColor-blue);
    color: white;
}

.option-button.correct {
    background-color: var(--correct-answer-color);
    color: white;
    border-color: var(--correct-answer-color);
    cursor: default;
}

.option-button.incorrect {
    background-color: var(--wrong-answer-color);
    color: white;
    border-color: var(--wrong-answer-color);
    cursor: default;
}

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


/* Quiz Navigation */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}

.nav-button,
.submit-button {
    background-color: var(--darkColor-blue);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    justify-content: center;
}

.nav-button:hover,
.submit-button:hover {
    background-color: var(--darkerColor-blue);
}

.nav-button:disabled,
.submit-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.submit-button.hidden {
    display: none;
}

/* Save/Load Controls */
.save-load-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
    padding: 20px 0;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow-light);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.control-button {
    background-color: var(--card-bg);
    color: var(--darkColor-blue);
    padding: 10px 20px;
    border: 1px solid var(--darkColor-blue);
    border-radius: var(--border-radius);
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.control-button:hover {
    background-color: var(--darkColor-blue);
    color: white;
}

.control-button:disabled {
    background-color: #cccccc;
    color: #888888;
    border-color: #cccccc;
    cursor: not-allowed;
}

/* Modal Styles (for both Progress and Settings modals) */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
    display: flex;
    /* Make it flex when visible to center content */
}


.modal-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow-medium);
    position: relative;
    max-width: 600px;
    width: 90%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Close button for modals */
.close-button {
    color: var(--text-color-dark);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--darkColor-blue);
    text-decoration: none;
    cursor: pointer;
}

/* Progress Modal Specific Styles */
#progress-modal .modal-content {
    text-align: center;
}

.progress-stats p {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--text-color-dark);
}

.progress-stats strong {
    color: var(--primary-blue);
}

.progress-bar-container {
    width: 100%;
    background-color: var(--border-color);
    border-radius: 5px;
    margin-top: 20px;
    height: 10px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--darkColor-blue);
    border-radius: 5px;
    transition: width 0.3s ease-in-out, background-color 0.3s ease;
}

/* Results Page Styles */
.results-page {
    display: none;
    /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    width: 500px;
}

.results-page.hidden {
    display: none;
}

.results-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px var(--shadow-medium);
    text-align: center;
    max-width: 500px;
    width: 100%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.results-card h2 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 2em;
    transition: color 0.3s ease;
}

.results-message {
    font-size: 1.2em;
    margin-bottom: 25px;
    font-weight: 500;
    color: var(--text-color-dark);
}

.results-summary p {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: var(--text-color-dark);
}

.results-summary strong {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Results Actions Container */
.results-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.results-actions .submit-button {
    flex: 1;
    min-width: 160px;
    text-decoration: none;
}

.submit-button.secondary-button {
    background-color: white;
    color: var(--darkColor-blue);
    border: 2px solid var(--darkColor-blue);
}

.submit-button.secondary-button:hover {
    background-color: var(--darkColor-blue);
    color: white;
}


/* Floating Action Button (FAB) - Concentric Button */
.fab-button {
    position: fixed;
    bottom: 25px;
    right: 25px;

    /* Adjusted size to better fit the concentric rings */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--button-center-color);
    /* Center color */
    box-shadow:
        0 0 0 10px var(--button-middle-ring-color),
        /* middle ring */
        0 0 0 20px var(--button-outer-ring-color);
    /* outer ring */

    cursor: pointer;
    border: none;
    outline: none;
    z-index: 1000;
    transition:
        background-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.2s ease,
        opacity 0.3s ease;

    color: transparent;
    /* No text/icon directly in the button */
    font-size: 0;
}

.fab-button:hover {
    transform: scale(1.05);
    /* Slightly enlarge on hover */
    box-shadow:
        0 0 0 12px var(--button-middle-ring-color),
        /* slightly larger middle ring */
        0 0 0 25px var(--button-outer-ring-color);
    /* slightly larger outer ring */
}

.fab-button:active {
    transform: translateY(0) scale(1);
    /* Reset on click */
    box-shadow:
        0 0 0 10px var(--button-middle-ring-color),
        0 0 0 20px var(--button-outer-ring-color);
    /* Reset shadows */
}

.fab-button:disabled {
    background-color: #cccccc;
    box-shadow: none;
    /* Disable rings for disabled state */
    cursor: not-allowed;
    opacity: 0.7;
}


/* Settings Modal Specific Styles */
#settings-modal .modal-content {
    max-width: 500px;
    width: 90%;
    padding: 30px;
}

.settings-options {
    margin-top: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.setting-item label {
    /* Label for the setting text (e.g., "Enable Sound Effects") */
    font-size: 1.1em;
    color: var(--text-color-dark);
    flex-grow: 1;
}

/* iOS-style Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    /* Width of the track */
    height: 24px;
    /* Height of the track */
    flex-shrink: 0;
    /* Prevents it from shrinking on smaller screens */
    margin-left: 15px;
    /* Spacing from label */
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}


/* The slider (the track) */
.slider {
    width: 65px;
    height: 30px;
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    /* Off state background */
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 24px;
    vertical-align: middle;
    /* Rounded track */
}

/* The thumb (the circle that moves) */
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    /* Height of the thumb */
    width: 16px;
    /* Width of the thumb */
    left: 7px;
    /* Initial position */
    bottom: 7px;
    background-color: var(--card-bg);
    /* Thumb color */
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
    /* Rounded thumb */
}

/* When the checkbox is checked, change slider background */
input:checked+.slider {
    background-color: var(--darkColor-blue);
    /* On state background */
}

/* Focus style for accessibility */
input:focus+.slider {
    box-shadow: 0 0 1px var(--darkColor-blue);
}

/* Move the thumb when checked */
input:checked+.slider:before {
    -webkit-transform: translateX(70px);
    /* Move thumb to right */
    -ms-transform: translateX(27px);
    transform: translateX(30px);
}


/* ==================== Material You Switch Widget (Global) ==================== */
/* --- 🔴⚪🟡style for toggle buttons---- */
.switch {
	position: relative;
	display: inline-block;
	min-width: 60px;
	height: 34px;
	margin-inline-start: 8px;
}

/* Hide the default checkbox input */
.switch input {
	display: none;
}

/* Styling for the slider */
.toggle {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background-color: var(--bg-color-blue);
	/* Background color when off */
	transition: 0.4s;
	border-radius: 34px;
	direction: ltr;
	unicode-bidi: isolate;
}

/* Styling for the slider when it's in the "on" position */
.toggle:before {
	position: absolute;
	content: "";
	height: 16px;
	width: 16px;
	inset-inline-start: 9px;
	bottom: 9px;
	background-color: var(--accentLightTint-blue);
	/* Slider color when on */
	transition: 0.175s;
	border-radius: 50%;
}

/* Apply styles when the input is checked (on) */
input:checked + .toggle {
	background-color: var(--darkColor-blue);
	/* Background color when on */
}

input:checked + .toggle:before {
	height: 24px;
	width: 24px;
	inset-inline-start: 5px;
	bottom: 5px;
	transform: translateX(26px);
}

/* --- END OF 🔴⚪🟡style for toggle buttons---- */

/* ==================== Material You Settings Drawer ==================== */
/* Settings Drawer Styles - Moved to widgets/css/drawer.css */

/* Fullscreen Dialog Styles */
.fullscreen-dialog {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.fullscreen-dialog.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fullscreen-dialog-content {
    background-color: var(--card-bg);
    width: 90%;
    max-width: 900px;
    height: 85vh;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fullscreen-dialog-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-color-blue);
}

.dark-mode .fullscreen-dialog-header {
    background-color: var(--card-bg);
}

.fullscreen-dialog-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--textColorDark-blue);
}

.dark-mode .fullscreen-dialog-header h2 {
    color: var(--text-color-dark);
}

.dialog-close-button {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--textColorDark-blue);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.dark-mode .dialog-close-button {
    color: var(--text-color-dark);
}

.dialog-close-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.dark-mode .dialog-close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.fullscreen-dialog-tabs {
    display: flex;
    background-color: var(--accentLightTint-blue);
    border-bottom: 2px solid var(--border-color);
}

.dark-mode .fullscreen-dialog-tabs {
    background-color: var(--card-bg);
}

.tab-button {
    flex: 1;
    padding: 16px 24px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--textColorDark-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    position: relative;
}

.dark-mode .tab-button {
    color: var(--text-color-dark);
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--darkColor-blue);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.tab-button.active::after {
    transform: scaleX(1);
}

.tab-button.active {
    color: var(--darkColor-blue);
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode .tab-button.active {
    color: var(--darkColor-blue);
    background-color: rgba(255, 255, 255, 0.05);
}

.tab-button:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.03);
}

.dark-mode .tab-button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.03);
}

.fullscreen-dialog-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-content {
    display: none;
    height: 100%;
    padding: 30px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* JSON Editor Tab */
.json-editor-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-filename-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background-color: transparent;
    font-size: 0.8rem;
    color: var(--textColorDark-blue);
    font-style: italic;
    opacity: 0.8;
}

.dark-mode .editor-filename-display {
    color: var(--text-color-dark);
}

.editor-filename-display i {
    font-size: 0.75rem;
}

.editor-filename-display span {
    font-weight: 400;
}

.edited-indicator {
    color: var(--darkColor-blue);
    font-size: 0.75rem;
    margin-left: 4px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background-color: var(--accentLightTint-blue);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.dark-mode .editor-toolbar {
    background-color: rgba(255, 255, 255, 0.03);
}

.toolbar-btn {
    padding: 6px 10px;
    background-color: var(--card-bg);
    color: var(--textColorDark-blue);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    white-space: nowrap;
}

.dark-mode .toolbar-btn {
    background-color: var(--card-bg);
    color: var(--text-color-dark);
}

.toolbar-btn:hover {
    background-color: var(--darkColor-blue);
    color: white;
    border-color: var(--darkColor-blue);
    transform: translateY(-1px);
}

.save-btn {
    background-color: var(--darkColor-blue);
    color: white;
    border-color: var(--darkColor-blue);
    margin-left: auto;
}

.save-btn:hover {
    background-color: var(--darkerColor-blue);
    border-color: var(--darkerColor-blue);
}

.toolbar-btn:active {
    transform: translateY(0);
}

.toolbar-btn i {
    font-size: 0.75rem;
}

.clear-filename-btn {
    display: none;
}

#json-editor {
    flex: 1;
    width: 100%;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    background-color: var(--input-bg);
    color: var(--text-color-dark);
    transition: border-color 0.3s;
}

#json-editor:focus {
    outline: none;
    border-color: var(--darkColor-blue);
}

.editor-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* File Upload Tab */
.file-upload-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.upload-area {
    width: 100%;
    max-width: 500px;
    padding: 60px 40px;
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background-color: var(--bg-light-grey);
}

.dark-mode .upload-area {
    background-color: rgba(255, 255, 255, 0.02);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--darkColor-blue);
    background-color: var(--accentLightTint-blue);
}

.dark-mode .upload-area:hover,
.dark-mode .upload-area.dragover {
    background-color: rgba(255, 255, 255, 0.05);
}

.upload-icon {
    font-size: 4rem;
    color: var(--darkColor-blue);
    margin-bottom: 20px;
}

.upload-area h3 {
    margin: 0 0 10px 0;
    color: var(--text-color-dark);
    font-size: 1.4rem;
}

.upload-area p {
    margin: 15px 0;
    color: var(--text-color-dark);
    opacity: 0.7;
}

.browse-btn {
    margin-top: 15px;
    padding: 12px 24px;
    background-color: var(--darkColor-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.browse-btn:hover {
    background-color: var(--darkerColor-blue);
}

.upload-hint {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-color-dark);
    opacity: 0.6;
    font-style: italic;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    background-color: var(--secondary-green);
    color: white;
    border-radius: 12px;
    border: none;
}

.dark-mode .file-info {
    background-color: var(--secondary-green);
}

.file-info i {
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

.file-info-text {
    flex: 1;
}

.file-info-text strong {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.file-info-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Action Buttons */
.primary-action-btn {
    padding: 12px 28px;
    background-color: var(--darkColor-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.primary-action-btn:hover {
    background-color: var(--darkerColor-blue);
}

.secondary-action-btn {
    padding: 12px 28px;
    background-color: transparent;
    color: var(--darkColor-blue);
    border: 2px solid var(--darkColor-blue);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.secondary-action-btn:hover {
    background-color: var(--accentLightTint-blue);
}

.dark-mode .secondary-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Snackbar Styles */
.snackbar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    min-width: 300px;
    max-width: 500px;
    padding: 16px 24px;
    background-color: var(--textColorDark-blue);
    color: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.dark-mode .snackbar {
    background-color: var(--card-bg);
    color: var(--text-color-dark);
    border: 1px solid var(--border-color);
}

.snackbar.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.snackbar.success {
    background-color: var(--secondary-green);
}

.dark-mode .snackbar.success {
    background-color: var(--secondary-green);
    color: white;
    border: none;
}

.snackbar.error {
    background-color: var(--error-red);
}

.dark-mode .snackbar.error {
    background-color: var(--error-red);
    color: white;
    border: none;
}

.snackbar.info {
    background-color: var(--darkColor-blue);
}

.dark-mode .snackbar.info {
    background-color: var(--darkColor-blue);
    color: white;
    border: none;
}

#snackbar-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

#snackbar-message {
    flex: 1;
    line-height: 1.4;
}

/* Global Confirmation Dialog */
.confirmation-dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirmation-dialog-overlay.active {
    display: flex;
    opacity: 1;
}

.confirmation-dialog {
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 450px;
    width: 90%;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirmation-dialog-overlay.active .confirmation-dialog {
    transform: scale(1);
}

.confirmation-dialog-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.confirmation-dialog-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--textColorDark-blue);
    font-weight: 600;
}

.dark-mode .confirmation-dialog-header h3 {
    color: var(--text-color-dark);
}

.confirmation-dialog-body {
    padding: 24px;
}

.confirmation-dialog-body p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color-dark);
    white-space: pre-line;
}

.dark-mode .confirmation-dialog-body p {
    color: var(--text-color-dark);
}

.confirmation-dialog-actions {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirmation-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.confirmation-btn.secondary-btn {
    background-color: transparent;
    color: var(--textColorDark-blue);
    border: 2px solid var(--border-color);
}

.dark-mode .confirmation-btn.secondary-btn {
    color: var(--text-color-dark);
    border-color: var(--border-color);
}

.confirmation-btn.secondary-btn:hover {
    background-color: var(--accentLightTint-blue);
    border-color: var(--darkColor-blue);
}

.dark-mode .confirmation-btn.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.confirmation-btn.primary-btn {
    background-color: var(--darkColor-blue);
    color: white;
}

.confirmation-btn.primary-btn:hover {
    background-color: var(--darkerColor-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    body {
        padding: 12px 10px 70px 10px;
        gap: 15px;
    }

    .quiz-controls-header,
    .quiz-container {
        max-width: 100%;
        width: calc(100% - 20px);
    }

    .quiz-main-card {
        padding: 25px;
        gap: 20px;
    }

    .quiz-header h1 {
        font-size: 2em;
    }

    .quiz-header .quiz-subtitle {
        font-size: 0.9em;
    }

    .question-card h2 {
        font-size: 1.4em;
    }

    .options-grid {
        grid-template-columns: 1fr;
        /* Single column for options on smaller screens */
    }

    .option-button {
        padding: 12px 18px;
        font-size: 0.95em;
    }

    .nav-button,
    .submit-button {
        padding: 10px 20px;
        font-size: 0.95em;
    }

    .save-load-controls {
        flex-direction: column;
    }

    .control-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px 5px 70px 5px;
        gap: 10px;
    }

    .quiz-controls-header,
    .quiz-container {
        width: calc(100% - 10px);
        max-width: 100%;
    }

    .quiz-container {
        padding: 0;
        gap: 15px;
    }

    .quiz-header h1 {
        font-size: 1.8em;
    }

    .quiz-header .quiz-subtitle {
        font-size: 0.9em;
    }

    .question-card h2 {
        font-size: 1.3em;
    }

    .options-grid {
        gap: 10px;
    }

    .option-button {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .nav-button,
    .submit-button {
        padding: 8px 15px;
        font-size: 0.85em;
        gap: 5px;
    }

    .results-actions {
        flex-direction: column;
        gap: 12px;
    }

    .results-actions .submit-button {
        width: 100%;
        min-width: auto;
    }

    .quiz-controls-header {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }

    .snackbar {
        min-width: 280px;
        max-width: 90%;
        bottom: 20px;
        font-size: 0.9rem;
        padding: 14px 20px;
    }
    
    .editor-toolbar {
        gap: 6px;
    }
    
    .toolbar-btn {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    .toolbar-btn i {
        font-size: 0.8rem;
    }

    .control-header-button {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    .control-header-button:last-child {
        margin-bottom: 0;
    }


    #settings-modal .modal-content {
        padding: 20px;
    }

    /* Adjust setting-item for mobile when using toggles */
    .setting-item {
        flex-direction: column;
        /* Stack label and switch vertically */
        align-items: flex-start;
        /* Align text to the left */
    }

    .setting-item label {
        /* The main text label for the setting */
        margin-bottom: 5px;
        /* Add space between label and switch */
    }

    .switch {
        margin-left: 0;
        /* Remove left margin for better centering in column layout */
    }
}

table {
    width: 100%;
    margin-bottom: 40px;
    border-spacing: 0 20px;
    border-collapse: separate;

}

tr td:first-child {
    text-align: left;
    font-weight: 600;

}

tr td:last-child {
    text-align: right;
}


.code-snippet-container {
    margin-bottom: 20px;
    display: none;
    /* Hidden by default, shown by JS */
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #272822;
    /* Typically dark for code themes */
}

.code-snippet-container pre[class*="language-"] {
    margin: 0;
    padding: 1em;
    overflow-x: auto;
    border-radius: var(--border-radius);
}