/*
 * Dark theme for signed-in members on every site page (not the admin panel; see public/js/theme.js).
 * Bootstrap 5.3 darkens its own components through data-bs-theme="dark"; this file darkens the
 * ZenBlog variables and the fixed light colours in app.css / notifications.css.
 * Palette follows Sneat's dark variant: page #232333, surface #2b2c40, lines #444564.
 */
[data-bs-theme="dark"] {
    color-scheme: dark;
    --background-color: #232333;
    --surface-color: #2b2c40;
    --default-color: #cbcbe2;
    --heading-color: #e4e4f3;
    --contrast-color: #ffffff;
    --accent-color: #6ea8fe;
    --accent-hover-color: #8bb9fe;
    --accent-active-color: #9ec5fe;
    --nav-color: #b4b5d6;
    --nav-hover-color: #6ea8fe;
    --nav-mobile-background-color: #2b2c40;
    --nav-dropdown-background-color: #2b2c40;
    --nav-dropdown-color: #b4b5d6;
    --nav-dropdown-hover-color: #6ea8fe;
    --bs-body-bg: #232333;
    --bs-body-color: #cbcbe2;
    --bs-emphasis-color: #e4e4f3;
    --bs-secondary-color: #9a9bc0;
    --bs-tertiary-bg: #30314a;
    --bs-secondary-bg: #30314a;
    --bs-border-color: #444564;
    --bs-link-color: #6ea8fe;
    --bs-link-hover-color: #9ec5fe;
    --bs-link-color-rgb: 110, 168, 254;
    --bs-link-hover-color-rgb: 158, 197, 254;
}

[data-bs-theme="dark"] body {
    background-color: #232333;
    color: #cbcbe2;
}

/* Brand buttons keep Bootstrap's blue (white text) rather than the lighter link blue. */
[data-bs-theme="dark"] .btn-accent {
    --bs-btn-bg: #0d6efd;
    --bs-btn-border-color: #0d6efd;
}

/* Header and account menu */
[data-bs-theme="dark"] .header {
    background-color: #2b2c40;
    border-bottom-color: #444564;
}

[data-bs-theme="dark"] .header-search .form-control {
    background-color: #232333;
}

