/* =============================================
   DARK MODE CSS VARIABLES
   ============================================= */
[data-theme="dark"] {
    --bg-color: #000000;
    --container-bg: #000000;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --border-color: #333333;
    --input-bg: #000000;
    --modal-bg: #000000;
    --modal-overlay: rgba(0, 0, 0, 0.85);
    --card-bg: #000000;
    --table-header-bg: #000000;
    --table-header-text: #ffffff;
    --table-row-hover: #111111;
    --nav-btn-bg: #000000;
    --nav-btn-hover: #222222;
    --shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
}

/* =============================================
   PERSISTENT SIGNATURE
   ============================================= */
[data-theme="dark"] .persistent-signature {
    background: rgba(30, 30, 30, 0.9);
}

/* =============================================
   THEME TOGGLE BUTTON
   ============================================= */
[data-theme="dark"] .theme-toggle-btn {
    background: #f1c40f;
}

/* =============================================
   PATIENT VIEW PANEL
   ============================================= */
[data-theme="dark"] .patient-view-panel {
    background: #000000;
}

[data-theme="dark"] .patient-photo-card {
    background: #000000;
}

[data-theme="dark"] .patient-photo-label {
    color: #ffffff;
}

[data-theme="dark"] .patient-photo-id {
    color: #ffffff;
}

[data-theme="dark"] .patient-info-label {
    color: #ffffff;
}

[data-theme="dark"] .patient-info-field {
    color: #ffffff;
}

[data-theme="dark"] .patient-conditions-field {
    color: #ffffff;
}

[data-theme="dark"] .patient-view-heading {
    color: #ffffff;
}

/* =============================================
   MODAL & TABLE OVERRIDES
   ============================================= */
[data-theme="dark"] .modal-section-bar {
    background: #000000;
}

[data-theme="dark"] .modal-content table td {
    background-color: #000000;
}

[data-theme="dark"] .modal-content table tr:nth-child(even) td {
    background-color: #0d0d0d;
}

[data-theme="dark"] .close-modal { color: #ffffff !important; }

[data-theme="dark"] .close-modal:hover { background-color: #333333 !important; }

[data-theme="dark"] h3, [data-theme="dark"] h4 { color: #ffffff !important; }

[data-theme="dark"] .header-info h2, [data-theme="dark"] .header-info p { color: #ffffff !important; }

[data-theme="dark"] #signature-preview-container { background-color: #000000 !important; }

/* =============================================
   INLINE STYLE OVERRIDES — BACKGROUNDS
   ============================================= */
[data-theme="dark"] [style*="background: #f8f9fa"],
[data-theme="dark"] [style*="background:#f8f9fa"] {
    background-color: #000000 !important;
}

[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background-color: #ffffff"],
[data-theme="dark"] [style*="background-color:#ffffff"] {
    background-color: #000000 !important;
}

[data-theme="dark"] [style*="background: #f8f9fa"],
[data-theme="dark"] [style*="background:#f8f9fa"],
[data-theme="dark"] [style*="background: #e9ecef"],
[data-theme="dark"] [style*="background:#e9ecef"] {
    background-color: #000000 !important;
}

/* =============================================
   INLINE STYLE OVERRIDES — TEXT COLORS
   ============================================= */
[data-theme="dark"] [style*="color: #555"],
[data-theme="dark"] [style*="color: #666"],
[data-theme="dark"] [style*="color: #777"],
[data-theme="dark"] [style*="color: #888"],
[data-theme="dark"] [style*="color: #999"],
[data-theme="dark"] [style*="color: #333"],
[data-theme="dark"] [style*="color: #222"],
[data-theme="dark"] [style*="color: #000"],
[data-theme="dark"] [style*="color: #2c3e50"],
[data-theme="dark"] [style*="color: #121212"],
[data-theme="dark"] [style*="color:#555"],
[data-theme="dark"] [style*="color:#666"],
[data-theme="dark"] [style*="color:#999"],
[data-theme="dark"] [style*="color:#333"],
[data-theme="dark"] [style*="color:#222"],
[data-theme="dark"] [style*="color:#000"],
[data-theme="dark"] [style*="color:#2c3e50"],
[data-theme="dark"] [style*="color:#121212"] {
    color: #ffffff !important;
}

/* =============================================
   INLINE STYLE OVERRIDES — SPECIAL BACKGROUNDS
   ============================================= */
[data-theme="dark"] [style*="background-color: #f0f7f0"],
[data-theme="dark"] [style*="background-color:#f0f7f0"],
[data-theme="dark"] [style*="background: #e8f5e9"],
[data-theme="dark"] [style*="background:#e8f5e9"] {
    background-color: #000000 !important;
}

/* =============================================
   INLINE STYLE OVERRIDES — BORDERS
   ============================================= */
[data-theme="dark"] [style*="border: 1px solid #c8e6c9"],
[data-theme="dark"] [style*="border: 1px solid #c8e6c9"] {
    border-color: #333333 !important;
}

[data-theme="dark"] [style*="border: 1px solid #ccc"],
[data-theme="dark"] [style*="border: 1px solid #ddd"],
[data-theme="dark"] [style*="border: 1px solid #e9ecef"],
[data-theme="dark"] [style*="border: 1px solid #eee"],
[data-theme="dark"] [style*="border-bottom: 1px solid #eee"],
[data-theme="dark"] [style*="border-bottom: 1px solid #ddd"],
[data-theme="dark"] [style*="border-top: 1px solid #eee"],
[data-theme="dark"] [style*="border-top: 1px solid #ddd"] {
    border-color: #333333 !important;
}

/* =============================================
   GENERAL OVERRIDES FOR BLACK/WHITE LAYOUT
   ============================================= */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #333333 !important;
}

[data-theme="dark"] select option {
    background-color: #000000 !important;
    color: #ffffff !important;
}

[data-theme="dark"] body,
[data-theme="dark"] aside.sidebar,
[data-theme="dark"] main,
[data-theme="dark"] div.container,
[data-theme="dark"] div.card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .modal-body,
[data-theme="dark"] .search-results-dropdown,
[data-theme="dark"] .search-container,
[data-theme="dark"] .app-layout {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #333333 !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] label,
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] th {
    color: #ffffff !important;
}

[data-theme="dark"] a {
    color: #ffffff !important;
}
