/* ============================================================
   CONOSCENZA.BE — Design System
   Matcht de QuizHub-app styling (donker glassmorphism)
   ============================================================ */

/* ── PROMETHEUS Font ───────────────────────────────────────── */
@font-face {
    font-family: 'Prometheus';
    src: url('PROMETHEUS.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
    --bg-color: #0d1117;
    --bg-surface: #161b22;
    --panel-bg: rgba(22, 27, 34, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);

    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: rgba(255, 255, 255, 0.45);

    --accent-color: #58a6ff;
    --accent-hover: #3182ce;
    --accent-light: #79b8ff;
    --accent-glow: rgba(88, 166, 255, 0.25);

    --success: #06d6a0;
    /* Iets meer saturatie zodat rood op donkere achtergrond leesbaar blijft */
    --danger: #ff6b6b;
    --danger-muted-bg: rgba(255, 95, 105, 0.18);
    --danger-table-row: rgba(255, 95, 105, 0.24);
    --danger-border: rgba(255, 120, 130, 0.5);
    --warning: #ffd166;

    --font-main: 'Outfit', sans-serif;
    --font-logo: 'Prometheus', 'Outfit', sans-serif;

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

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);

    --header-height: 70px;
    --max-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Glass Panel ───────────────────────────────────────────── */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* ── Header / Navigation ───────────────────────────────────── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    font-family: var(--font-logo);
    font-size: 1.6rem;
    color: var(--text-primary);
    letter-spacing: 3px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.logo:hover {
    opacity: 0.85;
    color: var(--text-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    display: block;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s, transform 0.1s;
    position: relative;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-links a.active {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* .btn-app class verwijderd — alle nav-links hebben nu dezelfde stijl */

/* Mobile logo (verborgen op desktop) */
.mobile-logo {
    display: none;
}

/* Hamburger Menu (mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    z-index: 1100;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Main Content ──────────────────────────────────────────── */
main {
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 4rem;
    min-height: 100vh;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.container-wide {
    max-width: 85vw;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-family: var(--font-logo);
    font-size: 2rem;
    letter-spacing: 4px;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ── Hero Section (Home) ───────────────────────────────────── */
.hero {
    position: relative;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%,
        rgba(88, 166, 255, 0.08) 0%,
        transparent 50%),
    radial-gradient(circle at 70% 60%,
        rgba(163, 113, 247, 0.06) 0%,
        transparent 50%),
    radial-gradient(circle at 50% 80%,
        rgba(6, 214, 160, 0.04) 0%,
        transparent 40%);
    animation: heroShift 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes heroShift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-3%, 2%) scale(1.05); }
    100% { transform: translate(2%, -1%) scale(1.02); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-logo);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--text-primary);
    letter-spacing: 6px;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1rem;
    letter-spacing: 12px;
    color: var(--text-primary);
    opacity: 0.6;
    text-transform: uppercase;
    font-weight: 300;
    margin-bottom: 2rem;
}

.hero-divider {
    width: 60px;
    height: 1px;
    background: white;
    margin: 0 auto 2rem;
    opacity: 0.3;
}

.hero-text {
    max-width: 600px;
    margin: 0 auto 3rem;
    font-weight: 300;
    opacity: 0.8;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* ── Quick Stats Row (Home) ────────────────────────────────── */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 960px;
}

.quick-stat {
    padding: 1.25rem 1rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.quick-stat:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
}
.quick-stat .qs-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1.2;
}
.quick-stat .qs-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 0.35rem;
}

/* ── Page Cards Grid (Home) ────────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    width: 100%;
    max-width: 900px;
}

.page-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.page-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 30px rgba(88, 166, 255, 0.1);
    color: inherit;
}
.page-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}
.page-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
}
.page-card .card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Stat Cards (Stats / Ranking) ──────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.stat-card {
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}
.stat-card h3 {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.stat-card .stat-value {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.1;
}
.stat-card .stat-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Stats-pagina (zelfde structuur als offline QuizHub) */
.stats-subview {
    display: none;
}
.stats-subview.active {
    display: block;
}
.stats-tab-btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.12s;
}
.stats-tab-btn:hover {
    background: rgba(88, 166, 255, 0.14);
    border-color: var(--accent-light);
}
.stats-tab-btn.active {
    background: rgba(88, 166, 255, 0.22);
    border-color: #ffd700;
    box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.45);
}
.theme-analysis-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 0.5rem;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Content Section ───────────────────────────────────────── */
.content-section {
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Homepagina: grafiek titels centreren, geen clipping op markers */
.home-chart-section .section-title {
    text-align: center;
}

.home-chart-plot svg {
    overflow: visible !important;
}

.home-chart-plot .plot-container,
.home-chart-plot .svg-container {
    overflow: visible !important;
}

#home-history-chart .scatterlayer .trace .points,
#home-history-chart .scatterlayer .trace .points * {
    clip-path: none !important;
}

