/* ============================================================
   GLOBAL DARK THEME OVERRIDES
   Fixes all hardcoded inline background:#fff, color:#000, etc.
   across the entire project without touching individual files.
   ============================================================ */

/* ── Inline background:#fff → dark card ── */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background-color: #fff"] {
  background: var(--card, #1e293b) !important;
}

/* ── Inline background:white → dark card ── */
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background-color:white"],
[data-theme="dark"] [style*="background-color: white"] {
  background: var(--card, #1e293b) !important;
}

/* ── Inline background:rgba(255,255,255,.94) → dark card (cards, panels) ── */
[data-theme="dark"] [style*="background:rgba(255,255,255,.94)"],
[data-theme="dark"] [style*="background: rgba(255,255,255,.94)"],
[data-theme="dark"] [style*="background:rgba(255,255,255,0.94)"],
[data-theme="dark"] [style*="background: rgba(255,255,255,0.94)"],
[data-theme="dark"] [style*="background:rgba(255,255,255,.95)"],
[data-theme="dark"] [style*="background: rgba(255,255,255,.95)"],
[data-theme="dark"] [style*="background:rgba(255,255,255,0.95)"],
[data-theme="dark"] [style*="background: rgba(255,255,255,0.95)"] {
  background: var(--card, #1e293b) !important;
}

/* ── Inline background:var(--card,#fff) → dark card ── */
[data-theme="dark"] [style*="background:var(--card"],
[data-theme="dark"] [style*="background: var(--card"] {
  background: var(--card, #1e293b) !important;
}

/* ── Inline color:#000 → light text ── */
[data-theme="dark"] [style*="color:#000"],
[data-theme="dark"] [style*="color: #000"],
[data-theme="dark"] [style*="color:black"],
[data-theme="dark"] [style*="color: black"] {
  color: var(--ink, #f1f5f9) !important;
}

/* ── Inline color:#111 → light text ── */
[data-theme="dark"] [style*="color:#111"],
[data-theme="dark"] [style*="color: #111"],
[data-theme="dark"] [style*="color:#111827"],
[data-theme="dark"] [style*="color: #111827"] {
  color: var(--ink, #f1f5f9) !important;
}

/* ── Inline color:#333 → light text ── */
[data-theme="dark"] [style*="color:#333"],
[data-theme="dark"] [style*="color: #333"] {
  color: var(--ink, #f1f5f9) !important;
}

/* ── Inline border with hardcoded light colors → dark border ── */
[data-theme="dark"] [style*="border:1px solid #e"],
[data-theme="dark"] [style*="border: 1px solid #e"],
[data-theme="dark"] [style*="border:1px solid #dbe5ef"],
[data-theme="dark"] [style*="border: 1px solid #dbe5ef"],
[data-theme="dark"] [style*="border:1px solid #e5e7eb"],
[data-theme="dark"] [style*="border: 1px solid #e5e7eb"],
[data-theme="dark"] [style*="border:1px solid #e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #e2e8f0"] {
  border-color: var(--line, #334155) !important;
}

/* ── Inline border-radius with white bg → keep radius but fix bg ── */
[data-theme="dark"] [style*="border-radius:20px"][style*="background:#fff"],
[data-theme="dark"] [style*="border-radius:20px"][style*="background: #fff"],
[data-theme="dark"] [style*="border-radius:16px"][style*="background:#fff"],
[data-theme="dark"] [style*="border-radius:16px"][style*="background: #fff"],
[data-theme="dark"] [style*="border-radius:14px"][style*="background:#fff"],
[data-theme="dark"] [style*="border-radius:14px"][style*="background: #fff"],
[data-theme="dark"] [style*="border-radius:12px"][style*="background:#fff"],
[data-theme="dark"] [style*="border-radius:12px"][style*="background: #fff"] {
  background: var(--card, #1e293b) !important;
}

/* ── Modals with background:#fff → dark modal ── */
[data-theme="dark"] [style*="background:#fff"][style*="border-radius:20px"],
[data-theme="dark"] [style*="background: #fff"][style*="border-radius:20px"],
[data-theme="dark"] [style*="background:#fff"][style*="max-width:"],
[data-theme="dark"] [style*="background: #fff"][style*="max-width:"] {
  background: var(--card, #1e293b) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.5) !important;
}

/* ── Buttons with background:#fff → dark button ── */
[data-theme="dark"] button[style*="background:#fff"],
[data-theme="dark"] button[style*="background: #fff"],
[data-theme="dark"] a[style*="background:#fff"],
[data-theme="dark"] a[style*="background: #fff"] {
  background: var(--card, #1e293b) !important;
  color: var(--ink, #f1f5f9) !important;
  border-color: var(--line, #334155) !important;
}

/* ── Inputs/selects with background:#fff → dark input ── */
[data-theme="dark"] input[style*="background:#fff"],
[data-theme="dark"] input[style*="background: #fff"],
[data-theme="dark"] select[style*="background:#fff"],
[data-theme="dark"] select[style*="background: #fff"],
[data-theme="dark"] textarea[style*="background:#fff"],
[data-theme="dark"] textarea[style*="background: #fff"] {
  background: var(--input, #1e293b) !important;
  color: var(--ink, #f1f5f9) !important;
  border-color: var(--line, #334155) !important;
}

/* ── Divs with background:#fff and border → dark card ── */
[data-theme="dark"] div[style*="background:#fff"][style*="border"],
[data-theme="dark"] div[style*="background: #fff"][style*="border"] {
  background: var(--card, #1e293b) !important;
  border-color: var(--line, #334155) !important;
  color: var(--ink, #f1f5f9) !important;
}

/* ── span/p/div with hardcoded light text colors ── */
[data-theme="dark"] [style*="color:#475569"],
[data-theme="dark"] [style*="color: #475569"],
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748b"] {
  color: var(--muted, #94a3b8) !important;
}

/* ── background:#f0fdf4, #f8fafc, #f1f5f9, #f9fafb (soft backgrounds) → dark soft ── */
[data-theme="dark"] [style*="background:#f0fdf4"],
[data-theme="dark"] [style*="background: #f0fdf4"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background:#fafafa"],
[data-theme="dark"] [style*="background: #fafafa"],
[data-theme="dark"] [style*="background:#f3f4f6"],
[data-theme="dark"] [style*="background: #f3f4f6"] {
  background: var(--soft, #0f172a) !important;
}

/* ── background:#eff6ff (blue-light) → dark blue ── */
[data-theme="dark"] [style*="background:#eff6ff"],
[data-theme="dark"] [style*="background: #eff6ff"] {
  background: rgba(96,165,250,.08) !important;
}

/* ── background:#dbeafe (blue-100) → dark blue ── */
[data-theme="dark"] [style*="background:#dbeafe"],
[data-theme="dark"] [style*="background: #dbeafe"] {
  background: rgba(96,165,250,.06) !important;
}

/* ── background:#fef3c7, #fffbeb (amber/warning) → dark amber ── */
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background: #fef3c7"],
[data-theme="dark"] [style*="background:#fffbeb"],
[data-theme="dark"] [style*="background: #fffbeb"] {
  background: rgba(251,191,36,.08) !important;
}

/* ── background:#f0fdf4 (green-light) → dark green ── */
[data-theme="dark"] [style*="background:#dcfce7"],
[data-theme="dark"] [style*="background: #dcfce7"] {
  background: rgba(52,211,153,.08) !important;
}

/* ── background:#fef2f2 (red-light) → dark red ── */
[data-theme="dark"] [style*="background:#fef2f2"],
[data-theme="dark"] [style*="background: #fef2f2"] {
  background: rgba(248,113,113,.08) !important;
}

/* ── background:linear-gradient with white → dark gradient ── */
[data-theme="dark"] [style*="background:linear-gradient"][style*="#fff"],
[data-theme="dark"] [style*="background: linear-gradient"][style*="#fff"] {
  background: var(--card, #1e293b) !important;
}

/* ── Location picker dialog (location-picker.js) ── */
[data-theme="dark"] #lpModal > div {
  background: var(--card, #1e293b) !important;
  color: var(--ink, #f1f5f9) !important;
}
[data-theme="dark"] #lpModal h3 { color: var(--ink, #f1f5f9) !important; }
[data-theme="dark"] #lpModal p { color: var(--muted, #94a3b8) !important; }
[data-theme="dark"] #lpModal .lp-opt {
  border-color: var(--line, #334155) !important;
  background: var(--soft, #0f172a) !important;
}
[data-theme="dark"] #lpModal .lp-opt.lp-active {
  border-color: var(--green, #34d399) !important;
  background: rgba(52,211,153,.08) !important;
}
[data-theme="dark"] #lpModal .lp-opt strong { color: var(--ink, #f1f5f9) !important; }
[data-theme="dark"] #lpModal .lp-opt span { color: var(--muted, #94a3b8) !important; }
[data-theme="dark"] #lpModal input[type="text"] {
  background: var(--input, #1e293b) !important;
  color: var(--ink, #f1f5f9) !important;
  border-color: var(--line, #334155) !important;
}
[data-theme="dark"] #lpModal .lp-sr {
  border-color: var(--line, #334155) !important;
}
[data-theme="dark"] #lpModal .lp-sr:hover {
  background: rgba(52,211,153,.06) !important;
  border-color: var(--green, #34d399) !important;
}
[data-theme="dark"] #lpModal .lp-sr strong { color: var(--ink, #f1f5f9) !important; }
[data-theme="dark"] #lpModal .lp-sr span { color: var(--muted, #94a3b8) !important; }
[data-theme="dark"] #lpModal button[style*="background:#fff"] {
  background: var(--card, #1e293b) !important;
  color: var(--ink, #f1f5f9) !important;
  border-color: var(--line, #334155) !important;
}
[data-theme="dark"] #lpModal #lpStatus {
  border-color: var(--line, #334155) !important;
}
[data-theme="dark"] #lpModal #lpPreview {
  background: rgba(52,211,153,.08) !important;
  border-color: rgba(52,211,153,.25) !important;
}
[data-theme="dark"] #lpModal .leaflet-container { background: #0f172a !important; }

/* ── Notification system (simitolk-notifications.js) ── */
[data-theme="dark"] .sn-pop {
  background: var(--card, #1e293b) !important;
  border-color: var(--line, #334155) !important;
  color: var(--ink, #f1f5f9) !important;
}
[data-theme="dark"] .sn-bell-btn {
  background: var(--card, #1e293b) !important;
  color: var(--ink, #f1f5f9) !important;
  border-color: var(--line, #334155) !important;
}
[data-theme="dark"] .sn-panel {
  background: var(--card, #1e293b) !important;
  border-color: var(--line, #334155) !important;
  color: var(--ink, #f1f5f9) !important;
}

/* ── Print utils label viewer modal ── */
[data-theme="dark"] [style*="background:#fff"][style*="position:fixed"] {
  background: var(--card, #1e293b) !important;
  color: var(--ink, #f1f5f9) !important;
}

/* ============================================================
   CLASS-BASED DARK OVERRIDES
   Fixes hardcoded colors in CSS classes not covered by inline selectors
   ============================================================ */

/* ── Emergency modal ── */
[data-theme="dark"] .em-content {
  background: var(--card, #1e293b) !important;
  color: var(--ink, #f1f5f9) !important;
}

/* ── Food card images ── */
[data-theme="dark"] .food-card-img {
  background: #1c1917 !important;
}

/* ── Wish button hover/active ── */
[data-theme="dark"] .wish-btn:hover,
[data-theme="dark"] .wish-btn.active {
  background: rgba(236,72,153,.1) !important;
}

/* ── Service card (home.css) ── */
[data-theme="dark"] .service-card {
  background: rgba(30,41,59,.94) !important;
  color: var(--ink, #f1f5f9) !important;
}

/* ── Insight icons ── */
[data-theme="dark"] .insight-icon.green { background: rgba(52,211,153,.08) !important; }
[data-theme="dark"] .insight-icon.blue { background: rgba(96,165,250,.08) !important; }
[data-theme="dark"] .insight-icon.amber { background: rgba(251,191,36,.08) !important; }
[data-theme="dark"] .insight-icon.purple { background: rgba(167,139,250,.08) !important; }

/* ── Grocery section ── */
[data-theme="dark"] #grocerySection {
  background: linear-gradient(180deg, #0f172a 0%, #052e16 50%, #0f172a 100%) !important;
}

/* ── Food section ── */
[data-theme="dark"] #foodSection {
  background: linear-gradient(180deg, #0f172a 0%, #1c1917 50%, #0f172a 100%) !important;
}

/* ── Food card background (#fff7ed) ── */
[data-theme="dark"] [style*="background:#fff7ed"],
[data-theme="dark"] [style*="background: #fff7ed"] {
  background: #1c1917 !important;
}

/* ── Wish button hover pink (#fdf2f8) ── */
[data-theme="dark"] [style*="background:#fdf2f8"],
[data-theme="dark"] [style*="background: #fdf2f8"] {
  background: rgba(236,72,153,.1) !important;
}

/* ── Insight icon hardcoded backgrounds ── */
[data-theme="dark"] .insight-icon { background: rgba(255,255,255,.04) !important; }

/* ── Site footer (shared footer.css + home.css) ── */
[data-theme="dark"] .site-footer {
  background: #0f172a !important;
}
