:root {
    /* Dark theme colors based on render.im */
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --surface-color-hover: #2d2d2d;
    --surface-color-active: #333333;
    --primary-text: #ffffff;
    --secondary-text: #bbbbbb;
    --muted-text: #888888;
    --border-color: #3d3d3d;
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    /* Dynamic colors that use the tint hue */
    --primary-button: hsl(var(--tint-hue), 50%, 45%);
    --primary-button-hover: hsl(var(--tint-hue), 60%, 35%);
    --success-button: hsl(var(--tint-hue), 60%, 40%);
    --success-button-hover: hsl(var(--tint-hue), 50%, 30%);
    --danger-button: #e53935; /* Keeping red for danger */
    --danger-button-hover: #c62828;
    --correct-color: hsl(var(--tint-hue), 60%, 40%);
    --incorrect-color: #e53935;
    --correct-bg: hsla(var(--tint-hue), 50%, 15%, 0.4);
    --incorrect-bg: #3e1515;
    --progress-bg: #333333;
    --info-text: hsl(var(--tint-hue), 60%, 67%);
    --warning-bg: #4d3c00;
    --warning-color: #ffca28;
    
    /* Background configuration */
    --tint-hue: 210; /* Default hue, will be overridden by JS */
    --tint-saturation: 20;
    --tint-lightness: 30;
    --tint-opacity: 0.25;
    --background-opacity: 0.75;
    --navigation-bg: rgba(30, 30, 30, 0.95);
    
    /* Selection highlight colors */
    --selection-bg: hsla(var(--tint-hue), 60%, 40%, 0.2);
    --selection-border: hsla(var(--tint-hue), 60%, 50%, 0.8);
    --selection-active-bg: hsla(var(--tint-hue), 50%, 45%, 0.3);
    
    /* Sidebar configuration */
    --sidebar-width: 280px;
    --sidebar-bg: rgba(18, 18, 18, 0.9);
    --sidebar-header-bg: hsla(var(--tint-hue), 60%, 20%, 0.1);

    /* Blur and transparency settings */
    --blur-amount: 8px;
    --container-bg-opacity: 0.7;
    --sidebar-bg-opacity: 0.7;
    --inner-element-opacity: 0.6;

    /* Add RGB variants for backgrounds so we can use rgba */
    --correct-bg-rgb: 30, 60, 40;
    --incorrect-bg-rgb: 62, 21, 21;
    --warning-bg-rgb: 77, 60, 0;

    /* User Authentication Colors */
    --auth-button-bg: hsla(var(--tint-hue), 60%, 45%, 0.1);
    --auth-button-color: hsl(var(--tint-hue), 50%, 65%);
    --auth-button-border: hsl(var(--tint-hue), 60%, 40%);
    --auth-modal-bg: var(--surface-color);
    --modal-overlay: rgba(0, 0, 0, 0.7);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--primary-text);
}

header {
    background-color: var(--surface-color);
    color: var(--primary-text);
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px var(--shadow-color);
    z-index: 100;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
}

.logo {
    height: 2rem;
    margin-right: 1rem;
}

/* New layout structure */
.main-container {
    display: flex;
    min-height: 100vh; /* Take full viewport height */
}

/* Sidebar styles */
.sidebar-container {
    height: 100vh; /* Full height */
    position: relative; /* For proper positioning */
}

.sidebar {
    width: var(--sidebar-width);
    height: 100%; /* Full height of container */
    background-color: rgba(18, 18, 18, var(--sidebar-bg-opacity));
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px var(--shadow-color);
    transition: transform 0.3s ease, backdrop-filter 0.3s ease;
    will-change: transform;
}

.sidebar.blur-enabled {
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--sidebar-header-bg);
}

.sidebar-header .header-content {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.sidebar-header h1 {
    font-size: 1.4rem;
    margin: 0;
}

.sidebar-header .logo {
    height: 2rem;
    margin-right: 0.75rem;
}

.sidebar-header h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 500;
}

