/* CSS Variables */
:root {
    --primary-color: #0a2540;
    --primary-hover: #061829;
    --accent-color: #00b894;
    --accent-hover: #00a187;
    --secondary-color: #6b7280;
    --success-color: #00b894;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f3f4f6;
    --card-background: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;

    /* Sidebar variables */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --sidebar-bg: var(--primary-color);
    --sidebar-text: rgba(255, 255, 255, 0.8);
    --sidebar-text-active: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-bg: rgba(255, 255, 255, 0.15);
    --sidebar-transition: 0.3s ease;
    --topbar-height: 60px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover, .nav a.active {
    color: var(--primary-color);
    text-decoration: none;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 0;
}

/* Cards */
.card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--background-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

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

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 4px;
}

.form-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check label {
    cursor: pointer;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    background: var(--background-color);
}

.table tr:hover {
    background: var(--background-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 1.125rem;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-background);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Test Card */
.test-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.test-info h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.test-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Question Card */
.question-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.question-number {
    font-weight: 600;
    color: var(--primary-color);
}

.question-text {
    font-size: 1.125rem;
    margin-bottom: 20px;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    border-color: var(--accent-color);
    background: rgba(0, 184, 148, 0.05);
}

.option-item.selected {
    border-color: var(--accent-color);
    background: rgba(0, 184, 148, 0.1);
}

.option-item.correct {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.option-item.incorrect {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.option-marker {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.option-item.selected .option-marker {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: white;
}

/* Timer */
.timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 12px 24px;
    background: rgba(10, 37, 64, 0.1);
    border-radius: var(--radius);
}

.timer.warning {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.timer.danger {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-fill.success {
    background: var(--success-color);
}

.progress-fill.danger {
    background: var(--danger-color);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--background-color);
    text-decoration: none;
}

/* Search */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

/* Margin utilities */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.font-bold { font-weight: 700; }

/* Hidden */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --radius: 6px;
        --radius-lg: 10px;
    }

    .container {
        padding: 0 12px;
    }

    body {
        font-size: 14px;
    }

    /* Header & Navigation */
    .header {
        padding: 12px 0;
    }

    .header .container {
        flex-direction: column;
        gap: 12px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .nav a {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    /* Cards & Layout */
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .test-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .test-card-content {
        width: 100%;
    }

    /* Forms */
    .form-group {
        margin-bottom: 12px;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .form-input, .form-textarea, .form-select {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* Touch-friendly minimum */
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 0.95rem;
        min-height: 44px;
        min-width: 44px; /* Touch-friendly minimum */
    }

    .btn-lg {
        padding: 12px 20px;
        min-height: 48px;
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Modal */
    .modal {
        margin: 12px;
        max-width: calc(100% - 24px);
    }

    .modal-content {
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Modals */
    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 12px 16px;
    }

    /* Tables */
    .admin-table {
        font-size: 0.85rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 12px;
    }

    /* Auth pages */
    .auth-page {
        padding: 12px;
    }

    .auth-card {
        padding: 16px;
        margin: 12px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }

    /* Test taking */
    .question-container {
        padding: 12px;
    }

    .question-text {
        font-size: 1rem;
    }

    .option {
        padding: 10px;
        margin: 8px 0;
        min-height: 44px;
    }

    /* Utility adjustments */
    .gap-2 { gap: 6px; }
    .gap-4 { gap: 12px; }
    
    .mt-2 { margin-top: 6px; }
    .mt-4 { margin-top: 12px; }
    .mt-6 { margin-top: 16px; }
    .mb-2 { margin-bottom: 6px; }
    .mb-4 { margin-bottom: 12px; }
    .mb-6 { margin-bottom: 16px; }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .container {
        padding: 0 8px;
    }

    /* Headers */
    .header {
        padding: 8px 0;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .header h2 {
        font-size: 1.1rem;
    }

    /* Navigation */
    .nav {
        gap: 4px;
    }

    .nav a {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    /* Cards & Sections */
    .card, .auth-card {
        padding: 12px;
        margin: 8px;
    }

    .section {
        padding: 12px;
    }

    /* Forms - Large for touch */
    .form-input, .form-textarea, .form-select, .btn {
        font-size: 16px;
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 6px;
    }

    /* Buttons stack vertically */
    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }

    /* Text sizes */
    .text-lg { font-size: 1rem; }
    .text-md { font-size: 0.95rem; }
    .text-sm { font-size: 0.85rem; }

    /* Tables become list-style on very small screens */
    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 6px 8px;
    }

    /* Modals */
    .modal {
        margin: 8px;
        max-width: calc(100% - 16px);
    }

    /* Hide less important elements */
    .hide-mobile {
        display: none !important;
    }

    /* Flex adjustments */
    .flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Stats should stack */
    .stats-grid, .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    /* Actions should full-width */
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .btn:hover, 
    .nav a:hover,
    .card:hover {
        background: initial;
        transform: none;
    }

    /* Larger tap targets */
    button, input[type="button"], input[type="submit"], a.btn {
        min-height: 48px;
        min-width: 48px;
    }

    /* Better input spacing */
    input, textarea, select {
        min-height: 44px;
        font-size: 16px;
    }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --primary-color: #1e3a5f;
    --primary-hover: #2d4a6f;
    --accent-color: #00d9a6;
    --accent-hover: #00c49a;
    --secondary-color: #9ca3af;
    --success-color: #00d9a6;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --background-color: #0f172a;
    --card-background: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);

    /* Sidebar in dark mode */
    --sidebar-bg: #0f172a;
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-text-active: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(255, 255, 255, 0.12);
}

/* Dark mode badge adjustments */
[data-theme="dark"] .badge-success {
    background: rgba(0, 217, 166, 0.2);
    color: #00d9a6;
}

[data-theme="dark"] .badge-danger {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

[data-theme="dark"] .badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .badge-info {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

[data-theme="dark"] .badge-secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

/* Dark mode alert adjustments */
[data-theme="dark"] .alert-success {
    background: rgba(0, 217, 166, 0.15);
    color: #00d9a6;
    border-color: rgba(0, 217, 166, 0.3);
}

[data-theme="dark"] .alert-danger {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="dark"] .alert-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .alert-info {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
}

/* Dark mode form inputs */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    background: var(--card-background);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-input::placeholder,
[data-theme="dark"] .form-textarea::placeholder {
    color: var(--text-secondary);
}

/* Dark mode table */
[data-theme="dark"] .table th {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Dark mode option items */
[data-theme="dark"] .option-item:hover {
    background: rgba(0, 217, 166, 0.1);
}

[data-theme="dark"] .option-item.selected {
    background: rgba(0, 217, 166, 0.15);
}

/* Dark mode timer */
[data-theme="dark"] .timer {
    background: rgba(30, 58, 95, 0.5);
}

/* Dark mode pagination */
[data-theme="dark"] .pagination-btn {
    background: var(--card-background);
    color: var(--text-primary);
}

/* Dark mode dropdown */
[data-theme="dark"] .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Dark mode link color adjustment */
[data-theme="dark"] a {
    color: var(--accent-color);
}

/* Dark mode spinner */
[data-theme="dark"] .spinner {
    border-color: var(--border-color);
    border-top-color: var(--accent-color);
}

/* Dark mode auth page logo */
[data-theme="dark"] .auth-card img {
    filter: brightness(1.3) contrast(1.1);
}

/* Theme toggle button */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.theme-toggle .material-icons {
    font-size: 22px;
}

/* Theme toggle on auth pages */
.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: var(--card-background);
    box-shadow: var(--shadow);
}

.auth-theme-toggle:hover {
    background: var(--card-background);
    box-shadow: var(--shadow-lg);
}

/* Smooth theme transition */
body,
body * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