.section-title {
    color: var(--accent-color);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

/* ── Tables ────────────────────────────────────────────────── */
.data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

.data-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 10;
}

.data-table tbody tr {
    transition: background 0.15s;
}
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

/* Sortable columns */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}
.data-table th.sortable:hover {
    color: var(--text-primary);
}

/* Column filter row in thead (niet sticky: anders overlapt deze rij de sorteerrij met dezelfde top:0) */
.data-table thead .filter-row th {
    padding: 4px 6px;
    background: var(--bg-surface);
    position: static;
    top: auto;
    z-index: auto;
    white-space: normal;
    vertical-align: middle;
}
.data-table thead .filter-row .col-filter {
    width: 100%;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.78rem;
    box-sizing: border-box;
}
.data-table thead .filter-row .col-filter:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.data-table thead .filter-row .col-filter::placeholder {
    color: var(--text-muted);
}
.data-table thead .filter-row select.col-filter {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

/* RIP: naam-kolom iets smaller, beschrijving iets ruimer */
#rip-table thead tr.filter-row th:nth-child(2) {
    min-width: 7.5rem;
    max-width: 11rem;
}
#rip-table thead tr.filter-row th:nth-child(5) {
    min-width: 16rem;
}
#rip-table tbody td:nth-child(2) {
    max-width: 11rem;
    overflow-wrap: anywhere;
}
#rip-table tbody td.rip-desc-cell {
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: normal;
    min-width: 16rem;
    max-width: 48rem;
}

#rip-table tbody td a.rip-wiki-link {
    color: var(--accent-color);
    text-decoration: none;
}
#rip-table tbody td a.rip-wiki-link:hover {
    text-decoration: underline;
}

/* Score badges */
.badge-correct {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(6, 214, 160, 0.15);
    color: var(--success);
    border: 1px solid rgba(6, 214, 160, 0.25);
}
.badge-wrong {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--danger-muted-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}
.badge-nvt {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(240, 165, 0, 0.15);
    color: #f0a500;
    border: 1px solid rgba(240, 165, 0, 0.25);
}
.badge-flag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}
.badge-flag.active {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(88, 166, 255, 0.25);
}

/* ── Filter / Search ───────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.filter-input {
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.88rem;
    transition: border-color 0.2s;
    min-width: 180px;
}
.filter-input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.filter-input::placeholder {
    color: var(--text-muted);
}

.filter-select {
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.88rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.filter-select:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* All native selects: dark surface + readable options (OS dropdowns vary) */
select,
select option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}
select:focus {
    border-color: var(--accent-color);
    outline: none;
}
select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Ranking: seizoen-dropdown met vet jaartallen */
.season-title-select {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px 26px 2px 4px;
    font-family: var(--font-main);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    max-width: min(100%, 16rem);
}
.season-title-select:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.season-title-select:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}
.season-title-select option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 700;
}
.season-title-select.season-title-select--single {
    cursor: default;
    padding-right: 4px;
    background-image: none;
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 1.5rem;
}

.pagination-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}
.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.pagination-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}
.pagination-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ── Loading States ────────────────────────────────────────── */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1.25rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.loading-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    max-width: 350px;
    text-align: center;
    line-height: 1.5;
}

/* Skeleton rows */
.skeleton-row {
    height: 44px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.07) 50%,
        rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: 6px;
    margin-bottom: 6px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Calendar Embed ────────────────────────────────────────── */
.calendar-wrapper {
    width: 100%;
    background: #000;
    overflow: hidden;
    border-radius: var(--radius-sm);
}
.calendar-cropper {
    margin-top: -60px;
}
.google-calendar {
    filter: grayscale(1) invert(1) brightness(1.2) contrast(1.1);
    border: none;
    display: block;
}

