:root {
    --bg-main: #18181b;
    --bg-card: #23232a;
    --bg-accent: #23232b;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --border-main: #3d3d3d;
    --accent: #6366f1;
    --accent2: #22c55e;
    --accent3: #eab308;
    --accent4: #ef4444;
    --shadow: 0 2px 12px 0 #0000001a;
    --transition: background 0.3s, color 0.3s, border 0.3s;
    --pill-bg: color-mix(in srgb, var(--accent) 10%, var(--bg-accent) 90%);
    --pill-text: var(--accent);
    --progress-bar-bg: var(--bg-accent);
    --progress-bar-border: var(--border-main);
    --progress-bar-gradient: linear-gradient(90deg, var(--accent), var(--accent2));
    --divider: var(--border-main);
    --modal-overlay: rgba(0,0,0,0.45);
    --hover-bg: #23232b;
    --aurora1: #7dd3fc;
    --aurora2: #6366f1;
    --aurora3: #facc15;
    --aurora4: #22d3ee;
}
.theme-light {
    --bg-main: #f7f7fa;
    --bg-card: #fff;
    --bg-accent: #fefeff;
    --text-main: #23232a;
    --text-muted: #6b7280;
    --border-main: #d1d5db;
    --accent: #6366f1;
    --accent2: #22c55e;
    --accent3: #eab308;
    --accent4: #ef4444;
    --shadow: 0 2px 12px 0 #6366f122;
    --pill-bg: color-mix(in srgb, var(--accent) 10%, var(--bg-accent) 90%);
    --pill-text: var(--accent);
    --progress-bar-bg: var(--bg-accent);
    --progress-bar-border: var(--border-main);
    --progress-bar-gradient: linear-gradient(90deg, var(--accent), var(--accent2));
    --divider: var(--border-main);
    --modal-overlay: rgba(100,100,120,0.18);
    --hover-bg: #f1f5fb;
    --aurora1: #a5b4fc;
    --aurora2: #f0abfc;
    --aurora3: #fde68a;
    --aurora4: #6ee7b7;
}
.theme-solarized {
    --bg-main: #fdf6e3;
    --bg-card: #f5ecd7;
    --bg-accent: #fff7e5;
    --text-main: #657b83;
    --text-muted: #93a1a1;
    --border-main: #d1cfae;
    --accent: #268bd2;
    --accent2: #859900;
    --accent3: #b58900;
    --accent4: #dc322f;
    --shadow: 0 2px 12px 0 #b5890033;
    --pill-bg: color-mix(in srgb, var(--accent) 10%, var(--bg-accent) 90%);
    --pill-text: var(--accent);
    --progress-bar-bg: var(--bg-accent);
    --progress-bar-border: var(--border-main);
    --progress-bar-gradient: linear-gradient(90deg, var(--accent), var(--accent2));
    --divider: var(--border-main);
    --modal-overlay: rgba(200,180,100,0.13);
    --hover-bg: #ece5c7;
    --aurora1: #268bd2;
    --aurora2: #b58900;
    --aurora3: #859900;
    --aurora4: #2aa198;
}
.theme-forest {
    --bg-main: #1b2b1b;
    --bg-card: #223322;
    --bg-accent: #2d4a2d;
    --text-main: #e6ffe6;
    --text-muted: #a3c9a3;
    --border-main: #3a5c3a;
    --accent: #4ade80;
    --accent2: #2230ee;
    --accent3: #a3e635;
    --accent4: #facc15;
    --shadow: 0 2px 12px 0 #4ade8033;
    --pill-bg: color-mix(in srgb, var(--accent) 10%, var(--bg-accent) 90%);
    --pill-text: var(--accent);
    --progress-bar-bg: var(--bg-accent);
    --progress-bar-border: var(--border-main);
    --progress-bar-gradient: linear-gradient(90deg, var(--accent), var(--accent2));
    --divider: var(--border-main);
    --modal-overlay: rgba(34,211,238,0.13);
    --hover-bg: #294429;
    --aurora1: #4ade80;
    --aurora2: #22d3ee;
    --aurora3: #a3e635;
    --aurora4: #facc15;
}
.theme-ocean {
    --bg-main: #0a192f;
    --bg-card: #112240;
    --bg-accent: #233554;
    --text-main: #dbeafe;
    --text-muted: #7dd3fc;
    --border-main: #334155;
    --accent: #38bdf8;
    --accent2: #c6d406;
    --accent3: #818cf8;
    --accent4: #f472b6;
    --shadow: 0 2px 12px 0 #38bdf833;
    --pill-bg: color-mix(in srgb, var(--accent) 10%, var(--bg-accent) 90%);
    --pill-text: var(--accent);
    --progress-bar-bg: var(--bg-accent);
    --progress-bar-border: var(--border-main);
    --progress-bar-gradient: linear-gradient(90deg, var(--accent), var(--accent2));
    --divider: var(--border-main);
    --modal-overlay: rgba(6,182,212,0.13);
    --hover-bg: #1e293b;
    --aurora1: #38bdf8;
    --aurora2: #818cf8;
    --aurora3: #f472b6;
    --aurora4: #06b6d4;
}
.theme-cyberpunk {
    --bg-main: #18122B;
    --bg-card: #232046;
    --bg-accent: #2d1e4a;
    --text-main: #f8fafc;
    --text-muted: #f472b6;
    --border-main: #a21caf;
    --accent: #f472b6;
    --accent2: #facc15;
    --accent3: #38bdf8;
    --accent4: #a21caf;
    --shadow: 0 2px 12px 0 #f472b633;
    --pill-bg: color-mix(in srgb, var(--accent) 10%, var(--bg-accent) 90%);
    --pill-text: var(--accent);
    --progress-bar-bg: var(--bg-accent);
    --progress-bar-border: var(--border-main);
    --progress-bar-gradient: linear-gradient(90deg, var(--accent), var(--accent2));
    --divider: var(--border-main);
    --modal-overlay: rgba(250,204,21,0.13);
    --hover-bg: #3b0764;
    --aurora1: #f472b6;
    --aurora2: #facc15;
    --aurora3: #38bdf8;
    --aurora4: #a21caf;
}
body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    transition: var(--transition);
}
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}
.header {
    text-align: center;
    margin-bottom: 36px;
    position: relative;
}
/* Refined Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 18px;
    right: 24px;
    z-index: 20;
    display: flex;
    align-items: center;
}
.theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-accent);
    color: var(--accent);
    border: 1.5px solid var(--border-main);
    /* box-shadow: var(--shadow); */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35em;
    cursor: pointer;
    transition: var(--transition), box-shadow 0.2s;
    outline: none;
    position: relative;
}
.theme-toggle-btn:hover, .theme-toggle-btn:focus {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.theme-toggle-btn svg {
    width: 1.5em;
    height: 1.5em;
    display: block;
}
.theme-toggle-btn .theme-toggle-arrow {
    margin-left: 0.2em;
    font-size: 0.8em;
    transition: transform 0.2s;
}
.theme-dropdown {
    position: absolute;
    top: 54px;
    right: 0;
    background: var(--bg-card);
    border: 1.5px solid var(--border-main);
    border-radius: 14px;
    /* box-shadow: var(--shadow); */
    z-index: 100;
    min-width: 170px;
    display: none;
    flex-direction: column;
    padding: 8px 0;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
}
.theme-dropdown.show {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.theme-dropdown-item {
    width: calc(100% - 20px);
    background: none;
    border: none;
    color: var(--text-main);
    text-align: left;
    padding: 12px 22px 12px 18px;
    font-size: 1.08em;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.18s, color 0.18s;
    margin: 10px;
}
.theme-dropdown-item svg {
    width: 1.2em;
    height: 1.2em;
}
.theme-dropdown-item.active, .theme-dropdown-item:hover, .theme-dropdown-item:focus {
    background: var(--accent);
    color: #fff;
    outline: none;
    border-color: var(--accent);
}
/* Smooth transitions for theme changes */
* {
    transition: var(--transition);
}
.header h1 {
    font-size: 2.8rem;
    margin-bottom: 8px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.3;
    position: relative;
    display: inline-block;
}
.header h1::after {
    content: '';
    display: block;
    margin: 0 auto;
    margin-top: 8px;
    width: 60%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent) 40%, var(--accent2) 100%);
    opacity: 0.7;
    margin-bottom: 30px;
}
.header p {
    font-size: 1.18rem;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.upload-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 30px;
    /* box-shadow: 0 2px 8px 0 #0000000d; */
    border: 1px solid var(--border-main);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.file-input-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    background: var(--bg-accent);
    color: var(--accent);
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid var(--border-main);
    transition: background 0.2s, border 0.2s;
}
.file-input-wrapper:hover {
    background: var(--hover-bg);
    border-color: var(--accent);
}
.file-input-wrapper input[type=file] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px 0 #0000000d;
    border: 1px solid var(--border-main);
    transition: box-shadow 0.2s, border 0.2s;
}
.stat-card:hover {
    box-shadow: 0 4px 16px 0 var(--shadow);
    border-color: var(--accent);
    background: var(--hover-bg);
}
.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.stat-label {
    font-size: 1rem;
    color: #a1a1aa;
}
.easy { color: var(--accent2); }
.medium { color: var(--accent3); }
.hard { color: var(--accent4); }
.completed { color: #6366f1; }
.controls {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px 0 #0000000d;
    border: 1px solid var(--border-main);
}
.filter-controls-group {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    background: var(--bg-accent);
    border-radius: 10px;
    padding: 16px 18px 10px 18px;
    margin-bottom: 12px;
    border: 1px solid var(--border-main);
}
.filter-search-group {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    background: var(--bg-accent);
    border-radius: 10px;
    padding: 16px 18px 10px 18px;
    margin-bottom: 12px;
    border: 1px solid var(--border-main);
}
.filter-actions-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: var(--bg-accent);
    border-radius: 10px;
    padding: 16px 18px 10px 18px;
    margin-bottom: 0;
    border: 1px solid var(--border-main);
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
select, input[type="text"] {
    padding: 10px 15px;
    border: 1px solid var(--border-main);
    background: var(--bg-accent);
    color: var(--text-main);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, background 0.2s;
}
select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #6366f1;
    background: #23232b;
}
.reset-btn {
    background: var(--bg-accent);
    color: var(--accent);
    border: 1px solid var(--border-main);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s, border 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px 0 #0000000d;
}
.reset-btn:hover, .reset-btn:focus {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 4px 16px 0 var(--shadow);
}
.reset-btn[style*='background: #059669'],
.reset-btn[style*='background: #7c3aed'] {
    background: var(--bg-accent) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-main) !important;
}
.reset-btn[style*='background: #059669']:hover,
.reset-btn[style*='background: #7c3aed']:hover {
    background: var(--bg-main) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}