.question-count-selector {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.question-count-selector label {
    margin-right: 0.5rem;
    color: var(--secondary-text);
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.selection-summary {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary-text);
}

/* Navigation list */
.navigation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.navigation-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--secondary-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navigation-item:hover {
    background-color: var(--surface-color-hover);
}

.navigation-item.active {
    background-color: var(--selection-active-bg);
    border-left: 3px solid var(--selection-border);
    color: var(--primary-text);
    padding-left: calc(1rem - 3px);
}

.navigation-item.selected {
    background-color: var(--selection-bg);
    color: var(--primary-text);
    border-left: 3px solid var(--selection-border);
    padding-left: calc(1rem - 3px);
}

.navigation-item .count-badge {
    background-color: var(--surface-color-active);
    color: var(--secondary-text);
    border-radius: 12px;
    padding: 0.1rem 0.5rem;
    font-size: 0.8rem;
    min-width: 24px;
    text-align: center;
}

.navigation-item.selected .count-badge {
    background-color: var(--selection-border);
    color: white;
}

/* Category items - indented */
.category-item {
    padding-left: 2rem;
    font-size: 0.95em;
}

.category-item.active {
    padding-left: calc(2rem - 3px);
}

.loading-indicator {
    padding: 1rem;
    text-align: center;
    color: var(--secondary-text);
}

/* Main content */
main {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    transition: margin-left 0.3s ease;
}

main.sidebar-hidden {
    margin-left: 0;
}

.hidden {
    display: none !important;
}

#quiz-container {
    position: relative;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    padding: 1.5rem;
    width: 100%;
    max-width: 800px;
    margin: auto;
    transition: backdrop-filter 0.3s ease;
}

/* Create a semi-transparent background that covers the entire container */
#quiz-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(30, 30, 30, var(--container-bg-opacity));
    border-radius: 8px;
    z-index: -1;
}

/* Ensure all content inside is positioned properly */
#quiz-container > .quiz-screen {
    position: relative;
    z-index: 1;
    background-color: transparent;
}

/* All internal elements with backgrounds should be transparent */
#quiz-container .selection-details,
#quiz-container .selected-areas-wrapper,
#quiz-container .answers-container,
#quiz-container .answer-option,
#quiz-container .results-feedback,
#quiz-container .missed-questions {
    background-color: transparent;
    border-color: rgba(61, 61, 61, 0.7);
}

/* Keep colored borders but make them semi-transparent */
#quiz-container .selection-details {
    border-left: 4px solid hsla(var(--tint-hue), 60%, 45%, 0.8);
}

#quiz-container.blur-enabled {
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
}

/* Special treatment for status indicators - make them slightly visible but still transparent */
#quiz-container .answer-option.correct {
    background-color: hsla(var(--tint-hue), 50%, 15%, 0.3);
    border-color: hsla(var(--tint-hue), 60%, 40%, 0.7);
}

#quiz-container .answer-option.incorrect {
    background-color: rgba(62, 21, 21, 0.3);
    border-color: rgba(229, 57, 53, 0.7);
}

#quiz-container .results-feedback.success {
    background-color: hsla(var(--tint-hue), 50%, 15%, 0.3);
    border: 1px solid hsla(var(--tint-hue), 60%, 40%, 0.7);
}

#quiz-container .results-feedback.good {
    background-color: rgba(77, 60, 0, 0.3);
    border: 1px solid rgba(255, 202, 40, 0.7);
}

#quiz-container .results-feedback.needs-work {
    background-color: rgba(62, 21, 21, 0.3);
    border: 1px solid rgba(229, 57, 53, 0.7);
}

/* Make all child elements transparent */
#quiz-container .quiz-screen {
    background-color: transparent;
}

#quiz-container .selection-details {
    background-color: rgba(45, 45, 45, var(--inner-element-opacity));
    border-left: 4px solid var(--primary-button);
}

#quiz-container .selected-areas-wrapper {
    background-color: rgba(45, 45, 45, var(--inner-element-opacity));
}

#quiz-container .answers-container,
#quiz-container .answer-option {
    background-color: rgba(45, 45, 45, var(--inner-element-opacity));
}

#quiz-container .results-feedback,
#quiz-container .missed-questions {
    background-color: rgba(45, 45, 45, var(--inner-element-opacity));
}

/* Specific backgrounds for status indicators */
#quiz-container .results-feedback.success {
    background-color: rgba(var(--correct-bg-rgb), var(--inner-element-opacity));
}

#quiz-container .results-feedback.good {
    background-color: rgba(var(--warning-bg-rgb), var(--inner-element-opacity));
}

#quiz-container .results-feedback.needs-work {
    background-color: rgba(var(--incorrect-bg-rgb), var(--inner-element-opacity));
}

#quiz-container .answer-option.correct {
    background-color: rgba(var(--correct-bg-rgb), var(--inner-element-opacity));
}

#quiz-container .answer-option.incorrect {
    background-color: rgba(var(--incorrect-bg-rgb), var (--inner-element-opacity));
}

