/* ===== Thema: keuzeknop en donker thema =====
   Het thema staat op <html data-bs-theme="dark|light"> (zie App.razor en js/theme.js).
   Donker = neutrale grijzen; clubblauw en -geel enkel als accent (knoppen, actieve items, vandaag). */

/* ----- Keuzeknop licht / donker / auto ----- */
.theme-picker { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--canvas); border: 1px solid var(--line); }
.theme-opt {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px;
    border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .85rem; font-weight: 600; cursor: pointer;
}
.theme-opt:hover { color: var(--ink); }
.theme-opt:focus-visible { outline: none; box-shadow: 0 0 0 .2rem rgba(250, 195, 18, .55); }
html[data-thema="licht"] .theme-opt[data-thema-keuze="licht"],
html[data-thema="donker"] .theme-opt[data-thema-keuze="donker"],
html[data-thema="auto"] .theme-opt[data-thema-keuze="auto"] {
    background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.theme-picker-lg .theme-opt { min-height: 44px; padding: 0 16px; font-size: .95rem; }
@media (max-width: 400px) { .theme-picker-lg { display: flex; } .theme-picker-lg .theme-opt { flex: 1; padding: 0 8px; } }

/* In de zijbalk (altijd navy): lichte tekst. */
.side-theme { padding: 10px 12px 2px calc(12px + env(safe-area-inset-left)); }
.side-theme .theme-picker { display: flex; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .1); }
.side-theme .theme-opt { flex: 1; color: #C5D0E3; min-height: 34px; padding: 0 8px; font-size: .8rem; }
.side-theme .theme-opt:hover { color: #fff; }
html[data-thema="licht"] .side-theme .theme-opt[data-thema-keuze="licht"],
html[data-thema="donker"] .side-theme .theme-opt[data-thema-keuze="donker"],
html[data-thema="auto"] .side-theme .theme-opt[data-thema-keuze="auto"] {
    background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none;
}

/* ----- Donker thema: kleurtokens ----- */
:root[data-bs-theme="dark"], [data-bs-theme="dark"] {
    color-scheme: dark;
    --condors-blue: #5BA3EA;          /* accenten: zachter clubblauw, leesbaar op grijs */
    --condors-blue-fill: #0060B4;     /* vlakken met witte tekst blijven clubblauw */
    --condors-navy: #17181B;
    --condors-blue-dark: #121315;
    --condors-blue-soft: #1C2836;
    --condors-blue-text: #8CC2F5;
    --condors-yellow: #FAC312;
    --condors-yellow-soft: #2A2518;
    --ink: #E6E7E9;
    --muted: #A0A3AA;
    --line: #2E3035;
    --surface: #1B1C1F;
    --canvas: #121315;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .25);

    --bs-body-color: var(--ink);
    --bs-body-color-rgb: 230, 231, 233;
    --bs-body-bg: var(--surface);
    --bs-body-bg-rgb: 27, 28, 31;
    --bs-emphasis-color: #FFFFFF;
    --bs-secondary-bg: #232428;
    --bs-tertiary-bg: var(--canvas);
    --bs-tertiary-bg-rgb: 18, 19, 21;
    --bs-secondary-color: var(--muted);
    --bs-border-color: var(--line);
    --bs-border-color-translucent: rgba(255, 255, 255, .12);
    --bs-primary: #5BA3EA;
    --bs-primary-rgb: 91, 163, 234;
    --bs-link-color: #7AB4EE;
    --bs-link-color-rgb: 122, 180, 238;
    --bs-link-hover-color: #A6CCF3;
    --bs-link-hover-color-rgb: 166, 204, 243;
    --bs-heading-color: #F2F5F9;
}

/* Een stuk "papier" (attest, afdrukvoorbeeld, QR-code) blijft licht, ook in het donker thema. */
[data-bs-theme="dark"] [data-bs-theme="light"] {
    color-scheme: light;
    --condors-blue: #0060B4; --condors-navy: #00427F; --condors-blue-soft: #E5F0FA; --condors-yellow-soft: #FFF5D1;
    --ink: #17202E; --muted: #5A6578; --line: #E1E6EE; --surface: #FFFFFF; --canvas: #F4F6F9;
    --bs-body-color: #17202E; --bs-body-bg: #FFFFFF; --bs-secondary-color: #5A6578; --bs-border-color: #E1E6EE; --bs-heading-color: inherit;
    --bs-emphasis-color: #000; --bs-link-color: #0060B4; --bs-link-color-rgb: 0, 96, 180;
    color: var(--ink); background-color: #FFFFFF;
}

/* ----- Donker thema: onderdelen met vaste kleuren ----- */
[data-bs-theme="dark"] .sidebar { border-right: 1px solid rgba(255, 255, 255, .06); }
[data-bs-theme="dark"] .appbar { border-bottom: 1px solid rgba(255, 255, 255, .06); }
[data-bs-theme="dark"] .nav-backdrop { background: rgba(0, 0, 0, .55); }
[data-bs-theme="dark"] .tabbar { box-shadow: 0 -4px 16px rgba(0, 0, 0, .35); }
/* Startbanner: rustig grijs met een vleugje clubblauw, geel blijft het accent. */
[data-bs-theme="dark"] .hero { background: linear-gradient(135deg, #1E2D40 0%, #1B2129 55%, #1B1C1F 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
[data-bs-theme="dark"] .hero p:not(.eyebrow) { color: #B9BDC4; }
[data-bs-theme="dark"] .celebrate-card { background: linear-gradient(150deg, #1E3A5C 0%, #1B2532 60%, #1B1C1F 100%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 60px rgba(0, 0, 0, .5); }
[data-bs-theme="dark"] .celebrate-backdrop { background: rgba(0, 0, 0, .7); }
/* Zijbalk en bovenbalk: neutraal donker, geel streepje blijft bij het actieve item. */
[data-bs-theme="dark"] .side-section { color: #8A8E96; }
[data-bs-theme="dark"] .side-link, [data-bs-theme="dark"] .side-group { color: #C9CCD1; }
[data-bs-theme="dark"] .side-link.active { background: rgba(255, 255, 255, .08); }
[data-bs-theme="dark"] .brand-sub, [data-bs-theme="dark"] .nav-close, [data-bs-theme="dark"] .side-logout { color: #A0A3AA; }
[data-bs-theme="dark"] .install-hint { background: #1C2836; }

/* Knoppen */
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-disabled-color: #fff; --bs-btn-bg: #0A6CC4; --bs-btn-border-color: #0A6CC4; --bs-btn-hover-bg: #1879D1; --bs-btn-hover-border-color: #1879D1; --bs-btn-active-bg: #0060B4; --bs-btn-active-border-color: #0060B4; --bs-btn-disabled-bg: #0A6CC4; --bs-btn-disabled-border-color: #0A6CC4; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #7DBBF3; --bs-btn-border-color: #3A4D63; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #0A6CC4; --bs-btn-hover-border-color: #0A6CC4; --bs-btn-active-color: #fff; --bs-btn-active-bg: #0060B4; --bs-btn-active-border-color: #0060B4; --bs-btn-disabled-color: #7DBBF3; --bs-btn-disabled-border-color: #3A4D63; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: var(--ink); --bs-btn-border-color: #3A3C42; --bs-btn-hover-bg: #232428; --bs-btn-hover-border-color: #50535B; --bs-btn-active-bg: #2A2C31; --bs-btn-disabled-color: var(--muted); }
[data-bs-theme="dark"] .btn-accent, [data-bs-theme="dark"] .btn-warning { --bs-btn-color: #17202E; --bs-btn-hover-color: #17202E; --bs-btn-active-color: #17202E; --bs-btn-disabled-color: #17202E; }
[data-bs-theme="dark"] .btn-outline-warning.text-dark { color: var(--condors-yellow) !important; }
[data-bs-theme="dark"] .btn-outline-warning.text-dark:hover { color: #17202E !important; }
[data-bs-theme="dark"] .btn-link { --bs-btn-color: #7AB4EE; --bs-btn-hover-color: #A6CCF3; }

/* Formulieren */
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #151618; border-color: #3A3C42; color: var(--ink); }
[data-bs-theme="dark"] .form-control:disabled, [data-bs-theme="dark"] .form-select:disabled, [data-bs-theme="dark"] .form-control[readonly] { background-color: #1F2023; color: var(--muted); }
[data-bs-theme="dark"] .form-control::placeholder { color: #70747C; }
[data-bs-theme="dark"] .form-check-input { background-color: #151618; border-color: #50535B; }
[data-bs-theme="dark"] .form-check-input:checked { background-color: #0A6CC4; border-color: #0A6CC4; }
[data-bs-theme="dark"] .input-group-text { background-color: #232428; border-color: #3A3C42; color: var(--muted); }
[data-bs-theme="dark"] .validation-message { color: #F28B85; }
[data-bs-theme="dark"] .invalid { outline-color: #F28B85; }

/* Tabellen, lijsten, navigatie */
[data-bs-theme="dark"] .table { --bs-table-color: var(--ink); }
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(255, 255, 255, .04); }
[data-bs-theme="dark"] .table-light { --bs-table-color: var(--ink); --bs-table-bg: #232428; --bs-table-border-color: var(--line); --bs-table-striped-bg: #26272B; --bs-table-hover-bg: #2A2C31; color: var(--ink); }
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: rgba(255, 255, 255, .03); }
[data-bs-theme="dark"] .list-group-item.active { --bs-list-group-active-bg: #0A6CC4; --bs-list-group-active-border-color: #0A6CC4; }
[data-bs-theme="dark"] .list-group-item-action:hover { background-color: #232428; }
[data-bs-theme="dark"] .nav-pills { --bs-nav-pills-link-active-bg: #0A6CC4; }
[data-bs-theme="dark"] .nav-tabs { --bs-nav-tabs-link-active-bg: var(--surface); --bs-nav-tabs-link-active-border-color: var(--line) var(--line) var(--surface); }
[data-bs-theme="dark"] .pagination { --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--line); --bs-pagination-active-bg: #0A6CC4; --bs-pagination-active-border-color: #0A6CC4; --bs-pagination-disabled-bg: var(--canvas); }
[data-bs-theme="dark"] .progress { --bs-progress-bg: #2A2C31; --bs-progress-bar-bg: #0A6CC4; }
[data-bs-theme="dark"] .dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line); --bs-dropdown-link-hover-bg: #232428; }
[data-bs-theme="dark"] .modal-content { box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, .5); }

/* Badges en meldingen */
[data-bs-theme="dark"] .text-bg-warning { background-color: #352C14 !important; color: #F5CF62 !important; }
[data-bs-theme="dark"] .text-bg-success { background-color: #173225 !important; color: #73D7A0 !important; }
[data-bs-theme="dark"] .text-bg-danger { background-color: #3A1D1E !important; color: #F59A96 !important; }
[data-bs-theme="dark"] .text-bg-secondary { background-color: #2A2C31 !important; color: #C8CACF !important; }
[data-bs-theme="dark"] .text-bg-info { background-color: #1C2C3E !important; color: #8CC2F5 !important; }
[data-bs-theme="dark"] .text-bg-primary { background-color: #1C2836 !important; color: #8CC2F5 !important; }
[data-bs-theme="dark"] .text-bg-light { background-color: #2A2C31 !important; color: #D8DADD !important; }
[data-bs-theme="dark"] .bg-light { background-color: #232428 !important; }
[data-bs-theme="dark"] .bg-light.text-dark, [data-bs-theme="dark"] .bg-light .text-dark { color: var(--ink) !important; }
[data-bs-theme="dark"] .bg-white:not([data-bs-theme="light"]) { background-color: var(--surface) !important; }
[data-bs-theme="dark"] .alert-info { --bs-alert-bg: #182533; --bs-alert-color: #A9CFF5; --bs-alert-link-color: #CFE4FA; border-left-color: #3B82C4; }
[data-bs-theme="dark"] .alert-success { --bs-alert-bg: #15271D; --bs-alert-color: #8FDDB0; --bs-alert-link-color: #BDEBD0; border-left-color: #22A05A; }
[data-bs-theme="dark"] .alert-warning { --bs-alert-bg: #2A2414; --bs-alert-color: #F5D27A; --bs-alert-link-color: #FBE3A6; border-left-color: var(--condors-yellow); }
[data-bs-theme="dark"] .alert-danger { --bs-alert-bg: #2E1A1B; --bs-alert-color: #F5A3A0; --bs-alert-link-color: #FAC9C7; border-left-color: #D93B36; }
[data-bs-theme="dark"] .alert-secondary, [data-bs-theme="dark"] .alert-light { --bs-alert-bg: #232428; --bs-alert-color: var(--ink); border-left-color: #50535B; }

/* Startpagina, tegels, kaarten */
[data-bs-theme="dark"] .tile:hover, [data-bs-theme="dark"] .cal-chip:hover { border-color: #44474E; }
[data-bs-theme="dark"] a.agenda-item:hover { background: #1C2836; }
[data-bs-theme="dark"] .card .fs-4.fw-bold, [data-bs-theme="dark"] .card .fs-3.fw-bold { color: #7AB4EE; }
[data-bs-theme="dark"] .desk-bell, html[data-bs-theme="dark"] .desk-help { color: var(--ink); }
[data-bs-theme="dark"] .desk-bell:hover, html[data-bs-theme="dark"] .desk-help:hover { color: #8CC2F5; }
[data-bs-theme="dark"] .appbar-bell .notif-count { box-shadow: 0 0 0 2px var(--condors-navy); }
[data-bs-theme="dark"] .notif-item.is-new { background: #1C2836; border-color: #34506E; }

/* Statistieken, audit log, vrijwilligers */
[data-bs-theme="dark"] .stat-tile { background: var(--surface); }
[data-bs-theme="dark"] .stat-label, [data-bs-theme="dark"] .att-legend, [data-bs-theme="dark"] .audit-changes dt { color: var(--muted); }
[data-bs-theme="dark"] .att-bar { background: #2A2C31; }
[data-bs-theme="dark"] .att-detail td { background: #17181A; }
[data-bs-theme="dark"] .att-Aanwezig { background: #2F86D6; }
[data-bs-theme="dark"] .att-Afgemeld { background: #70747C; }
[data-bs-theme="dark"] .audit-item { border-left-color: #44474E; }
[data-bs-theme="dark"] .audit-item.audit-sensitive { border-left-color: #FAC312; }
[data-bs-theme="dark"] .audit-item.audit-warn { border-left-color: #D64545; }
[data-bs-theme="dark"] .board-list .rank { color: #8CC2F5; }

/* Kalender */
[data-bs-theme="dark"] .cal-activiteit { --c: #A07EE6; }
[data-bs-theme="dark"] .cal-shift { --c: #2FB36B; }
[data-bs-theme="dark"] .cal-chip.on { border-color: color-mix(in srgb, var(--c) 55%, var(--surface)); background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
[data-bs-theme="dark"] .cal-week-title { color: #8CC2F5; }
[data-bs-theme="dark"] .is-today .cal-date { color: #17202E; }
[data-bs-theme="dark"] .cal-today, [data-bs-theme="dark"] .pill-home { color: #F5CF62; }
[data-bs-theme="dark"] .pill-away, [data-bs-theme="dark"] .result-gelijk { background: #2A2C31; color: #C8CACF; }
[data-bs-theme="dark"] .result-gewonnen, [data-bs-theme="dark"] .pill-shift { background: #173225; color: #73D7A0; }
[data-bs-theme="dark"] .result-gewonnen { box-shadow: inset 0 0 0 1px rgba(115, 215, 160, .3); }
[data-bs-theme="dark"] .result-verloren, [data-bs-theme="dark"] .pill-danger { background: #3A1D1E; color: #F59A96; }
[data-bs-theme="dark"] .cal-recent-item { border-left-color: #44474E; }
[data-bs-theme="dark"] .cal-recent-item.is-gewonnen { border-left-color: #2FB36B; background: #16251C; }
[data-bs-theme="dark"] .cal-recent-item.is-verloren { border-left-color: #E05A55; }
[data-bs-theme="dark"] .cal-item.is-gewonnen { background: linear-gradient(90deg, rgba(47, 179, 107, .18), rgba(47, 179, 107, 0) 70%); }
[data-bs-theme="dark"] .cal-item.is-gewonnen:hover { background: #1A3325; }
[data-bs-theme="dark"] .cal-empty { border-color: #44474E; }

/* Mailing-editor en emoji's */
[data-bs-theme="dark"] .mail-editor { background: #151618; }
[data-bs-theme="dark"] .me-toolbar button:hover { background: #2A2C31; border-color: var(--line); }
[data-bs-theme="dark"] .me-toolbar button.active { border-color: rgba(122, 180, 238, .4); color: #8CC2F5; }
[data-bs-theme="dark"] .me-area h2, [data-bs-theme="dark"] .me-area h3 { color: #8CC2F5; }
[data-bs-theme="dark"] .me-area a { color: #7AB4EE; }
[data-bs-theme="dark"] .mail-editor.me-empty .me-area::before { color: #70747C; }
[data-bs-theme="dark"] .emoji-picker { background: var(--surface); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
[data-bs-theme="dark"] .emoji-tabs button.active { color: #8CC2F5; }
/* Mailvoorbeeld: de mail zelf blijft zoals de ontvanger hem ziet, enkel het kader errond wordt donker. */
[data-bs-theme="dark"] .mail-preview { background: #121315; border-color: var(--line); }
[data-bs-theme="dark"] .mail-preview-gsm { border-color: #000; }

/* Helpsectie: startkaarten grijs met een geel randje in plaats van een geel vlak. */
html[data-bs-theme="dark"] .help-start { background: var(--surface); border-color: rgba(250, 195, 18, .35); }
html[data-bs-theme="dark"] .help-start:hover { border-color: var(--condors-yellow); }

/* Blazor-meldingen */
[data-bs-theme="dark"] #blazor-error-ui { color: #17202E; }
[data-bs-theme="dark"] #components-reconnect-modal { background-color: var(--surface); color: var(--ink); }

/* Afdrukken: altijd licht, op papier. */
@media print {
    [data-bs-theme="dark"] { color-scheme: light; --ink: #17202E; --muted: #5A6578; --line: #E1E6EE; --surface: #fff; --canvas: #fff; --bs-body-color: #17202E; --bs-body-bg: #fff; --bs-emphasis-color: #000; --bs-heading-color: inherit; }
    [data-bs-theme="dark"] body { color: #17202E; }
}