.progress-bar {
    width: 100%;
    height: 18px;
    background: var(--progress-bar-bg);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--progress-bar-border);
}
.progress-fill {
    height: 100%;
    background: var(--progress-bar-gradient);
    transition: width 0.3s cubic-bezier(.4,2,.6,1);
}
.chart-container {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px 0 #0000000d;
    border: 1px solid var(--border-main);
}
.questions-table {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 24px;
    /* box-shadow: 0 2px 8px 0 #0000000d; */
    border: 1px solid var(--border-main);
    overflow-x: auto;
    min-width: 0;
    width: 100%;
    display: block;
}
.questions-table table {
    min-width: 800px;
    width: 100%;
    table-layout: auto;
}
.questions-table th, .questions-table td {
    white-space: nowrap;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 8px;
    overflow: hidden;
}
th, td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-main);
}
th {
    /* background: var(--bg-card); */
    font-weight: 600;
    color: var(--text-main);
    position: sticky;
    top: 0;
    z-index: 10;
}
tr:hover {
    background: var(--hover-bg);
}
.question-title {
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
}
.question-title:hover {
    text-decoration: underline;
    color: var(--text-muted);
}
.question-id {
    color: var(--text-muted);
    font-weight: 500;
}
.question-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
}
.question-link:hover {
    text-decoration: underline;
    color: var(--accent2);
}
.difficulty-badge {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--border-main);
}
.difficulty-easy {
    background: color-mix(in srgb, var(--accent2) 10%, transparent) !important;
    color: var(--accent2) !important;
    border-color: color-mix(in srgb, var(--accent2) 20%, transparent) !important;
}
.difficulty-medium {
    background: color-mix(in srgb, var(--accent3) 10%, transparent) !important;
    color: var(--accent3) !important;
    border-color: color-mix(in srgb, var(--accent3) 20%, transparent) !important;
}
.difficulty-hard {
    background: color-mix(in srgb, var(--accent4) 10%, transparent) !important;
    color: var(--accent4) !important;
    border-color: color-mix(in srgb, var(--accent4) 20%, transparent) !important;
}
.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    background: var(--bg-accent);
    cursor: pointer;
    display: inline-block;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
    margin: 0;
    vertical-align: middle;
}
.checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.checkbox:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.checkbox:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 13px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    border-radius: 1px;
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
}
td:first-child {
    text-align: center;
    vertical-align: middle;
    padding-left: 0;
    padding-right: 0;
}
.acceptance-rate {
    font-weight: 600;
    color: var(--accent2);
}
.frequency-bar {
    width: 100px;
    height: 10px;
    background: var(--bg-accent);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-main);
    margin: 0 auto;
}
.frequency-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 6px 0 0 6px;
    transition: width 0.3s cubic-bezier(.4,2,.6,1);
}
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #a1a1aa;
    font-size: 1.1rem;
}
.saved-file-btn {
    background: none;
    color: var(--text-main);
    border: 1px solid var(--border-main);
    padding: 12px 12px 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 400;
    font-family: monospace;
    transition: background 0.2s, border 0.2s, color 0.2s, box-shadow 0.2s;
    /* box-shadow: 0 1px 2px 0 #0000000d; */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 180px;
    position: relative;
    width: 260px;
    max-width: 260px;
    width: fit-content;
    height: fit-content;
    overflow-wrap: break-word;
    word-break: break-word;
    min-height: 50px;
    justify-content: center;
}
.saved-file-btn:hover, .saved-file-btn:focus {
    background: var(--hover-bg);
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}
.saved-file-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.file-actions {
    position: absolute;
    bottom: 2px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.file-menu-btn {
    background: none;
    border: none;
    color: #a1a1aa;
    opacity: 0.1;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.file-menu-btn:hover, .file-menu-btn:focus {
    opacity: 1;
    background: var(--hover-bg);
    color: var(--accent);
    outline: none;
    border-color: var(--accent);
}
.file-menu-popover {
    display: none;
    position: absolute;
    top: 32px;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    box-shadow: 0 4px 24px #00000022;
    z-index: 100;
    min-width: 120px;
}
.file-menu-popover.show {
    display: block;
}
.file-menu-item {
    width: 100%;
    background: none;
    border: none;
    color: var(--accent4);
    text-align: left;
    padding: 10px 16px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.file-menu-item:hover, .file-menu-item:focus {
    background: var(--hover-bg);
    color: #fff;
    outline: none;
    border-color: var(--accent4);
}
.delete-file-btn {
    background: var(--accent4);
    color: #fff;
    border: none;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 5px;
    transition: background 0.2s;
}
.delete-file-btn:hover, .delete-file-btn:focus {
    background: var(--accent4);
    outline: none;
    border-color: var(--accent4);
}
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .filter-controls-group, .filter-search-group, .filter-actions-group {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        justify-content: space-between;
    }
    .header h1 {
        font-size: 2rem;
    }
    table {
        font-size: 0.9rem;
    }
    th, td {
        padding: 10px;
    }
}
.collapsible-section {
    margin-bottom: 28px;
    border-radius: 12px;
    overflow: hidden;
    background: none;
    box-shadow: 0 2px 12px 0 #0000000d;
    border: 1.5px solid var(--border-main);
    transition: box-shadow 0.2s;
}
.collapsible-header {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--text-main) !important;
    font-size: 1.18rem;
    font-weight: 600;
    padding: 20px 28px 18px 28px;
    border: none;
    border-radius: 12px 12px 0 0;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    user-select: none;
    outline: none;
    position: relative;
}
.collapsible-header:focus-visible {
    box-shadow: 0 0 0 2px #6366f1;
    z-index: 2;
}
/* .collapsible-header:hover {
    background: var(--hover-bg);
    color: var(--accent);
    border-color: var(--accent);
} */
.collapsible-chevron {
    display: flex;
    align-items: center;
    transition: transform 0.25s cubic-bezier(.4,2,.6,1);
    width: 1.3em;
    height: 1.3em;
}
.collapsible-section.collapsed .collapsible-chevron {
    transform: rotate(-90deg);
}
.collapsible-divider {
    width: 100%;
    height: 1.5px;
    background: var(--divider);
    border-radius: 1px;
    margin: 0 0 0 0;
}
.collapsible-content {
    display: block;
    max-height: 0;
    overflow: hidden;
    padding: 0 28px;
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
    transition: max-height 0.35s cubic-bezier(.4,2,.6,1), padding 0.2s;
}
.collapsible-section:not(.collapsed) .collapsible-content {
    padding: 22px 28px 28px 28px;
    max-height: 5000px;
    overflow: visible;
    transition: max-height 0.5s cubic-bezier(.4,2,.6,1), padding 0.2s;
}
.collapsible-section.collapsed .collapsible-content {
    padding: 0 28px;
    max-height: 0;
}
#questionsSection.collapsible-section:not(.collapsed) .collapsible-content {
    max-height: none;
}
.questions-table-scroll {
    overflow-x: auto;
    width: 100%;
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--modal-overlay);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 8px 32px #00000044;
    padding: 32px 28px 24px 28px;
    min-width: 340px;
    max-width: 95vw;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--text-main);
    position: relative;
}
.modal h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 18px;
}
.modal-search {
    width: calc(100% - 20px);
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-main);
    background: var(--bg-accent);
    color: var(--text-main);
    margin-bottom: 18px;
    font-size: 1rem;
}
.modal-list {
    max-height: 45vh;
    overflow-y: auto;
    margin-bottom: 10px;
}
.modal-list-item {
    text-transform: capitalize;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-main);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.2s;
}
.modal-list-item:last-child {
    border-bottom: none;
}
.modal-list-item:hover, .modal-list-item:focus {
    background: var(--hover-bg);
    color: var(--accent);
    border-color: var(--accent);
}
.modal-list-item strong {
    font-size: 1.05em;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    color: #a1a1aa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #ef4444;
}
.advanced-features {
    width: min(350px,100% - 20px);
    background: var(--bg-card) !important;
    border: 1.5px solid var(--border-main) !important;
    margin-top: 24px;
    border-radius: 10px;
    
    box-shadow: 0 2px 8px 0 #0000000d;
    overflow: hidden;
}
.advanced-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background:var(--bg-main);
    color: #a1a1aa;
    font-size: 1.08rem;
    font-weight: 600;
    padding: 14px 22px;
    border: none;
    border-radius: 10px 10px 0 0;
    user-select: none;
    outline: none;
}
.advanced-header:hover {
    background: var(--hover-bg);
    color: var(--accent);
    border-color: var(--accent);
}
.advanced-chevron {
    transition: transform 0.2s;
    font-size: 1.1em;
}
.advanced-features.collapsed .advanced-chevron {
    transform: rotate(-90deg);
}
.advanced-content {
    display: block;
    max-height: 0;
    overflow: hidden;
    padding: 0 22px;
    background: var(--bg-card);
    border-radius: 0 0 10px 10px;
    transition: max-height 0.3s, padding 0.2s;
}
.advanced-features:not(.collapsed) .advanced-content {
    padding: 18px 22px 22px 22px;
    max-height: 800px;
}
.advanced-features.collapsed .advanced-content {
    padding: 0 22px;
    max-height: 0;
}
#savedFilesList {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 10px;
    align-items: stretch;
}
.saved-file-progress-pill {
    display: inline-block;
    /* border: 1px solid #6366f1; */
    border-radius: 50px;
    padding: 1px 8px;
    font-size: 0.7em;
    font-weight: 600;
    color: var(--pill-text);
    background: var(--pill-bg);
    margin-top: 4px;
}
.refined-charts {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: space-between;
    align-items: flex-start;
}
.chart-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-main);
    border-radius: 14px;
    box-shadow: 0 2px 12px 0 #0000000d;
    padding: 22px 18px 18px 18px;
    margin-bottom: 8px;
    flex: 1 1 320px;
    min-width: 220px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.chart-title {
    font-size: 1.08em;
    color: #a1a1aa;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}
@media (max-width: 1100px) {
    .refined-charts {
        flex-direction: column;
        gap: 18px;
    }
    .chart-card {
        max-width: 100%;
        min-width: 0;
    }
}
.collapsible-section.stats-card, .collapsible-section.controls-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-main);
    border-radius: 14px;
    box-shadow: 0 2px 12px 0 #0000000d;
    margin-bottom: 28px;
}
.stats-section {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 30px;
    justify-content: space-between;
}
.stat-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-main);
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    box-shadow: 0 2px 8px 0 #0000000d;
    transition: box-shadow 0.2s, border 0.2s, background 0.2s;
    min-width: 120px;
    flex: 1 1 120px;
    margin: 0 0 0 0;
}
.stat-card:hover {
    box-shadow: 0 4px 16px 0 #6366f133;
    border-color: #6366f1;
    background: var(--hover-bg);
}
.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.stat-label {
    font-size: 1rem;
    color: var(--text-muted);
}
.controls {
    background: var(--bg-card);
    border: 1.5px solid var(--border-main);
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 0;
    box-shadow: 0 2px 8px 0 #0000000d;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    margin-bottom: 0;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}
.filter-group label {
    color: #a1a1aa;
    font-size: 0.98em;
    font-weight: 500;
    margin-bottom: 2px;
}
.filter-group select, .filter-group input[type="text"] {
    background: var(--bg-accent);
    color: var(--text-main);
    border: 1.5px solid var(--border-main);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 1em;
    transition: border 0.18s, box-shadow 0.18s;
}
.filter-group select:focus, .filter-group input[type="text"]:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
    background: var(--bg-accent);
}
.reset-btn {
    background: var(--bg-accent);
    color: var(--accent);
    border: 1.5px solid var(--border-main);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, border 0.18s, color 0.18s, box-shadow 0.18s;
    margin-top: 8px;
}
.reset-btn:hover, .reset-btn:focus {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 4px 16px 0 #6366f133;
}
@media (max-width: 900px) {
    .stats-section {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px;
    }
    .controls {
        padding: 18px 10px;
    }
    .filter-row {
        flex-direction: column;
        gap: 10px;
    }
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 18px 0 0 0;
    flex-wrap: wrap;
    max-width: 100%;
    overflow-x: auto;
}
.pagination-btn {
    /* min-width: 36px; */
    padding: 6px 10px;
    font-size: 0.98em;
    background: var(--bg-accent);
    color: var(--accent);
    border: 1.5px solid var(--border-main);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, border 0.18s, color 0.18s;
}
@media (max-width: 600px) {
    .pagination {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 6px;
    }
    .pagination-btn {
        width: fit-content;
        /* min-width: 32px; */
        padding: 6px 6px;
        font-size: 0.95em;
    }
}
.pagination-btn.active, .pagination-btn:focus {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    outline: none;
}
.pagination-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}
@media (max-width: 600px) {
    .theme-toggle {
        position: static;
        width: 100%;
        display: flex;
        justify-content: flex-end;
        margin-bottom: 10px;
        box-shadow: none;
    }
    .theme-toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 1.05em;
    }
    .header {
        padding-top: 0;
    }
}
.questions-table.collapsible-section {
    max-width: 1200px;
    margin: 0 auto 28px auto;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px 0 #0000000d;
    border: 1.5px solid var(--border-main);
}
.questions-table-scroll {
    padding: 0 0 18px 0;
}
.questions-table table {
    margin-top: 0;
}
.collapsible-content {
    padding: 0 32px 32px 32px;
}
@media (max-width: 900px) {
    .questions-table.collapsible-section {
        max-width: 100%;
        padding: 0;
    }
    .collapsible-content {
        padding: 0 8px 18px 8px;
    }
}
.stat-card,
.controls,
.chart-container,
.collapsible-section {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
#advancedFeatures .file-input-wrapper,
#advancedFeatures input[type="text"],
#advancedFeatures #saveFileBtn {
    background: var(--bg-accent) !important;
    color: var(--text-main) !important;
    border: 1.5px solid var(--border-main) !important;
    border-radius: 8px !important;
    font-size: 1em !important;
    transition: background 0.2s, border 0.2s, color 0.2s;
}
#advancedFeatures #saveFileBtn {
    background: var(--accent2) !important;
    color: #fff !important;
    font-weight: 600 !important;
    border: none !important;
}
#advancedFeatures #saveFileBtn:hover, #advancedFeatures #saveFileBtn:focus {
    background: var(--accent) !important;
    color: #fff !important;
}
#advancedFeatures input[type="text"]::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}
.question-row-completed {
    background: color-mix(in srgb, var(--accent2) 12%, var(--bg-card) 88%) !important;
    /* fallback for browsers without color-mix */
    /* background: #e6f9ed !important; */
}
.themed-hr {
    border: none;
    border-top: 2px solid var(--border-main);
    margin: 32px 0 18px 0;
    width: 100%;
}

