/* ===== Dark Mode Theme ===== */
/* Layers dark overrides on top of existing styles using [data-theme="dark"] */

/* --- Layout backgrounds --- */
[data-theme="dark"] body {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

[data-theme="dark"] .user-top,
[data-theme="dark"] .user-top-1 {
    background: #0f3460;
}

[data-theme="dark"] .login,
[data-theme="dark"] .welcome,
[data-theme="dark"] .antiques,
[data-theme="dark"] .antiques-1 {
    background: #1a1a2e;
}

[data-theme="dark"] .full-mobile-top {
    background: #0f3460;
}

/* --- Text colors --- */
[data-theme="dark"] .login h4,
[data-theme="dark"] .welcome h4,
[data-theme="dark"] .antiques h4,
[data-theme="dark"] .antiques-1 h4,
[data-theme="dark"] .antiques h5,
[data-theme="dark"] .antiques-1 h5,
[data-theme="dark"] .choose-room h4,
[data-theme="dark"] .reccy-top h4,
[data-theme="dark"] .question-ask h4,
[data-theme="dark"] .supercharged h2,
[data-theme="dark"] .doc-mb-1 h3,
[data-theme="dark"] .antiques-mobile h3 {
    color: #4fc3f7;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #4fc3f7;
}

[data-theme="dark"] #ReccyMain h4 {
    color: #4fc3f7;
}

[data-theme="dark"] #ReccyMain h5 {
    color: #4fc3f7;
}

[data-theme="dark"] #ReccyMain p {
    color: #e0e0e0;
}

[data-theme="dark"] .welcome span,
[data-theme="dark"] .login .form-label {
    color: #a0a0a0;
}

[data-theme="dark"] .peppermill h4 {
    color: #4fc3f7;
}

[data-theme="dark"] .peppermill .btn {
    color: #4fc3f7;
}

[data-theme="dark"] .peppermill h4 a {
    color: #4fc3f7 !important;
}

[data-theme="dark"] .peppermill-2 .btn {
    color: #4fc3f7;
}

[data-theme="dark"] .peppermill-2 .bi {
    color: #4fc3f7;
}

[data-theme="dark"] .Reccy-top-1 h5 {
    color: #4fc3f7;
}

/* --- Profile & Navigation --- */
[data-theme="dark"] .profile-top {
    background: #1a2744 !important;
}

[data-theme="dark"] .profile-top a {
    color: #4fc3f7;
}

[data-theme="dark"] .profile-top-2 {
    background: #66bb6a;
}

/* --- Form controls --- */
[data-theme="dark"] .login .form-control,
[data-theme="dark"] .peppermill .form-control,
[data-theme="dark"] .document-all .form-control {
    background-color: #1a2744;
    border-color: #2a3a5c;
    color: #e0e0e0;
}

[data-theme="dark"] .ask-reccy .form-control {
    background-color: #1a2744;
    border-color: #2a3a5c;
    color: #e0e0e0;
}

[data-theme="dark"] .mb-3.ask-btn .btn {
    background: #1a2744;
    color: #a0a0a0;
}

[data-theme="dark"] .form-control.search-top {
    background: #1a2744;
    color: #e0e0e0;
}

[data-theme="dark"] .search-top.form-control::placeholder {
    color: #a0a0a0;
}

