:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a1f35;
    --bg-glass: rgba(17, 24, 39, 0.7);

    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --easy: #22c55e;
    --medium: #f59e0b;
    --hard: #ef4444;

    --border-color: rgba(99, 102, 241, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.8);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;

    --border-color: rgba(99, 102, 241, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    outline: none;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
    transition: var(--transition);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

.title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Controls Section */
.controls-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

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

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

.control-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.icon {
    width: 18px;
    height: 18px;
}

.select-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.select-input:hover {
    border-color: var(--accent-primary);
}

.select-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Frequency Buttons */
.frequency-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.freq-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.freq-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.freq-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Progress Section */
.progress-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

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

.progress-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.progress-stats {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.progress-percentage {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-bar-container {
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 999px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Table Section */
.table-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-container {
    overflow-x: auto;
}

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

.questions-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.questions-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.questions-table tbody tr {
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    transition: var(--transition);
}

.questions-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.questions-table tbody tr.completed {
    opacity: 0.6;
}

.questions-table td {
    padding: 1rem;
    font-size: 0.875rem;
}

.col-checkbox {
    width: 50px;
}

.col-id {
    width: 80px;
}

.col-difficulty {
    width: 120px;
}

.col-acceptance {
    width: 120px;
}

.col-frequency {
    width: 120px;
}

/* Custom Checkbox */
.custom-checkbox {
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition);
}

.custom-checkbox:hover .checkmark {
    border-color: var(--accent-primary);
}

.custom-checkbox input:checked~.checkmark {
    background: var(--accent-gradient);
    border-color: transparent;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

/* Question Link */
.question-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.question-link:hover {
    color: var(--accent-primary);
}

/* Difficulty Badge */
.difficulty-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-easy {
    background: rgba(34, 197, 94, 0.15);
    color: var(--easy);
}

.difficulty-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--medium);
}

.difficulty-hard {
    background: rgba(239, 68, 68, 0.15);
    color: var(--hard);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 80px;
    height: 80px;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--text-tertiary);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .controls-section {
        padding: 1.5rem;
    }

    .frequency-buttons {
        flex-direction: column;
    }

    .freq-btn {
        width: 100%;
    }

    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .table-container {
        overflow-x: scroll;
    }

    .questions-table {
        min-width: 600px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.questions-table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding: 3rem 2rem;
    text-align: center;
    border-top: 2px solid var(--border-color);
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.footer-credit,
.footer-source {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    max-width: 600px;
    text-align: center;
    line-height: 1.5;
}

.footer-disclaimer strong {
    color: var(--text-secondary);
}

.footer-credit {
    font-size: 1.1rem;
}

.footer-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    display: inline-block;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-secondary);
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.footer-link:hover::after {
    width: 80%;
}

.heart {
    color: #ef4444;
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
    font-size: 1.2rem;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.2);
    }

    20%,
    40% {
        transform: scale(1);
    }
}

/* Light mode footer adjustments */
[data-theme="light"] .footer {
    background: var(--bg-tertiary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .footer-link {
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .footer-link:hover {
    background: rgba(99, 102, 241, 0.25);
}

@media (max-width: 768px) {
    .footer {
        margin-top: 3rem;
        padding: 2rem 1rem;
    }

    .footer-credit,
    .footer-source {
        font-size: 0.9rem;
    }

    .footer-credit {
        font-size: 1rem;
    }
}