.selection-details {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--surface-color-hover);
    border-radius: 8px;
    border-left: 4px solid var(--primary-button);
}

.selected-content {
    margin-top: 1rem;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.question-badge {
    display: inline-block;
    background-color: var(--primary-button);
    color: white;
    border-radius: 12px;
    padding: 0.1rem 0.5rem;
    font-size: 0.85rem;
    min-width: 24px;
    text-align: center;
}

.selected-areas-wrapper {
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0 0.5rem;
    margin-top: 0.5rem;
    background-color: var(--surface-color-hover);
}

#selected-areas-list {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

#selected-areas-list li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

#practice-button {
    background-color: hsl(var(--tint-hue), 50%, 30%); /* Darker background */
    font-weight: 600;
    margin: 0;
    padding: 0.75rem 1.5rem;
    min-width: 150px;
    border: 2px solid var(--primary-text); /* Border matching text color */
}

#practice-button:hover:not(:disabled) {
    background-color: hsl(var(--tint-hue), 60%, 25%); /* Even darker on hover */
}

.question-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: center;
}

#exit-quiz {
    margin-left: auto;
    max-width: 150px;
    border: 2px solid hsl(var(--tint-hue), 60%, 40%);
    background-color: transparent;
    color: hsl(var(--tint-hue), 50%, 65%);
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s ease;
}

#exit-quiz:hover {
    background-color: hsla(var(--tint-hue), 50%, 40%, 0.1);
    color: hsl(var(--tint-hue), 60%, 75%);
    border-color: hsl(var(--tint-hue), 50%, 50%);
}

#check-answer, #next-question {
    min-width: 150px;
    background-color: hsl(var(--tint-hue), 50%, 30%); /* Darker background */
    font-weight: 600;
}

#check-answer:hover:not(:disabled), #next-question:hover:not(:disabled) {
    background-color: hsl(var(--tint-hue), 60%, 25%); /* Even darker on hover */
}

.question-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: center;
}

#exit-quiz {
    margin-left: auto;
    max-width: 150px;
}

#check-answer, #next-question {
    min-width: 150px;
}

.quiz-screen {
    margin-bottom: 1rem;
}

/* Start Screen */
.quiz-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.option-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var (--secondary-text);
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--surface-color-hover);
    color: var(--primary-text);
}

/* Question Screen */
.progress-bar {
    height: 8px;
    background-color: var(--progress-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

#progress-fill {
    height: 100%;
    background-color: var(--primary-button);
    width: 0;
    transition: width 0.3s ease;
}

.question-info {
    display: flex;
    justify-content: space-between;
    color: var(--muted-text);
    margin-bottom: 1rem;
}

#question-text {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-text);
}

.answers-container {
    margin-bottom: 1.5rem;
}

.answer-option {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--surface-color-hover);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

.answer-option.disabled {
    cursor: not-allowed;
    opacity: 0.8;
    pointer-events: none;
}

/* Hide the actual radio/checkbox but keep it in the DOM for functionality */
.answer-option input[type="radio"],
.answer-option input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.answer-option label {
    display: flex;
    width: 100%;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    color: var(--primary-text);
}