/* --- Buttons --- */
[data-theme="dark"] .btn-primary {
    background-color: #66bb6a;
    color: #1a1a2e;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus,
[data-theme="dark"] .btn-primary:active {
    background-color: #66bb6a;
    color: #1a1a2e;
}

[data-theme="dark"] .btn-secondary {
    background: #1a2744;
    color: #e0e0e0;
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn-secondary:active {
    background: #1a2744;
    color: #e0e0e0;
}

[data-theme="dark"] .Login-right {
    background: #66bb6a;
    border-color: #66bb6a;
    color: #1a1a2e;
}

[data-theme="dark"] .Login-right:hover {
    background: #0f3460;
    border-color: #0f3460;
}

[data-theme="dark"] .submit-file .btn.enter {
    background: #66bb6a;
    color: #1a1a2e;
}

[data-theme="dark"] .btn.add-file {
    background: #1a2744;
    color: #e0e0e0;
}

[data-theme="dark"] .add-file .bi {
    color: #e0e0e0;
}

[data-theme="dark"] .btn.request-docs {
    background: #1a2744;
    color: #e0e0e0;
}

[data-theme="dark"] .request-docs .bi {
    color: #e0e0e0;
}

[data-theme="dark"] .new-room .btn {
    background: #66bb6a;
    color: #1a1a2e;
}

[data-theme="dark"] .new-room .bi-plus::before {
    color: #1a1a2e;
}

[data-theme="dark"] .btn.Add-User {
    background: #66bb6a;
}

[data-theme="dark"] .Save-Changes {
    background: #66bb6a;
}

[data-theme="dark"] .submit-right .btn-primary {
    border-color: #66bb6a;
    background: #66bb6a;
    color: #1a1a2e;
}

[data-theme="dark"] a.form-control.btn-primary {
    background: #66bb6a;
    border-color: #66bb6a;
    color: #1a1a2e;
}

/* --- Links & actions --- */
[data-theme="dark"] .reset-password {
    color: #66bb6a;
}

[data-theme="dark"] .reset-password:hover {
    color: #e0e0e0;
}

[data-theme="dark"] .change-room,
[data-theme="dark"] .change-room-1 {
    color: #66bb6a;
}

[data-theme="dark"] .change-room:hover,
[data-theme="dark"] .change-room-1:hover {
    color: #66bb6a;
}

[data-theme="dark"] .delete-room {
    background: #1a2744;
}

[data-theme="dark"] .delete-room span {
    color: #66bb6a;
}

[data-theme="dark"] .delete-room-1 span {
    color: #ef5350;
}

[data-theme="dark"] .delete-user {
    color: #66bb6a;
}

[data-theme="dark"] .reset-user-password {
    color: #66bb6a;
}

[data-theme="dark"] .saved-answers a {
    color: #66bb6a;
}

[data-theme="dark"] .action {
    color: #66bb6a;
}

[data-theme="dark"] .star-btn .bi {
    color: #4fc3f7;
}

[data-theme="dark"] .floppy-right ul li .bi {
    color: #4fc3f7;
}

[data-theme="dark"] .finance .bi {
    color: #66bb6a;
}

[data-theme="dark"] .active {
    color: #66bb6a;
}

/* --- Tab / Category buttons --- */
[data-theme="dark"] .tab button {
    background: #1a2744;
    color: #a0a0a0;
}

[data-theme="dark"] .tab button:hover {
    background-color: #1a2744;
    color: #e0e0e0;
}

[data-theme="dark"] .tab button.active {
    background-color: #1a2744;
    color: #e0e0e0;
}

[data-theme="dark"] .bi.bi-check-circle-fill.click-on {
    color: #66bb6a;
}

/* --- Modals --- */
[data-theme="dark"] .modal-content {
    background-color: #1a2744;
    color: #e0e0e0;
}

[data-theme="dark"] .modal-header {
    background-color: #0f3460;
}

[data-theme="dark"] .modal-insert {
    background: #1a2744;
}

/* --- Insights drill-down --- */
[data-theme="dark"] .action-btn {
    color: #4fc3f7;
}

[data-theme="dark"] .action-btn:hover {
    color: #81d4fa;
}

[data-theme="dark"] .drilldown-container:not(:empty) {
    border-left-color: #4fc3f7;
}

[data-theme="dark"] .sources-content {
    background-color: #1a2744;
}

[data-theme="dark"] .sources-content h6 {
    color: #4fc3f7;
}

[data-theme="dark"] .source-item {
    border-bottom-color: #2a3a5c;
}

[data-theme="dark"] .source-link {
    color: #4fc3f7;
}

[data-theme="dark"] .source-excerpt {
    color: #a0a0a0;
    background-color: #16213e;
    border-left-color: #2a3a5c;
}

[data-theme="dark"] .expansion-content {
    background-color: #162447;
}

[data-theme="dark"] .expansion-content h6 {
    color: #4fc3f7;
}

[data-theme="dark"] .followup-item {
    background-color: #162447;
}

[data-theme="dark"] .followup-question {
    color: #e0e0e0;
}

[data-theme="dark"] .followup-answer {
    color: #a0a0a0;
}

[data-theme="dark"] .followup-response {
    color: #a0a0a0;
}

[data-theme="dark"] .consolidate-btn {
    color: #66bb6a;
}

[data-theme="dark"] .consolidate-btn:hover {
    color: #81c784;
}

[data-theme="dark"] .section-progress {
    background-color: #2a3a5c;
}

[data-theme="dark"] .insight-hidden h5 {
    color: #666 !important;
}

/* --- Markdown content --- */
[data-theme="dark"] .markdown-content h1,
[data-theme="dark"] .markdown-content h2 {
    color: #4fc3f7;
    border-bottom-color: #2a3a5c;
}

[data-theme="dark"] .markdown-content h3,
[data-theme="dark"] .markdown-content h4,
[data-theme="dark"] .markdown-content h5,
[data-theme="dark"] .markdown-content h6 {
    color: #e0e0e0;
}

[data-theme="dark"] .markdown-content strong {
    color: #f0f0f0;
}

[data-theme="dark"] .markdown-content th {
    background-color: #0f3460;
    border-color: #0a2647;
}

[data-theme="dark"] .markdown-content td {
    border-color: #2a3a5c;
}

[data-theme="dark"] .markdown-content tr:nth-child(even) {
    background-color: #162447;
}

[data-theme="dark"] .markdown-content tr:hover {
    background-color: #1a2744;
}

[data-theme="dark"] .markdown-content code {
    background-color: #0d1b2a;
    color: #e0e0e0;
}

[data-theme="dark"] .markdown-content pre {
    background-color: #0d1b2a;
}

[data-theme="dark"] .markdown-content blockquote {
    border-left-color: #4fc3f7;
    color: #a0a0a0;
}

[data-theme="dark"] .markdown-content hr {
    border-top-color: #2a3a5c;
}

[data-theme="dark"] .markdown-content a {
    color: #4fc3f7;
}

/* --- Chat messages --- */
[data-theme="dark"] .reccy-header {
    color: #4fc3f7;
}

[data-theme="dark"] .updating-insights {
    color: #4fc3f7;
}

/* --- Misc components --- */
[data-theme="dark"] .toc {
    color: #4fc3f7;
}

[data-theme="dark"] .toc a {
    color: #66bb6a;
}

[data-theme="dark"] #ask-spinner {
    color: #4fc3f7;
}

[data-theme="dark"] .disclaimer {
    color: #4fc3f7 !important;
}

[data-theme="dark"] .ask-btn .button {
    color: #4fc3f7 !important;
}

[data-theme="dark"] .top-mb-1 {
    background: #1a2744;
}

/* --- Accordion --- */
[data-theme="dark"] .unconfirmed .accordion-item {
    background-color: #1a2744;
}

[data-theme="dark"] .unconfirmed .accordion-button:not(.collapsed) {
    background-color: #1a2744 !important;
}

[data-theme="dark"] .unconfirmed .accordion-button h6 {
    color: #4fc3f7;
}

[data-theme="dark"] .unconfirmed .accordion-button small .bi,
[data-theme="dark"] .unconfirmed .accordion-button span .bi {
    color: #4fc3f7;
}

/* --- Scrollbar --- */
[data-theme="dark"] .top-scroll::-webkit-scrollbar-track {
    background: #1a1a2e;
}

[data-theme="dark"] .top-scroll::-webkit-scrollbar-thumb {
    background: #2a3a5c;
}

/* --- Mobile category buttons in dark mode --- */
@media screen and (max-width: 767px) {
    [data-theme="dark"] #mobileSelections .tab .tablinks,
    [data-theme="dark"] .tab-mb-1 .tab .tablinks {
        background: #1a2744 !important;
        border-color: #2a3a5c !important;
        color: #4fc3f7 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    }

    [data-theme="dark"] #mobileSelections .tab .tablinks:hover,
    [data-theme="dark"] .tab-mb-1 .tab .tablinks:hover {
        background: #162447 !important;
        border-color: #66bb6a !important;
    }

    [data-theme="dark"] #mobileSelections .tab .tablinks.active,
    [data-theme="dark"] #mobileSelections .tab .tablinks:active,
    [data-theme="dark"] .tab-mb-1 .tab .tablinks.active,
    [data-theme="dark"] .tab-mb-1 .tab .tablinks:active {
        background: #66bb6a !important;
        border-color: #66bb6a !important;
        color: #1a1a2e !important;
    }

    [data-theme="dark"] #mobileSelections .tab::-webkit-scrollbar-track {
        background: #1a1a2e !important;
    }

    [data-theme="dark"] #mobileSelections .tab::-webkit-scrollbar-thumb {
        background: #2a3a5c !important;
    }

    [data-theme="dark"] .tab-mb-1::before {
        background: linear-gradient(to left, rgba(26,26,46,0.9) 0%, transparent 100%) !important;
    }

    [data-theme="dark"] .tab-mb-1::after {
        color: #4fc3f7 !important;
    }

    [data-theme="dark"] .mobile-terms {
        border-top-color: #2a3a5c !important;
    }

    [data-theme="dark"] #ReccyMain #exportInsights {
        border-top-color: #2a3a5c !important;
    }

    [data-theme="dark"] #ReccyMain #exportInsights h6 {
        color: #4fc3f7 !important;
    }

    [data-theme="dark"] #ReccyMain #exportInsights h6 a {
        color: #66bb6a !important;
    }
}

/* --- Dark mode toggle icon styling --- */
#dark-mode-toggle {
    cursor: pointer;
}

#dark-mode-toggle .bi {
    font-size: 30px;
    transition: color 0.2s ease;
}
