/* Dark theme. Applied when <html data-theme="dark"> is set (the inline head
 * snippet + theme.js resolve Light/Auto/Dark into this attribute). Light is the
 * default and needs no rules. Selectors are prefixed with :root[data-theme="dark"]
 * so they win over the pages' base styles regardless of stylesheet order. */

:root[data-theme="dark"] body { background: #121212; color: #e9e9e9; }
:root[data-theme="dark"] a { color: #6ea8fe; }
:root[data-theme="dark"] .text-muted { color: #9a9a9a !important; }

/* Bootstrap surfaces */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .modal-content,
:root[data-theme="dark"] .dropdown-menu,
:root[data-theme="dark"] .list-group-item,
:root[data-theme="dark"] .accordion-button,
:root[data-theme="dark"] .accordion-body { background: #1e1e1e; color: #e9e9e9; }
:root[data-theme="dark"] .list-group-item { border-color: #333; }
:root[data-theme="dark"] .accordion-item { border-color: #333; }
:root[data-theme="dark"] .accordion-button:not(.collapsed) { background: #2a2a2a; color: #fff; }
:root[data-theme="dark"] .accordion-button::after { filter: invert(1) grayscale(1) brightness(2); }
:root[data-theme="dark"] .dropdown-item { color: #e9e9e9; }
:root[data-theme="dark"] .dropdown-item:hover { background: #333; color: #fff; }
:root[data-theme="dark"] .list-group-item-action:hover { background: #2a2a2a; color: #fff; }

/* Form controls */
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select { background: #2a2a2a; color: #e9e9e9; border-color: #444; }
:root[data-theme="dark"] .form-control::placeholder { color: #888; }

/* Calendar table */
:root[data-theme="dark"] .table { color: #e9e9e9; --bs-table-color: #e9e9e9; --bs-table-bg: transparent; }
:root[data-theme="dark"] .table-bordered,
:root[data-theme="dark"] .table-bordered td,
:root[data-theme="dark"] .table-bordered th { border-color: #444; }
:root[data-theme="dark"] .tr-header,
:root[data-theme="dark"] .tr-header th { background: #2a2a2a; color: #e9e9e9; }
:root[data-theme="dark"] td.today { background: #5a5a00; }

/* Calendar settings (gear) button: black fill, white icon; keep its border */
:root[data-theme="dark"] .settings-btn { background: #000; color: #fff; }

/* Resources blockquote */
:root[data-theme="dark"] blockquote { background: rgba(255, 255, 255, .05); }

/* Make the modal/accordion close button visible on dark */
:root[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(2); }