body.modal-open,
html.modal-open {
    overflow: hidden;
}

/* GitHub Modal Refinements */
#githubModal.github-modal .modal {
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    min-height: 300px;
}
.github-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-main);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-accent);
}
.github-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}
.github-modal .modal-close {
    top: 14px;
    right: 20px;
}
.github-modal-search-wrapper {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-main);
    background: var(--bg-accent);
    flex-shrink: 0;
    background: var(--bg-card);
    position: sticky;
    top: 60px;
    z-index: 10;
}
.github-modal-search {
    width: 100%;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1.5px solid var(--border-main);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 1.05rem;
    box-sizing: border-box;
    transition: border 0.2s, box-shadow 0.2s;
}
.github-modal-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}
.github-modal .modal-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: initial; /* Override old style */
    margin-bottom: 0; /* Override old style */
}
.github-modal .modal-list-item {
    padding: 14px 20px;
    border-radius: 8px;
    border-bottom: none;
    gap: 12px;
    flex-direction: row; /* Changed from column */
    align-items: center;
}
.github-modal .modal-list-item svg {
    width: 1.5em;
    height: 1.5em;
    color: var(--accent);
    flex-shrink: 0;
}
.github-modal .modal-list-item strong {
    font-size: 1.1em;
    font-weight: 600;
}
.github-modal .back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    background: var(--bg-accent);
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
    border: 1px solid var(--border-main);
}
.github-modal .back-btn:hover {
    background: var(--hover-bg);
    color: var(--accent);
}
.github-modal .modal-list-item:hover, .github-modal .modal-list-item:focus {
    background: var(--hover-bg);
    color: var(--text-main); /* Keep main text color */
}
.github-modal .modal-list-item:hover strong {
    color: var(--accent); /* Highlight title on hover */
}
.github-modal .modal-list-item-desc {
    font-size: 0.9em;
    color: var(--text-muted);
}
.github-modal .modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
    flex-grow: 1;
}
.github-modal .spinner {
    width: 48px;
    height: 48px;
    border: 5px solid var(--border-main);
    border-bottom-color: var(--accent);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure modal-loading and fun-message have a fixed width and wrap text */
.modal-loading {
    min-width: 260px;
    max-width: 340px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin: 0 auto;
}
#fun-message {
    display: block;
    min-width: 220px;
    max-width: 320px;
    margin: 0 auto;
    word-break: break-word;
    white-space: normal;
}