/* ── Details / Accordion ───────────────────────────────────── */
details {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
    transition: border-color 0.2s;
}
details[open] {
    border-color: rgba(255, 255, 255, 0.15);
}
details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-color);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
details summary::-webkit-details-marker {
    display: none;
}
details summary::before {
    content: '▸';
    font-size: 0.85rem;
    transition: transform 0.2s;
}
details[open] summary::before {
    transform: rotate(90deg);
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 3rem 2rem;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.5;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

/* ── Utility ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-accent { color: var(--accent-color); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-secondary); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ── Fade In Animation ─────────────────────────────────────── */
.fade-in {
    animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.stagger-1 { animation-delay: 0.05s; animation-fill-mode: backwards; }
.stagger-2 { animation-delay: 0.1s; animation-fill-mode: backwards; }
.stagger-3 { animation-delay: 0.15s; animation-fill-mode: backwards; }
.stagger-4 { animation-delay: 0.2s; animation-fill-mode: backwards; }
.stagger-5 { animation-delay: 0.25s; animation-fill-mode: backwards; }

.stat-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    opacity: 0.85;
}

.processed-toggle {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--accent-color);
    cursor: pointer;
}

/* ── Error State ───────────────────────────────────────────── */
.error-message {
    background: var(--danger-muted-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    color: var(--danger);
    font-size: 0.9rem;
    text-align: center;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(13, 17, 23, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 8px;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--border-color);
        z-index: 1050;
    }
    .nav-links.open {
        right: 0;
    }
    .nav-links a {
        font-size: 1rem;
        padding: 14px 16px;
    }

    .site-header {
        z-index: 1060;
    }

    .header-inner {
        padding: 0 1.25rem;
        justify-content: flex-end;
        position: relative;
    }

    .mobile-logo {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-family: var(--font-logo);
        font-size: clamp(0.85rem, 4vw, 1.1rem);
        color: var(--text-primary);
        text-decoration: none;
        letter-spacing: 2px;
        white-space: nowrap;
    }

    .container {
        max-width: 100vw !important;
        padding: 0 0.75rem;
        box-sizing: border-box;
    }

    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .content-section,
    .glass-panel {
        max-width: 100%;
        overflow-x: auto;
    }

    main {
        padding-top: calc(var(--header-height) + 1rem);
    }

    .hero-title {
        letter-spacing: 4px;
    }
    .hero-subtitle {
        letter-spacing: 6px;
        font-size: 0.8rem;
    }

    .page-title {
        font-size: 1.5rem;
        letter-spacing: 3px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stats-grid-2col {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .content-section {
        padding: 1.25rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-input {
        min-width: unset;
        width: 100%;
    }

    .calendar-cropper {
        margin-top: -55px;
    }
}

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

    .quick-stats {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card .stat-value {
        font-size: 1.8rem;
    }
}

/* ── Overlay for mobile nav ────────────────────────────────── */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}
.nav-overlay.active {
    display: block;
}

.promote-row {
    background: rgba(6, 214, 160, 0.12) !important;
    box-shadow: inset 0 0 0 1px rgba(6, 214, 160, 0.22);
}
.demote-row {
    background: var(--danger-muted-bg) !important;
    box-shadow: inset 0 0 0 1px var(--danger-border);
}

/* ── Quizzen page buttons ─────────────────────────────────── */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-back:hover {
    background: rgba(255, 255, 255, 0.10);
    color: var(--text-primary);
}

.btn-small-primary {
    padding: 5px 14px;
    background: rgba(124, 131, 255, 0.15);
    border: 1px solid rgba(124, 131, 255, 0.30);
    border-radius: var(--radius-sm);
    color: var(--accent-color);
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-small-primary:hover {
    background: rgba(124, 131, 255, 0.25);
}

.btn-primary-large {
    padding: 12px 32px;
    background: var(--accent-color);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.btn-primary-large:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Duplicate history marks (in sync met beheer-app Dubbels) */
#dubbels-table tbody tr.never-correct td {
    background: rgba(255, 77, 77, 0.18);
}
#dubbels-table tbody tr.never-correct:hover td {
    background: rgba(255, 77, 77, 0.22);
}
#dubbels-table tbody tr.recent-regressed td {
    background: rgba(255, 152, 85, 0.2);
}
#dubbels-table tbody tr.recent-regressed:hover td {
    background: rgba(255, 152, 85, 0.28);
}
.duplicate-history {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.duplicate-history-mark {
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.15;
}
.duplicate-history-mark.correct {
    color: #06d6a0;
}
.duplicate-history-mark.wrong {
    color: #ff6b6b;
}
.duplicate-history-mark.own-quiz {
    color: #8ab4ff;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