.answer-number {
    display: inline-flex;
    min-width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    color: var(--primary-text);
    background-color: hsla(var(--tint-hue), 60%, 40%, 0.2);
    border-radius: 10%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.answer-text {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 2rem; /* Match height of number */
}

.answer-option:hover .answer-number {
    background-color: hsla(var(--tint-hue), 60%, 40%, 0.3);
}

.answer-option.selected .answer-number {
    background-color: hsla(var(--tint-hue), 50%, 45%, 0.4);
    border-color: hsla(var(--tint-hue), 50%, 50%, 0.5);
}

.answer-option.correct .answer-number {
    background-color: hsla(var(--tint-hue), 60%, 35%, 0.5);
    border-color: var(--correct-color);
}

.answer-option.incorrect .answer-number {
    background-color: rgba(229, 57, 53, 0.2);
    border-color: var(--incorrect-color);
}

/* Selected answer styles*/
.answer-option.selected {
    background-color: var(--selection-bg);
    border-left: 3px solid var(--selection-border);
    padding-left: calc(0.75rem - 3px);
}

.answer-option.correct {
    background-color: var(--correct-bg);
    border-color: var(--correct-color);
}

.answer-option.incorrect {
    background-color: var(--incorrect-bg);
    border-color: var(--incorrect-color);
}

/* ANSWER HIGHLIGHT OVERRIDES - Maximum specificity for visibility */
.answer-option.highlight-selected,
#answers-container .answer-option.highlight-selected,
body #quiz-container .answer-option.highlight-selected,
html body .answers-container .answer-option.highlight-selected {
    background-color: var(--selection-bg) !important;
    border-left: 3px solid var(--selection-border) !important;
    padding-left: calc(0.75rem - 3px) !important;
}

.answer-option.highlight-correct,
#answers-container .answer-option.highlight-correct,
body #quiz-container .answer-option.highlight-correct,
html body .answers-container .answer-option.highlight-correct {
    background-color: var(--correct-bg) !important;
    border: 1px solid var(--correct-color) !important;
    border-left: 3px solid var(--correct-color) !important;
    padding-left: calc(0.75rem - 3px) !important;
}

.answer-option.highlight-incorrect,
#answers-container .answer-option.highlight-incorrect,
body #quiz-container .answer-option.highlight-incorrect,
html body .answers-container .answer-option.highlight-incorrect {
    background-color: var(--incorrect-bg) !important;
    border: 1px solid var(--incorrect-color) !important;
    border-left: 3px solid var(--incorrect-color) !important;
    padding-left: calc(0.75rem - 3px) !important;
}

/* Answer option highlight enhancements */
.answer-option.correct, 
.answer-option.highlight-correct {
    background-color: rgba(var(--correct-bg-rgb), var(--inner-element-opacity));
    border: 1px solid var(--correct-color);
}

.answer-option.incorrect,
.answer-option.highlight-incorrect {
    background-color: rgba(var(--incorrect-bg-rgb), var(--inner-element-opacity));
    border: 1px solid var(--incorrect-color);
}

/* Override for answer numbers */
.answer-option.correct .answer-number,
.answer-option.highlight-correct .answer-number {
    background-color: rgba(var(--correct-bg-rgb), 0.7);
    border-color: var(--correct-color);
    color: var(--primary-text);
}

.answer-option.incorrect .answer-number,
.answer-option.highlight-incorrect .answer-number {
    background-color: rgba(var(--incorrect-bg-rgb), 0.7);
    border-color: var(--incorrect-color);
    color: var(--primary-text);
}

/* Stronger styling for unanswered message */
.unanswered-message {
    color: var(--incorrect-color);
    font-style: italic;
    text-align: center;
    margin-top: 1rem;
    padding: 0.7rem;
    border: 1px dashed var(--incorrect-color);
    border-radius: 4px;
    background-color: rgba(var(--incorrect-bg-rgb), var(--inner-element-opacity));
    font-weight: 500;
}

/* Results Screen */
.results-summary {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
}

.result-item {
    text-align: center;
}

.result-label {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--muted-text);
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-text);
}

.results-feedback {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    text-align: center;
}

.results-feedback.success {
    background-color: var(--correct-bg);
    color: var(--correct-color);
}

.results-feedback.good {
    background-color: var(--warning-bg);
    color: var(--warning-color);
}

.results-feedback.needs-work {
    background-color: var(--incorrect-bg);
    color: var(--incorrect-color);
}

.missed-questions {
    margin: 1.5rem 0;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--surface-color-hover);
}

.missed-question {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.missed-question:last-child {
    border-bottom: none;
}

.missed-question-text {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--primary-text);
}

.correct-answer {
    color: var(--correct-color);
    font-style: italic;
}

.perfect-score {
    color: var(--correct-color);
    text-align: center;
    font-weight: 500;
}

.results-actions {
    margin-top: 2rem;
    text-align: center;
}

/* Buttons */
button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px var(--shadow-color);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.primary-btn, #start-quiz {
    background-color: var(--primary-button);
    color: var(--primary-text);
    border: 2px solid var(--primary-text);
    min-width: 150px;
}

.primary-btn:hover:not(:disabled), #start-quiz:hover {
    background-color: var(--primary-button-hover);
}

.secondary-btn {
    background-color: var(--surface-color-active);
    color: var(--primary-button);
    border: 1px solid var(--primary-button);
    min-width: 150px;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--incorrect-color);
}

