:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #f8f9fa;
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #999;
    --border-color: #ddd;
    --shadow-color: rgba(0,0,0,0.05);
    --primary-blue: #4a90e2;
    --primary-blue-hover: #357abd;
    --success-green: #27ae60;
    --success-green-hover: #229954;
    --error-red: #e74c3c;
    --header-bg: #d3d3d3;
    --panel-bg: #ffffff;
    /* Tier Colors */
    --tier-bronze: #CD7F32;
    --tier-bronze-light: #D4954A;
    --tier-silver: #C0C0C0;
    --tier-silver-light: #D8D8D8;
    --tier-gold: #FFD700;
    --tier-gold-light: #FFE44D;
    --tier-platinum: #E5E4E2;
    --tier-platinum-light: #F0EFED;
    --tier-diamond: #B9F2FF;
    --tier-diamond-light: #D4F7FF;
    --tier-master: #9966CC;
    --tier-master-light: #B38DD9;
    --tier-grandmaster: #FF4500;
    --tier-grandmaster-light: #FF6A33;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #0d0d0d;
    --bg-tertiary: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666;
    --border-color: #333;
    --shadow-color: rgba(0,0,0,0.3);
    --primary-blue: #5ba3f5;
    --primary-blue-hover: #4a90e2;
    --success-green: #2ecc71;
    --success-green-hover: #27ae60;
    --error-red: #ff6b6b;
    --header-bg: #ffffff;
    --panel-bg: #1f1f1f;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* Header */
.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: background-color 0.3s, border-color 0.3s;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-primary);
}

/* Main Layout */
.main-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-right: 10px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 10px;
    align-items: start;
}

/* Play Area (Left Side) */
.play-area {
    position: relative;
    background: transparent;
    border: none;
    padding: 30px;
    padding-bottom: 80px;
    min-height: 600px;
    transition: border-color 0.3s;
}

/* Settings Panel (Right Side) */
.settings-panel {
    background: transparent;
    border: none;
    padding: 15px;
    padding-top: 30px;
    padding-left: 20px;
    position: sticky;
    top: 20px;
    transition: all 0.3s;
}

.settings-panel.collapsed {
    display: none;
}

/* Adjust layout when settings panel is collapsed */
.main-layout:has(.settings-panel.collapsed) {
    grid-template-columns: 1fr;
}

.settings-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.setting-group {
    margin-bottom: 14px;
}

.setting-group label,
.setting-group .setting-header {
    display: block;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-group select,
.setting-group input[type="range"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.85em;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.setting-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.setting-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    padding: 0;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-blue);
    border-radius: 50%;
    cursor: pointer;
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-blue);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.speed-display {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Filter Controls */
.filter-section {
    margin-bottom: 10px;
}

.filter-section label {
    display: block;
    font-size: 0.7em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.8em;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.filter-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.filter-select:disabled {
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.question-types-indicator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    margin-left: 15px;
    font-size: 1.1em;
    color: var(--text-secondary);
}

.question-types-label {
    font-weight: 600;
    margin-right: 5px;
}

.question-types-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.question-type-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--primary-blue);
    color: white;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.question-type-filter-tag .remove-type {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-size: 1.1em;
    line-height: 1;
}

.question-type-filter-tag .remove-type:hover {
    opacity: 1;
}


.matching-count {
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--primary-blue);
    color: white;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 500;
    text-align: center;
}

.matching-count.warning {
    background: var(--warning-yellow);
    color: var(--text-primary);
}

.matching-count.error {
    background: var(--error-red);
}

/* Theme Toggle */
.theme-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.theme-toggle-container:hover {
    background: var(--border-color);
}