[data-bs-theme="dark"] .header .dropdown-menu,
[data-bs-theme="dark"] .navmenu .dropdown ul {
    background-color: #2b2c40;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .header .account-menu .dropdown-item,
[data-bs-theme="dark"] .header .account-menu .dropdown-item:hover,
[data-bs-theme="dark"] .header .account-menu .dropdown-item:focus,
[data-bs-theme="dark"] .theme-choice {
    color: #b4b5d6;
}

[data-bs-theme="dark"] .header .account-menu .dropdown-item:hover,
[data-bs-theme="dark"] .header .account-menu .dropdown-item:focus,
[data-bs-theme="dark"] .theme-choice:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .header .account-menu .dropdown-divider,
[data-bs-theme="dark"] .theme-choice {
    border-color: #444564;
}

[data-bs-theme="dark"] .theme-choice.active {
    border-color: #6ea8fe;
    background-color: rgba(110, 168, 254, 0.16);
    color: #6ea8fe;
}

[data-bs-theme="dark"] .verify-email-banner {
    background: #3a3322;
    border-bottom-color: #5c4a12;
    color: #f3e2a9;
}

/* Member layout */
[data-bs-theme="dark"] .member-body {
    --background-color: #232333;
    background-color: #232333;
}

[data-bs-theme="dark"] .member-sidebar {
    background: #2b2c40;
    box-shadow: 0 0.125rem 0.375rem 0 rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .member-menu-header {
    color: #7071a4;
}

[data-bs-theme="dark"] .member-menu-link {
    color: #b4b5d6;
}

[data-bs-theme="dark"] .member-menu-link:hover,
[data-bs-theme="dark"] .member-menu-link:focus-visible {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e4e4f3;
}

[data-bs-theme="dark"] .member-menu-item.active > .member-menu-link {
    background-color: rgba(110, 168, 254, 0.16);
    color: #6ea8fe;
}

[data-bs-theme="dark"] .member-menu-item.active::before {
    background: #6ea8fe;
}

[data-bs-theme="dark"] .member-area .card,
[data-bs-theme="dark"] .member-area .list-group,
[data-bs-theme="dark"] .member-area .empty-state {
    background-color: #2b2c40;
    box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .member-area .card-header,
[data-bs-theme="dark"] .member-area .list-group-item,
[data-bs-theme="dark"] .course-facts li + li,
[data-bs-theme="dark"] .course-syllabus .list-group-item,
[data-bs-theme="dark"] .classroom-section + .classroom-section {
    border-color: #444564;
}

[data-bs-theme="dark"] .member-area .list-group-item,
[data-bs-theme="dark"] .member-area .table {
    --bs-table-bg: transparent;
    background-color: transparent;
    color: #cbcbe2;
}

[data-bs-theme="dark"] .member-area .table > thead th {
    color: #b4b5d6;
}

[data-bs-theme="dark"] .member-area .form-control,
[data-bs-theme="dark"] .member-area .form-select {
    background-color: #2b2c40;
    border-color: #444564;
    color: #cbcbe2;
}

[data-bs-theme="dark"] .member-area .form-control::placeholder {
    color: #7071a4;
}

[data-bs-theme="dark"] .member-area .form-control:disabled,
[data-bs-theme="dark"] .member-area .form-control[readonly] {
    background-color: #30314a;
}

[data-bs-theme="dark"] .form-floating > label {
    background-color: #2b2c40;
    color: #9a9bc0;
}

[data-bs-theme="dark"] .form-floating > .form-control:not(:placeholder-shown) ~ label,
[data-bs-theme="dark"] .form-floating > .form-control:-webkit-autofill ~ label,
[data-bs-theme="dark"] .form-floating > .form-select ~ label {
    color: #cbcbe2;
}

[data-bs-theme="dark"] .form-floating > .form-control:focus ~ label,
[data-bs-theme="dark"] .form-floating > .form-select:focus ~ label {
    color: var(--accent-color);
}

[data-bs-theme="dark"] .member-footer {
    background: #232333;
    border-top-color: #444564;
}

/* Soft "label" colours on a dark page */
[data-bs-theme="dark"] .bg-label-primary { background-color: rgba(13, 110, 253, 0.2) !important; color: #6ea8fe !important; }
[data-bs-theme="dark"] .bg-label-success { background-color: rgba(113, 221, 55, 0.16) !important; color: #71dd37 !important; }
[data-bs-theme="dark"] .bg-label-info { background-color: rgba(3, 195, 236, 0.16) !important; color: #03c3ec !important; }
[data-bs-theme="dark"] .bg-label-warning { background-color: rgba(255, 171, 0, 0.16) !important; color: #ffab00 !important; }
[data-bs-theme="dark"] .bg-label-danger { background-color: rgba(255, 62, 29, 0.16) !important; color: #ff6e55 !important; }
[data-bs-theme="dark"] .bg-label-secondary { background-color: rgba(133, 146, 163, 0.2) !important; color: #a8b2bf !important; }

/* Cards, boxes and panels used on member pages */
[data-bs-theme="dark"] .empty-state,
[data-bs-theme="dark"] .settings-card,
[data-bs-theme="dark"] .post-card,
[data-bs-theme="dark"] .post-card-author,
[data-bs-theme="dark"] .auth-card,
[data-bs-theme="dark"] .contact-card,
[data-bs-theme="dark"] .sidebar-box,
[data-bs-theme="dark"] .editor-actions,
[data-bs-theme="dark"] .comments,
[data-bs-theme="dark"] .comment,
[data-bs-theme="dark"] .comment-replies,
[data-bs-theme="dark"] .like-button,
[data-bs-theme="dark"] .post-footer,
[data-bs-theme="dark"] .home-section-heading,
[data-bs-theme="dark"] .post-mini-list li + li {
    border-color: #444564;
}

[data-bs-theme="dark"] .post-card,
[data-bs-theme="dark"] .settings-card {
    background-color: #2b2c40;
}

[data-bs-theme="dark"] a.post-card-author:hover,
[data-bs-theme="dark"] a.post-card-author:focus-visible,
[data-bs-theme="dark"] .classroom-lecture-link:hover,
[data-bs-theme="dark"] .classroom-meeting {
    background-color: #30314a;
}

[data-bs-theme="dark"] .classroom-lecture-link.active {
    background: rgba(110, 168, 254, 0.16);
}

[data-bs-theme="dark"] .profile-link,
[data-bs-theme="dark"] .social-link,
[data-bs-theme="dark"] .author-box,
[data-bs-theme="dark"] .post-mini-placeholder {
    background: #30314a;
    color: #b4b5d6;
}

[data-bs-theme="dark"] .social-link-row-icon {
    color: #b4b5d6;
}

[data-bs-theme="dark"] .course-card .course-card-placeholder {
    background: linear-gradient(135deg, #2f3e5c, #2b2c40);
}

[data-bs-theme="dark"] .payment-instructions {
    background: #3a3322;
    border-color: #5c4a12;
}

[data-bs-theme="dark"] .preview-banner {
    background: #1f2d47;
    border-bottom-color: #2f4a78;
    color: #9ec5fe;
}

[data-bs-theme="dark"] .diff-added {
    background: #1f3d2c;
    color: #a3cfbb;
}

[data-bs-theme="dark"] .diff-removed {
    background: #47232a;
    color: #f1aeb5;
}

[data-bs-theme="dark"] .post-diff .diff-block-same {
    color: #9a9bc0;
}

[data-bs-theme="dark"] .post-content pre {
    background: #30314a;
}

[data-bs-theme="dark"] .post-content blockquote {
    border-left-color: #444564;
}

/* Post editor (Quill) */
[data-bs-theme="dark"] .post-editor .ql-toolbar.ql-snow {
    background: #30314a;
    border-color: #444564;
}

[data-bs-theme="dark"] .post-editor .ql-container.ql-snow,
[data-bs-theme="dark"] .member-area .post-editor .ql-container.ql-snow {
    background-color: #2b2c40;
    border-color: #444564;
    color: #cbcbe2;
}

[data-bs-theme="dark"] .ql-snow .ql-stroke {
    stroke: #b4b5d6;
}

[data-bs-theme="dark"] .ql-snow .ql-fill,
[data-bs-theme="dark"] .ql-snow .ql-stroke.ql-fill {
    fill: #b4b5d6;
}

[data-bs-theme="dark"] .ql-snow .ql-picker,
[data-bs-theme="dark"] .ql-editor.ql-blank::before {
    color: #9a9bc0;
}

[data-bs-theme="dark"] .ql-snow .ql-picker-options,
[data-bs-theme="dark"] .ql-snow .ql-tooltip {
    background-color: #2b2c40;
    border-color: #444564;
    color: #cbcbe2;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .ql-snow .ql-tooltip input[type="text"] {
    background-color: #232333;
    border-color: #444564;
    color: #cbcbe2;
}

[data-bs-theme="dark"] .editor-plus-toggle,
[data-bs-theme="dark"] .editor-plus-menu,
[data-bs-theme="dark"] .upload-indicator {
    background: #2b2c40;
    border-color: #444564;
    color: #b4b5d6;
}

[data-bs-theme="dark"] .editor-plus-menu button {
    color: #cbcbe2;
}

[data-bs-theme="dark"] .editor-plus-menu button:hover,
[data-bs-theme="dark"] .editor-plus-menu button:focus-visible {
    background: #30314a;
}

[data-bs-theme="dark"] .editor-step-number {
    border-color: #444564;
}

[data-bs-theme="dark"] .editor-step-divider {
    background: #444564;
}

/* Notification menu (notifications.css) */
[data-bs-theme="dark"] .notification-menu-header {
    background: #30314a;
    border-bottom-color: #444564;
}

[data-bs-theme="dark"] .notification-menu-footer,
[data-bs-theme="dark"] .notification-item {
    border-color: #444564;
}

[data-bs-theme="dark"] .notification-item:hover,
[data-bs-theme="dark"] .notification-item:focus-visible {
    background: #30314a;
}

[data-bs-theme="dark"] .notification-item.is-unread {
    background: rgba(110, 168, 254, 0.08);
}

[data-bs-theme="dark"] .notification-icon {
    background: rgba(13, 110, 253, 0.2);
    color: #6ea8fe;
}

[data-bs-theme="dark"] .notification-message {
    color: #e4e4f3;
}

[data-bs-theme="dark"] .notification-excerpt,
[data-bs-theme="dark"] .notification-time {
    color: #9a9bc0;
}

/* Public pages (home, posts, categories, courses, bios) */
[data-bs-theme="dark"] .light-background {
    --background-color: #2b2c40;
    --surface-color: #2b2c40;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #30314a !important;
}

[data-bs-theme="dark"] .text-bg-light {
    background-color: #30314a !important;
    color: #cbcbe2 !important;
}

[data-bs-theme="dark"] .footer {
    background: #2b2c40;
    border-top-color: #444564;
}

[data-bs-theme="dark"] .sidebar-box,
[data-bs-theme="dark"] .contact-card,
[data-bs-theme="dark"] .auth-card,
[data-bs-theme="dark"] .legal-toc {
    background-color: #2b2c40;
}

[data-bs-theme="dark"] .legal-toc {
    border-color: #444564;
}

[data-bs-theme="dark"] .sidebar-categories a:hover {
    background: #30314a;
}

[data-bs-theme="dark"] .share-copy,
[data-bs-theme="dark"] .share-native {
    background: #30314a;
    color: #cbcbe2;
}

[data-bs-theme="dark"] .like-button {
    color: #cbcbe2;
}

[data-bs-theme="dark"] .presence-label.is-online {
    color: #4ade80;
}

[data-bs-theme="dark"] .header .account-menu .dropdown-item.active,
[data-bs-theme="dark"] .header .account-menu .dropdown-item.active:hover {
    background-color: rgba(110, 168, 254, 0.16);
    color: #6ea8fe;
}

/* Form fields everywhere match the cards they sit on (the floating labels use the card colour too). */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2b2c40;
    border-color: #444564;
    color: #cbcbe2;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #7071a4;
}