.modal, .modal-loading {
    min-width: 360px;
    max-width: 450px;
    width: 100%;
}

/* Revamped Footer */
.site-footer {
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 48px 32px;
    margin-top: 40px;
    border-top: 1.5px solid var(--border-main);
    font-size: 0.98em;
    border-radius: 24px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
}
.footer-column h4 {
    font-size: 1.1em;
    color: var(--text-main);
    margin-bottom: 16px;
    font-weight: 600;
}
.footer-column p, .footer-column ul {
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1.7;
}
.footer-column a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-column a:hover {
    color: var(--accent);
    text-decoration: underline;
}
.footer-links li {
    margin-bottom: 8px;
}
.footer-socials {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}
.footer-socials a {
    color: var(--text-muted);
    font-size: 1.5em;
}
.footer-bottom {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-main);
    text-align: center;
    font-size: 0.9em;
}

/* Aurora Background Styles - Optimized for Performance */
#aurora-bg {
    position: fixed;
    z-index: 0;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(.4,2,.6,1);
    /* Disable on mobile for better performance */
    display: none;
}
body.aurora-enabled #aurora-bg {
    opacity: 1;
    display: block;
}
/* Only show aurora on desktop/larger screens */
@media (min-width: 768px) {
    body.aurora-enabled #aurora-bg {
    display: block;
    }
}
/* Hide aurora completely on mobile for performance */
@media (max-width: 767px) {
    #aurora-bg {
    display: none !important;
    }
    body.aurora-enabled #aurora-bg {
    display: none !important;
    }
}
#aurora-bg::before {
    content: '';
    position: absolute;
    z-index: 2;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 55%, rgba(20,22,34,0) 55%, rgba(20,22,34,0.7) 100%);
}
#aurora-bg .aurora-layer {
    position: absolute;
    width: 90vw;
    height: 90vh;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
    animation: aurora-move 40s linear infinite alternate;
    will-change: transform;
    /* Reduce animation complexity for better performance */
    transform-origin: center;
}
#aurora-bg .aurora1 {
    left: -20vw;
    top: -20vh;
    background: radial-gradient(ellipse 60% 40% at 30% 40%, var(--aurora1) 0%, var(--aurora2) 60%, transparent 100%);
    animation-delay: 0s;
}
#aurora-bg .aurora2 {
    right: -25vw;
    bottom: -25vh;
    background: radial-gradient(ellipse 50% 30% at 70% 60%, var(--aurora2) 0%, var(--aurora4) 60%, transparent 100%);
    animation-delay: 20s;
}
#aurora-bg .aurora3 {
    right: -15vw;
    top: -10vh;
    background: radial-gradient(ellipse 40% 60% at 60% 20%, var(--aurora3) 0%, var(--aurora1) 60%, transparent 100%);
    animation-delay: 10s;
}
/* Simplified animation - removed extra layers for better performance */
@keyframes aurora-move {
    0% { 
    transform: scale(1) translateY(0) rotate(0deg); 
    filter: blur(120px);
    }
    50% { 
    transform: scale(1.05) translateY(-1vw) rotate(3deg); 
    filter: blur(130px);
    }
    100% { 
    transform: scale(1.1) translateY(1vw) rotate(-3deg); 
    filter: blur(120px);
    }
}
/* Reduced opacity and simplified for light themes */
.theme-light #aurora-bg::before, .theme-solarized #aurora-bg::before {
    background: none;
}
.theme-light #aurora-bg .aurora-layer,
.theme-solarized #aurora-bg .aurora-layer {
    opacity: 0.12 !important;
    filter: blur(100px) !important;
    animation: none !important;
}
.theme-light #aurora-bg .aurora1 {
    left: -20vw;
    top: -20vh;
    width: 120vw;
    height: 120vw;
    background: radial-gradient(ellipse 60% 40% at 30% 40%, #7ecbff 0%, #c7a4ff 80%, transparent 100%);
    display: block !important;
}
.theme-light #aurora-bg .aurora2 {
    right: -20vw;
    bottom: -20vh;
    width: 120vw;
    height: 120vw;
    background: radial-gradient(ellipse 60% 40% at 70% 60%, #7fffd4 0%, #e0fff7 80%, transparent 100%);
    display: block !important;
}
.theme-light #aurora-bg .aurora3 {
    display: none !important;
}
.theme-solarized #aurora-bg .aurora1 {
    left: -20vw;
    top: -20vh;
    width: 120vw;
    height: 120vw;
    background: radial-gradient(ellipse 60% 40% at 30% 40%, #6ec6e6 0%, #b7e6a5 80%, transparent 100%);
    display: block !important;
}
.theme-solarized #aurora-bg .aurora2 {
    right: -20vw;
    bottom: -20vh;
    width: 120vw;
    height: 120vw;
    background: radial-gradient(ellipse 60% 40% at 70% 60%, #ffe066 0%, #ffb3c6 80%, transparent 100%);
    display: block !important;
}
.theme-solarized #aurora-bg .aurora3 {
    display: none !important;
}
/* Remove noise overlay for better performance */
/* #aurora-bg .aurora-noise {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 3;
    opacity: 0.13;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" seed="2"/></filter><rect width="100%" height="100%" filter="url(%23noise)"/></svg>');
    background-size: 200px 200px;
    mix-blend-mode: soft-light;
} */
.theme-solarized #aurora-bg .aurora3 {
    display: none !important;
}
/* Noise overlay for organic look */
#aurora-bg .aurora-noise {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 3;
    opacity: 0.13;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" seed="2"/></filter><rect width="100%" height="100%" filter="url(%23noise)"/></svg>');
    background-size: 200px 200px;
    mix-blend-mode: soft-light;
}
.collapsible-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.collapsible-chevron {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}
#currentFileDisplay {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .site-footer { padding: 32px 24px; }
    .footer-container { text-align: center; }
    .footer-socials { justify-content: center; }
}
.container { padding-bottom: 0 !important; }