.theme-toggle-label {
    font-size: 0.8em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-icon {
    font-size: 1em;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    transition: background-color 0.3s;
}

.toggle-switch.active {
    background: var(--primary-blue);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

/* Score Display */
.score-display {
    text-align: center;
    padding: 15px;
    background: transparent;
    margin-bottom: 20px;
    font-size: 1.1em;
    color: var(--text-secondary);
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    position: fixed;
    bottom: 20px;
    left: max(50px, calc(50vw - 700px + 50px));
    right: max(360px, calc(50vw - 700px + 360px));
    z-index: 100;
}

/* Adjust action buttons width when settings panel is collapsed */
.main-layout:has(.settings-panel.collapsed) .action-buttons {
    right: max(50px, calc(50vw - 700px + 50px));
}

/* Buzz Button (aligned with question text area) */
.buzz-btn {
    margin-left: auto;
    padding: 6px 12px;
    min-width: 80px;
    min-height: 40px;
    border: 1px solid var(--primary-blue);
    border-radius: 8px;
    background: var(--primary-blue);
    color: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.buzz-btn:hover {
    background: var(--primary-blue-hover);
    border-color: var(--primary-blue-hover);
}

.action-btn {
    padding: 6px 12px;
    min-width: 70px;
    min-height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

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

/* Custom Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 6px 10px;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 0.9em;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
    z-index: 200;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

button {
    padding: 10px 24px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

button:hover {
    background: var(--border-color);
}

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

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s;
}

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

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

.btn-success:hover {
    background: var(--success-green-hover);
    border-color: var(--success-green-hover);
}

.btn-danger {
    background: var(--error-red);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #c0392b;
    filter: brightness(0.9);
}

/* Question Display */
.question-display {
    border: none;
    padding: 0;
    margin-bottom: 10px;
}

.difficulty-indicator {
    font-size: 1.1em;
    margin-bottom: 15px;
    margin-left: 0;
    color: var(--text-primary);
}

.difficulty-label {
    font-weight: 600;
    margin-right: 5px;
}

.difficulty-value {
    color: var(--text-primary);
    font-weight: 500;
}

.question-text {
    font-size: 1.15em;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--primary-blue);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    50% { opacity: 0; }
}

.buzz-marker {
    color: var(--primary-blue);
}

/* Answer Text (below question) */
.answer-text {
    font-size: 1em;
    line-height: 1.7;
    color: var(--text-primary);
    margin-top: 20px;
    font-weight: 600;
}

.answer-text:empty {
    display: none;
}

/* Answer Input */
.answer-input-section {
    margin-bottom: 15px;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.answer-input-section input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--primary-blue);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 0 8px rgba(74, 144, 226, 0.4);
}

.answer-input-section input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 12px rgba(74, 144, 226, 0.6);
}

.answer-input-section input[type="text"]::placeholder {
    color: var(--text-tertiary);
}

.answer-input-buttons {
    display: flex;
}

.answer-input-buttons button {
    padding: 6px 12px;
    min-width: 70px;
    min-height: 40px;
    font-size: 0.95em;
    border-radius: 8px;
}

/* Placeholder */
.placeholder {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85em;
    padding: 20px;
}

/* Hint */
.hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-top: 15px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.hint strong,
.placeholder strong {
    color: var(--primary-blue);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

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

.modal-content {
    background-color: var(--panel-bg);
    margin: 15% auto;
    padding: 30px;
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.5em;
}

.modal-content p {
    margin-bottom: 25px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.correct {
    color: var(--success-green);
}

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

.hidden {
    display: none;
}

/* Statistics Display */
.stats-info {
    font-size: 0.9em;
    color: var(--text-secondary);
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    line-height: 1.6;
}

/* Buzzer Button (Mobile/Tablet only) */
.buzzer-button {
    display: none;
    width: 100%;
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 8px;
    background: var(--primary-blue);
    color: white;
    font-size: 1.1em;
    font-weight: 700;
    border: 3px solid var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.buzzer-button:active {
    transform: scale(0.98);
    background: var(--primary-blue-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.buzzer-button.show {
    display: block;
}

/* Question History Section */
.history-section {
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: none;
}

.history-container {
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-color);
    padding: 20px;
    padding-top: 5px;
    transition: border-color 0.3s;
    width: 100%;
}

.history-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: none;
}

.history-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.history-item .status-icon {
    font-size: 1.1em;
    font-weight: bold;
}

.history-item .status-icon.correct {
    color: var(--success-green);
}

.history-item .status-icon.incorrect {
    color: var(--error-red);
}

.history-item .status-icon.skipped {
    color: var(--text-tertiary);
}

/* Tooltip for history items */
.history-tooltip {
    position: fixed;
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    max-width: 500px;
    box-shadow: 0 4px 20px var(--shadow-color);
    z-index: 1000;
    display: none;
    pointer-events: none;
}

.history-tooltip.show {
    display: block;
}

.history-tooltip .tooltip-question {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.history-tooltip .tooltip-answer {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.history-tooltip .tooltip-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .settings-panel {
        display: none;
    }

    .action-buttons {
        right: max(50px, calc(50vw - 700px + 50px));
    }
}

@media (max-width: 768px) {
    body[data-device="mobile"] .controls {
        flex-direction: column;
    }

    body[data-device="mobile"] button {
        width: 100%;
    }

    body[data-device="mobile"] .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    body[data-device="mobile"] .history-tooltip {
        max-width: 90vw;
        left: 5vw !important;
        right: 5vw;
    }
}

@media (max-width: 480px) {
    body[data-device="mobile"] .header-content {
        flex-direction: column;
        gap: 10px;
    }

    body[data-device="mobile"] .header-content > div:first-child {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    body[data-device="mobile"] .nav-tabs {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        width: 100%;
    }

    body[data-device="mobile"] .nav-tab {
        font-size: 0.85em;
        padding: 8px 4px;
        text-align: center;
    }

    /* Mobile history table */
    body[data-device="mobile"] .history-table th,
    body[data-device="mobile"] .history-table td {
        font-size: 0.75em;
        padding: 4px 6px;
        white-space: nowrap;
    }

    body[data-device="mobile"] .status-badge.correct { color: #27ae60; }
    body[data-device="mobile"] .status-badge.incorrect { color: #e74c3c; }
    body[data-device="mobile"] .status-badge.skipped { color: #999; }
    body[data-device="mobile"] .status-text { display: none; }

    /* Remove min-height on play area so settings stays close */
    body[data-device="mobile"] .play-area {
        min-height: auto;
    }
}

/* User Authentication Styles */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.user-avatar {
    font-size: 1.5em;
    line-height: 1;
}

.user-display-name {
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-logout {
    padding: 6px 12px;
    font-size: 0.85em;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-login {
    padding: 8px 16px;
    font-size: 0.9em;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

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

.auth-modal-content {
    background: var(--panel-bg);
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-modal-title {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-close {
    font-size: 1.5em;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-close:hover {
    color: var(--text-primary);
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

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

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form-group {
    margin-bottom: 15px;
}

.auth-form-group label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
}

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

.auth-error {
    color: var(--error-red);
    font-size: 0.85em;
    margin-top: 10px;
    display: none;
}

.auth-error.show {
    display: block;
}

.auth-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.auth-submit:hover {
    background: var(--primary-blue-hover);
}

.auth-submit:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
}

.forgot-password-link {
    text-align: center;
    margin-top: 12px;
}

.forgot-password-link a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9em;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

/* Social Login Styles */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-tertiary);
    font-size: 0.9em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 10px;
}

.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    color: var(--text-primary);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.social-login-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
}

.social-login-btn svg {
    flex-shrink: 0;
}

.google-btn {
    color: #202124;
}

.google-btn:hover {
    background: #f8f9fa;
}

/* Email Verification Banner */
.verification-banner {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 20px;
    margin: 20px;
    border-radius: 4px;
    text-align: center;
}

[data-theme="dark"] .site-title {
    color: var(--text-secondary);
}

[data-theme="dark"] .verification-banner {
    background: #3d3519;
    border-color: #ffc107;
    color: #ffc107;
}

[data-theme="dark"] .buzzer-button {
    background: var(--warning-yellow);
    border-color: var(--text-primary);
}

[data-theme="dark"] .buzzer-button:active {
    background: #d89b00;
}

.verification-banner.show {
    display: block;
}

.verification-banner strong {
    font-weight: 600;
}

.verification-banner button {
    margin-left: 10px;
    padding: 6px 12px;
    background: #ffc107;
    color: #000;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}

.verification-banner button:hover {
    background: #e0a800;
}

/* Page Containers */
.practice-container {
    display: none;
}

.practice-container.active {
    display: block;
}

/* Navigation Tabs */
.nav-tabs {
    display: none;
    gap: 8px;
}

.nav-tabs.show {
    display: flex;
}

.nav-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

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

/* Leaderboard Grid */
.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

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

/* Leaderboard Table */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    text-align: left;
    padding: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table tr:hover {
    background: var(--bg-tertiary);
}

.leaderboard-table tr.current-user {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.leaderboard-rank {
    font-weight: 600;
    color: var(--primary-blue);
}

.leaderboard-rank.top-1 {
    color: #FFD700;
    font-size: 1.2em;
}

.leaderboard-rank.top-2 {
    color: #C0C0C0;
    font-size: 1.1em;
}

.leaderboard-rank.top-3 {
    color: #CD7F32;
    font-size: 1.1em;
}

.leaderboard-username {
    font-weight: 500;
}

.leaderboard-points {
    font-weight: 600;
    color: var(--primary-blue);
}

.leaderboard-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Profile Styles */
.profile-form {
    max-width: 600px;
    margin: 0 auto;
}

.profile-section {
    margin-bottom: 25px;
}

.profile-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.05em;
}

.profile-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1em;
    transition: border-color 0.3s;
}

.profile-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.profile-hint {
    margin-top: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Tier Shield Styles */
.tier-shield {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tier-shield.size-large {
    width: 80px;
    height: 96px;
}

.tier-shield.size-medium {
    width: 48px;
    height: 58px;
}

.tier-shield.size-small {
    width: 32px;
    height: 38px;
}

.tier-shield svg {
    width: 100%;
    height: 100%;
}

/* Level Badge (combines shield + info) */
.level-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.level-badge.tier-bronze { border-color: var(--tier-bronze); }
.level-badge.tier-silver { border-color: var(--tier-silver); }
.level-badge.tier-gold { border-color: var(--tier-gold); }
.level-badge.tier-platinum { border-color: var(--tier-platinum); }
.level-badge.tier-diamond { border-color: var(--tier-diamond); }
.level-badge.tier-master { border-color: var(--tier-master); }
.level-badge.tier-grandmaster { border-color: var(--tier-grandmaster); }

.level-badge-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.level-badge-level {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
}

.level-badge-title {
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.level-badge-title.tier-bronze { color: var(--tier-bronze); }
.level-badge-title.tier-silver { color: var(--tier-silver); }
.level-badge-title.tier-gold { color: var(--tier-gold); }
.level-badge-title.tier-platinum { color: #8a8a8a; }
.level-badge-title.tier-diamond { color: #5bc0de; }
.level-badge-title.tier-master { color: var(--tier-master); }
.level-badge-title.tier-grandmaster { color: var(--tier-grandmaster); }

.level-badge-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.progress-bar-container {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-bar-fill.tier-bronze { background: linear-gradient(90deg, var(--tier-bronze), var(--tier-bronze-light)); }
.progress-bar-fill.tier-silver { background: linear-gradient(90deg, var(--tier-silver), var(--tier-silver-light)); }
.progress-bar-fill.tier-gold { background: linear-gradient(90deg, var(--tier-gold), var(--tier-gold-light)); }
.progress-bar-fill.tier-platinum { background: linear-gradient(90deg, var(--tier-platinum), var(--tier-platinum-light)); }
.progress-bar-fill.tier-diamond { background: linear-gradient(90deg, var(--tier-diamond), var(--tier-diamond-light)); }
.progress-bar-fill.tier-master { background: linear-gradient(90deg, var(--tier-master), var(--tier-master-light)); }
.progress-bar-fill.tier-grandmaster { background: linear-gradient(90deg, var(--tier-grandmaster), var(--tier-grandmaster-light)); }

.progress-bar-text {
    font-size: 0.75em;
    color: var(--text-secondary);
}

/* Compact Level Badge (for header/leaderboard) */
.level-badge-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.level-badge-compact.tier-bronze { border-color: var(--tier-bronze); background: rgba(205, 127, 50, 0.1); }
.level-badge-compact.tier-silver { border-color: var(--tier-silver); background: rgba(192, 192, 192, 0.1); }
.level-badge-compact.tier-gold { border-color: var(--tier-gold); background: rgba(255, 215, 0, 0.1); }
.level-badge-compact.tier-platinum { border-color: var(--tier-platinum); background: rgba(229, 228, 226, 0.1); }
.level-badge-compact.tier-diamond { border-color: var(--tier-diamond); background: rgba(185, 242, 255, 0.1); }
.level-badge-compact.tier-master { border-color: var(--tier-master); background: rgba(153, 102, 204, 0.1); }
.level-badge-compact.tier-grandmaster { border-color: var(--tier-grandmaster); background: rgba(255, 69, 0, 0.1); }

.compact-level {
    font-weight: 700;
    font-size: 0.9em;
}

.compact-level.tier-bronze { color: var(--tier-bronze); }
.compact-level.tier-silver { color: var(--tier-silver); }
.compact-level.tier-gold { color: var(--tier-gold); }
.compact-level.tier-platinum { color: #8a8a8a; }
.compact-level.tier-diamond { color: #5bc0de; }
.compact-level.tier-master { color: var(--tier-master); }
.compact-level.tier-grandmaster { color: var(--tier-grandmaster); }

.compact-title {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.compact-progress {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-primary);
}

/* Streak Display */
.streak-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 69, 0, 0.1);
    border: 1px solid #ff4500;
}

.streak-fire {
    font-size: 1em;
}

.streak-count {
    font-weight: 700;
    color: #ff4500;
}

.streak-multiplier {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* XP Display in Settings Panel */
.xp-display {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.xp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.xp-info {
    flex: 1;
}

.xp-level-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.xp-level {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-primary);
}

.xp-rank-title {
    font-size: 0.9em;
    font-weight: 500;
}

.xp-progress-wrapper {
    margin-top: 8px;
}

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

.xp-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.xp-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Level Up Notification */
.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 32px 48px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.level-up-notification.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.level-up-notification .level-up-title {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 16px;
}

.level-up-notification .new-level {
    font-size: 3em;
    font-weight: 700;
    margin: 16px 0;
}

.level-up-notification .new-title {
    font-size: 1.2em;
    margin-bottom: 16px;
}

.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.level-up-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 15px;
}

.profile-stat-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

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

.profile-stat-label {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Warning Banner */
.profile-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.profile-warning-icon {
    font-size: 1.5em;
}

.profile-warning-text {
    flex: 1;
    color: var(--text-primary);
    text-align: center;
}

.profile-warning-link {
    color: var(--primary-blue);
    text-decoration: underline;
    cursor: pointer;
}

.profile-warning-dismiss {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
}

/* Dashboard Styles */
.dashboard-container {
    display: none;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px 40px 20px;
}

.dashboard-container.active {
    display: block;
}

.dashboard-header {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-title {
    font-size: 2em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.dashboard-question-set-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-question-set-selector label {
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 500;
}

.dashboard-question-set-selector select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
    color: var(--text-primary);
    font-size: 0.9em;
    cursor: pointer;
}

.dashboard-question-set-selector select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.dashboard-card:hover {
    box-shadow: 0 4px 12px var(--shadow-color);
}

.card-header {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-align: center;
}

.card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Radial Progress Chart */
.radial-chart {
    position: relative;
    width: 150px;
    height: 150px;
}

.radial-chart.small {
    width: 100px;
    height: 100px;
}

.radial-chart svg {
    transform: rotate(-90deg);
}

.radial-chart-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 12;
}

.radial-chart-progress {
    fill: none;
    stroke: var(--primary-blue);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.radial-chart-progress.correct {
    stroke: var(--primary-blue);
}

.radial-chart-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.radial-chart-percentage {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.radial-chart.small .radial-chart-percentage {
    font-size: 1.8em;
}

.radial-chart-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 5px;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 20px;
}

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

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 5px;
}

.stat-value.correct {
    color: var(--primary-blue);
}

.stat-value.incorrect {
    color: var(--error-red);
}

.stat-value.skipped {
    color: var(--text-tertiary);
}

/* Difficulty Charts Grid */
.difficulty-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.difficulty-chart-item {
    text-align: center;
}

.difficulty-name {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 10px;
}

.difficulty-count {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* Category Stats */
.category-section {
    width: 100%;
    margin-bottom: 5px;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-section-title {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: left;
}

.category-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
}

.category-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
}

.category-stat-label {
    min-width: 90px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-stat-bar-container {
    flex: 1;
    height: 14px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.category-stat-bar {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.category-stat-value {
    min-width: 32px;
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
}

.category-stat-count {
    min-width: 22px;
    text-align: right;
    color: var(--text-tertiary);
    font-size: 0.85em;
}

/* Performance Trends */
.trends-section {
    margin-top: 25px;
    margin-bottom: 25px;
}

.trends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.trends-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
}

.time-period-selector {
    display: flex;
    gap: 5px;
}

.time-period-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.time-period-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-blue);
}

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

.trends-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.trend-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.trend-card-header {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.trend-chart-container {
    width: 100%;
    height: 200px;
    position: relative;
}

.trend-chart {
    width: 100%;
    height: 100%;
}

.trend-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    font-style: italic;
}

.trend-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.trend-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75em;
    color: var(--text-secondary);
}

.trend-legend-color {
    width: 12px;
    height: 3px;
    border-radius: 1px;
}

/* SVG Chart Styles */
.trend-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.trend-dot {
    stroke-width: 2;
    stroke: var(--panel-bg);
}

.trend-grid-line {
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 4, 4;
}

.trend-axis-label {
    font-size: 10px;
    fill: var(--text-tertiary);
}

.trend-x-label {
    text-anchor: middle;
}

.trend-y-label {
    text-anchor: end;
}

/* History Table */
.history-table-container {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.history-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95em;
}

.history-filter {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95em;
    cursor: pointer;
}

.history-filters {
    display: flex;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.history-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.history-filter-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85em;
    cursor: pointer;
    width: 150px;
}

.history-filter-select:hover {
    border-color: var(--primary-blue);
}

.history-filter-select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.history-filter-btn {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85em;
    cursor: pointer;
}

.history-filter-btn:hover {
    border-color: var(--primary-blue);
    background: var(--bg-secondary);
}

.history-filter-btn-danger {
    background: var(--error-red);
    color: white;
    border-color: var(--error-red);
}

.history-filter-btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.history-table {
    border-collapse: collapse;
    font-size: 0.95em;
    table-layout: fixed;
}

.history-table th {
    text-align: left;
    padding: 6px 18px 6px 10px;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    user-select: none;
}

.history-table th:last-child {
    padding-right: 10px;
}

.history-table th:first-child {
    font-size: 0.85em;
}

.history-table th .resizer {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 10px;
    cursor: col-resize;
    user-select: none;
    transition: background-color 0.2s;
}

.history-table th .resizer::after {
    content: '';
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--text-secondary);
    opacity: 0.5;
    border-radius: 2px;
}

.history-table th .resizer:hover::after {
    background: var(--primary-blue);
    opacity: 1;
}

.history-table th .resizer:active::after {
    background: var(--primary-blue);
    opacity: 1;
}

.history-table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 0;
}

.history-table td:nth-child(3) {
    font-size: 1em;
}

.history-table td:first-child {
    font-size: 0.9em;
}

.history-table td:nth-child(2) {
    text-align: center;
}

.history-table tr {
    cursor: pointer;
    transition: background 0.2s;
}

.history-table tr:hover {
    background: var(--bg-tertiary);
}

.history-table tr.correct {
    border-left: 3px solid var(--success-green);
}

.history-table tr.incorrect {
    border-left: 3px solid var(--error-red);
}

.history-table tr.skipped {
    border-left: 3px solid var(--text-tertiary);
}

.status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.status-badge.correct {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-green);
}

.status-badge.incorrect {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-red);
}

.status-badge.skipped {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

/* Action Buttons */
.dashboard-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-export {
    padding: 10px 20px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-clear {
    padding: 10px 20px;
    background: var(--error-red);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-clear:hover {
    background: #c0392b;
}

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

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state-message {
    font-size: 1em;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        flex-direction: column;
        gap: 15px;
    }

    .history-table {
        font-size: 0.85em;
    }

    .history-table th,
    .history-table td {
        padding: 4px 8px;
    }
}