/* Responsive Design */
@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 100%;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.hidden {
        transform: translateX(-100%);
    }
    
    .sidebar:not(.hidden) {
        transform: translateX(0);
    }
    
    main.sidebar-hidden {
        margin-left: 0;
    }
    
    main {
        padding: 1rem;
        margin-top: 60px; /* Add space for mobile header */
    }
    
    #quiz-container {
        padding: 1rem;
    }
    
    .results-summary {
        flex-direction: column;
        gap: 1rem;
    }

    #user-auth-container {
        top: 0.5rem;
        right: 0.5rem;
        position: absolute;
        z-index: 101;
    }
    
    /* Mobile navigation toggle */
    .mobile-nav-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 102;
        background-color: var(--primary-button);
        color: white;
        border: none;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        padding: 0;
        font-size: 1.5rem;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons button {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .settings-panel {
        width: 90%;
        max-width: none;
    }
}

@media (max-width: 600px) {
    .sidebar {
        max-height: none;
    }
    
    main {
        padding: 0.5rem;
    }
    
    #quiz-container {
        padding: 0.75rem;
    }
    
    .question-info {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .question-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .question-actions button {
        margin: 0;
        width: 100%;
    }
    
    #exit-quiz {
        margin-left: 0;
        max-width: none;
    }
    
    .modal-content {
        width: 90%;
        padding: 1rem;
    }
    
    .auth-tabs {
        flex-direction: column;
    }
    
    .auth-tab {
        border-radius: 4px;
        margin: 0.25rem 0;
    }
}

/* Mobile navigation menu */
.mobile-nav-toggle {
    display: none;
}

@media (min-width: 901px) {
    .mobile-nav-toggle {
        display: none;
    }
}

/* Admin Interface Styles */
.admin-panel {
    flex: 2;
    margin-right: 2rem;
}

.preview {
    flex: 1;
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.section-manager,
.category-manager,
.question-manager {
    background-color: var(--surface-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.list-container {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--surface-color);
}

.list-item {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--secondary-text);
}

.list-item:hover {
    background-color: var(--surface-color-hover);
}

.list-item.active {
    background-color: var(--surface-color-active);
    border-left: 3px solid var(--primary-button);
    font-weight: bold;
    color: var(--primary-text);
}

.answer-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.answer-text {
    flex: 1;
    margin-right: 1rem;
    margin-bottom: 0 !important;
}

.answer-correct {
    margin-right: 0.5rem;
    accent-color: var(--success-button);
}

#answers-container {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--surface-color-hover);
}

#add-answer {
    background-color: var(--muted-text);
    margin-bottom: 1rem;
}

#add-answer:hover {
    background-color: var(--secondary-text);
}

.preview-answer {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--surface-color-hover);
}

.preview-answer.correct {
    background-color: var(--correct-bg);
    border-color: var(--correct-color);
    color: var(--correct-color);
}

/* Authentication UI */
.full-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-button);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-container {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--shadow-color);
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color-hover);
    color: var(--primary-text);
    border-radius: 4px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-button);
}

.user-info {
    display: flex;
    align-items: center;
}

#user-name {
    margin-right: 1rem;
    color: var(--secondary-text);
}

#logout-button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var (--secondary-text);
    padding: 0.25rem 0.5rem;
}

#logout-button:hover {
    background-color: var(--surface-color-hover);
}

/* Admin layout adjustment */
.admin-panel main {
    display: flex;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Make header display flex for admin */
#admin-content header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Settings Button and Panel */
.settings-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: rgba(30, 30, 30, 0.8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.settings-button:hover {
    background-color: rgba(40, 40, 40, 0.9);
    transform: translateY(-2px);
}

.settings-button svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--primary-text);
}

.settings-panel {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    width: 250px;
    background-color: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    z-index: 999;
    border: 1px solid var(--border-color);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.settings-panel.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.settings-panel h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--primary-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-panel h3 .close-button {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--muted-text);
}

.settings-panel h3 .close-button:hover {
    color: var(--primary-text);
}

.settings-option {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-option label {
    margin-bottom: 0;
    font-weight: normal;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-color-hover);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--primary-text);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-button);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-button);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* User Authentication Styles */
#user-auth-container {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
}

.auth-button, .user-profile { 
    padding: 0.5rem 1rem;
    border: 2px solid var(--auth-button-border);
    background-color: var(--auth-button-bg);
    color: var(--auth-button-color);
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.auth-button:hover, .user-profile:hover {
    background-color: hsla(var(--tint-hue), 50%, 40%, 0.2);
    transform: translateY(-2px);
}

.user-profile {
    display: flex;
    align-items: center;
    position: relative;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    min-width: 120px;
    overflow: hidden;
}

.user-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--primary-text);
    cursor: pointer;
}