.zen-mode .header,
.zen-mode .upload-section,
.zen-mode #statsSection,
.zen-mode #chartSection,
.zen-mode #controlsSection,
.zen-mode .site-footer {
    display: none !important;
}
.zen-mode #questionsSection {
    margin-top: 32px !important;
    border-radius: 18px !important;
    box-shadow: 0 4px 32px 0 #00000022 !important;
    border: 1px solid var(--accent);
}
.zen-mode body, body.zen-mode {
    background: var(--bg-main) !important;
}


@import url('https://fonts.googleapis.com/css2?family=Belanosima&family=Rubik+Vinyl&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lilita+One&display=swap');
.spectacledcoder-glowing-button1
{
    /* margin: auto; */
    width: fit-content;
    height: 70px;
    display: flex;
    border-radius: 35px;
    animation: rotation 3s linear 0s infinite;
    background: linear-gradient(var(--gradient-angle), var(--accent2), var(--accent));
}

.spectacledcoder-button1
{
    cursor: pointer;
    width: 98%;
    height: 94%;
    background-color: rgba(0, 0, 0, 0.903);
    margin: auto;
    outline: none;
    border: none;
    border-radius: 35px;
    color: rgb(255, 255, 255);
    font-size: 1rem;
    font-family: monospace;
    /* padding: 12px; */
    justify-self: flex-start;
    align-self: flex-start;
}

::selection
{
    background-color: #000000;
    color: rgb(255, 255, 255);
}
@keyframes rotation 
{
    0%
    {
        --gradient-angle: 0deg;
    }
    100%
    {
        --gradient-angle: 360deg;
    }    
}
@property --gradient-angle
{
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}