.user-menu button:hover {
    background-color: var(--surface-color-hover);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--auth-modal-bg);
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted-text);
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 0.75rem;
    color: var(--secondary-text);
    cursor: pointer;
    font-size: 1rem;
}

.auth-tab.active {
    color: var(--primary-text);
    border-bottom: 2px solid var(--primary-button);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color-hover);
    color: var(--primary-text);
    border-radius: 4px;
}

.error-message {
    color: var(--incorrect-color);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Learn button style */
.learn-btn {
    margin-top: 0; /* Removed top margin since they're side by side now */
    background-color: transparent;
    border: 2px solid hsl(var(--tint-hue), 60%, 40%);
    color: hsl(var(--tint-hue), 50%, 65%);
    font-weight: 600; /* Match the practice button */
    padding: 0.75rem 1.5rem;
    margin: 0;
    min-width: 150px;
}

/* Learn button with count badge */
.learn-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.learn-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background-color: hsla(var(--tint-hue), 60%, 40%, 0.8);
    color: white;
    font-size: 0.85rem;
    border-radius: 12px;
    margin-left: 8px;
    padding: 0 6px;
    font-weight: bold;
}

/* Reset progress button */
.reset-option {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.reset-button {
    background-color: var(--danger-button);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 0.5rem;
}

.reset-button:hover {
    background-color: var(--danger-button-hover);
}

.settings-description {
    font-size: 0.8rem;
    color: var(--muted-text);
    margin: 0;
}

/* Action buttons container */
.action-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem; /* Consistent gap between buttons */
    margin-top: 1.5rem;
    width: 100%;
}

.action-buttons button {
    flex: 0 0 auto; /* Prevent buttons from stretching */
    height: 3rem; /* Fixed height for both buttons */
}

/* Statistics in sidebar */
.stats-badge {
    background-color: var(--surface-color-active);
    color: var(--secondary-text);
    border-radius: 12px;
    padding: 0.1rem 0.5rem;
    font-size: 0.8rem;
    min-width: 48px;
    text-align: center;
    margin-left: 0.5rem;
}

.stats-positive {
    color: var(--correct-color);
}

.stats-negative {
    color: var(--incorrect-color);
}

.stats-neutral {
    color: var(--warning-color);
}

/* Animation styles for questions */
.question-animation {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: rgba(30, 30, 30, var(--container-bg-opacity));
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin: 1rem 0;
    overflow: hidden;
}

.question-animation .animation-object {
    position: absolute;
    transition: all 1s linear; /* Smooth transition for animation */
    /* Add fixed dimensions to prevent size changes */
    width: 50px; 
    height: 50px;
    box-sizing: border-box;
}

.question-animation .animation-object img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Maintain aspect ratio */
}

/* Answer count indicator - simplified version */
.answer-count-indicator {
    color: var(--secondary-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: transparent;
    border-left: 2px solid var(--border-color);
    display: block;
    font-weight: normal;
}

/* Minimal styling for multiple answers */
.answer-count-indicator.multiple-answers {
    font-weight: 500;
    border-left-color: var(--primary-button);
}

/* Remove pulse animation */
@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1); }
}

/* Unanswered message styling */
.unanswered-message {
    color: var(--incorrect-color);
    font-style: italic;
    text-align: center;
    margin-top: 1rem;
    padding: 0.7rem;
    border: 1px dashed var(--incorrect-color);
    border-radius: 4px;
    background-color: rgba(var(--incorrect-bg-rgb), var(--inner-element-opacity));
    font-weight: 500;
}

.missed-question .unanswered {
    color: var(--incorrect-color);
    font-style: italic;
    margin-left: 0.5rem;
}

.missed-question .incorrect-answer {
    color: var (--incorrect-color);
    margin-left: 0.5rem;
}

/* Auto-advance notice */
.auto-advance-notice {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: rgba(var(--incorrect-bg-rgb), 0.9);
    color: var(--primary-text);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Terms and Conditions styling */
.terms-notice {
    font-size: 0.85rem;
    margin-top: 1rem;
    color: var(--muted-text);
    text-align: center;
}

.terms-notice a, .agreement-checkbox a {
    color: var(--info-text);
    text-decoration: none;
}

.terms-notice a:hover, .agreement-checkbox a:hover {
    text-decoration: underline;
}

.agreement-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.agreement-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.agreement-checkbox label {
    margin: 0;
    font-size: 0.9rem;
    color: var(--secondary-text);
}
