/* ══════════════════════════════════════════════════════════════
   LIGHT THEME FIX — Global Admin + Frontend
   Loaded in admin/templates/footer.php or header.php
   Only activates when [data-theme="light"] is on <html>
   ══════════════════════════════════════════════════════════════ */

/* ── BASE ── */
[data-theme="light"] body { background: #ffffff !important; color: #1e293b !important; }
[data-theme="light"] .main-content,
[data-theme="light"] .content-area,
[data-theme="light"] .page-content { background: #ffffff !important; color: #1e293b !important; }

/* ── ADMIN CANVAS (clean white) ── */
[data-theme="light"] .admin-body,
[data-theme="light"] .admin-main,
[data-theme="light"] .admin-content { background: #ffffff !important; color: #1a1a2e !important; }
[data-theme="light"] .admin-topbar { background: #ffffff !important; border-bottom: 1px solid #eef1f5 !important; }

/* ── SIDEBAR ── */
[data-theme="light"] .sidebar,
[data-theme="light"] .admin-sidebar,
[data-theme="light"] nav.sidebar { background: #fff !important; border-right: 1px solid #e2e8f0 !important; color: #334155 !important; }
[data-theme="light"] .sidebar a,
[data-theme="light"] .admin-sidebar a { color: #475569 !important; }
[data-theme="light"] .sidebar a:hover,
[data-theme="light"] .admin-sidebar a:hover { background: #f1f5f9 !important; color: #6366f1 !important; }
[data-theme="light"] .sidebar a.active,
[data-theme="light"] .admin-sidebar a.active { background: rgba(99,102,241,.08) !important; color: #6366f1 !important; }
[data-theme="light"] .sidebar .section-title,
[data-theme="light"] .sidebar .menu-section-title { color: #94a3b8 !important; }

/* ── TOP HEADER BAR ── */
[data-theme="light"] .top-bar,
[data-theme="light"] .admin-header,
[data-theme="light"] header.top-bar { background: #fff !important; border-bottom: 1px solid #e2e8f0 !important; color: #1e293b !important; }
[data-theme="light"] .top-bar a,
[data-theme="light"] .admin-header a { color: #475569 !important; }

/* ── CARDS ── */
[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .panel,
[data-theme="light"] .widget { background: #fff !important; border-color: #e2e8f0 !important; color: #334155 !important; box-shadow: 0 1px 3px rgba(0,0,0,.04) !important; }

/* ── TABLES ── */
[data-theme="light"] table th { background: #f8fafc !important; color: #475569 !important; border-color: #e2e8f0 !important; }
[data-theme="light"] table td { color: #334155 !important; border-color: #f1f5f9 !important; }
[data-theme="light"] table tr:hover td { background: #f8fafc !important; }
[data-theme="light"] table { color: #334155 !important; }

/* ── FORMS ── */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="search"],
[data-theme="light"] input[type="url"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] textarea,
[data-theme="light"] select { background: #fff !important; color: #1e293b !important; border-color: #d1d5db !important; }
[data-theme="light"] input::placeholder { color: #9ca3b8 !important; }

/* ── DROPDOWNS / MENUS ── */
[data-theme="light"] .dropdown-menu,
[data-theme="light"] .menu-dropdown,
[data-theme="light"] .notification-dropdown { background: #fff !important; border-color: #e2e8f0 !important; box-shadow: 0 4px 16px rgba(0,0,0,.08) !important; }
[data-theme="light"] .dropdown-menu a,
[data-theme="light"] .dropdown-item { color: #334155 !important; }
[data-theme="light"] .dropdown-menu a:hover,
[data-theme="light"] .dropdown-item:hover { background: #f1f5f9 !important; }

/* ── MODALS ── */
[data-theme="light"] .modal-content,
[data-theme="light"] .modal-dialog .modal-body,
[data-theme="light"] [class*="modal"] > div { background: #fff !important; color: #1e293b !important; border-color: #e2e8f0 !important; }

/* ── BUTTONS ── */
[data-theme="light"] .btn-outline,
[data-theme="light"] .btn-secondary { color: #475569 !important; border-color: #d1d5db !important; background: #fff !important; }
[data-theme="light"] .btn-outline:hover { background: #f1f5f9 !important; }

/* ── BADGES / PILLS ── */
[data-theme="light"] .badge { color: inherit !important; }

/* ── TEXT OVERRIDES ── */
[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3,
[data-theme="light"] h4, [data-theme="light"] h5, [data-theme="light"] h6 { color: #1e293b !important; }
[data-theme="light"] p, [data-theme="light"] span, [data-theme="light"] div,
[data-theme="light"] li, [data-theme="light"] label { color: inherit; }
[data-theme="light"] a { color: #6366f1; }
[data-theme="light"] .text-muted, [data-theme="light"] .text-secondary { color: #64748b !important; }

/* ── CODE BLOCKS ── */
[data-theme="light"] code, [data-theme="light"] pre { background: #f1f5f9 !important; color: #334155 !important; }

/* ── SCROLLBAR ── */
[data-theme="light"] ::-webkit-scrollbar { background: #f1f5f9; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ── FOOTER ── */
[data-theme="light"] footer,
[data-theme="light"] .admin-footer { background: #fff !important; border-top: 1px solid #e2e8f0 !important; color: #64748b !important; }

/* ── TOASTS / NOTIFICATIONS ── */
[data-theme="light"] .toast, [data-theme="light"] .notification-item { color: #fff !important; }

/* ── SPECIFIC PLATFORM PAGES ── */

/* CVE / Threat Feed */
[data-theme="light"] .cve-card, [data-theme="light"] .threat-card { background: #fff !important; border-color: #e2e8f0 !important; color: #334155 !important; }
[data-theme="light"] .cve-card h3, [data-theme="light"] .threat-card h3 { color: #1e293b !important; }
[data-theme="light"] .cve-published, [data-theme="light"] .cve-score { color: #475569 !important; }

/* Darkweb Monitor */
[data-theme="light"] .darkweb-card, [data-theme="light"] .finding-card { background: #fff !important; border-color: #e2e8f0 !important; color: #334155 !important; }

/* Assessment */
[data-theme="light"] .assessment-card, [data-theme="light"] .domain-card { background: #fff !important; color: #334155 !important; }

/* Dashboard widgets */
[data-theme="light"] .dash-widget, [data-theme="light"] .chart-container { background: #fff !important; border-color: #e2e8f0 !important; }

/* Community / Messages */
[data-theme="light"] .message-bubble, [data-theme="light"] .post-card { background: #fff !important; color: #334155 !important; border-color: #e2e8f0 !important; }

/* Settings */
[data-theme="light"] .settings-section, [data-theme="light"] .config-panel { background: #fff !important; border-color: #e2e8f0 !important; }

/* Search overlay */
[data-theme="light"] .search-overlay { background: rgba(255,255,255,.95) !important; }
[data-theme="light"] .search-overlay input { background: #f8fafc !important; color: #1e293b !important; border-color: #e2e8f0 !important; }

/* Announcement cards */
[data-theme="light"] .announcement-card { background: #fff !important; border-color: #e2e8f0 !important; color: #334155 !important; }

/* Tab content areas */
[data-theme="light"] .tab-content, [data-theme="light"] .tab-pane { background: transparent !important; color: #334155 !important; }

/* Ensure no white-on-white text anywhere */
[data-theme="light"] [style*="color: #fff"],
[data-theme="light"] [style*="color:#fff"],
[data-theme="light"] [style*="color: white"],
[data-theme="light"] [style*="color:white"] { color: #1e293b !important; }

/* Exception: buttons with colored backgrounds keep white text */
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-success,
[data-theme="light"] .btn-danger,
[data-theme="light"] .btn-warning,
[data-theme="light"] [class*="btn-"][style*="background"] { color: #fff !important; }

/* footer-fix-v2 */
[data-theme="light"] footer,[data-theme="light"] .site-footer,[data-theme="light"] .footer-main{display:block!important;visibility:visible!important;color:rgba(255,255,255,0.7)!important;background:#0a0e14!important}
[data-theme="light"] .site-footer a,[data-theme="light"] footer a{color:rgba(255,255,255,0.8)!important}
[data-theme="light"] .site-footer h3,[data-theme="light"] .site-footer h4,[data-theme="light"] footer h3,[data-theme="light"] footer h4{color:#00ff88!important}

/* session-timeout-solid */
#session-timeout-overlay,[id*="session"][id*="timeout"],.session-timeout-modal,.session-expiring{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:rgba(0,0,0,.85)!important}

/* ══════════════════════════════════════════════════════════════
   build458 — darker, readable body text in LIGHT theme (global)
   Root cause: --text-muted was rgba(0,0,0,.5) and --text-secondary
   rgba(0,0,0,.65), both too faint on white. Loaded last → overrides.
   Only variables are changed, so accent/brand colors are untouched.
   ══════════════════════════════════════════════════════════════ */
[data-theme="light"]{
  --text-primary:#0f172a !important;
  --text-secondary:#1e293b !important;
  --text-muted:#475569 !important;
  --text-bold:#0f172a !important;
  --text:#1e293b !important;
  --text-dim:#475569 !important;
}
[data-theme="light"] .text-muted,
[data-theme="light"] .muted,
[data-theme="light"] small.muted,
[data-theme="light"] .hint,
[data-theme="light"] .help-text { color:#475569 !important; }

/* ══════════════════════════════════════════════════════════════
   INLINE HARDCODED-COLOUR SAFETY NET  (added Aug-2026)
   Many pages set subtle surfaces/borders with inline
   style="...rgba(255,255,255,.0X)..." which is invisible on white.
   These attribute-selectors remap the exact recurring patterns to a
   dark-alpha equivalent under the light theme, without touching any
   page individually. Brand/accent colours are never affected.
   ══════════════════════════════════════════════════════════════ */

/* Subtle surface backgrounds → faint grey on white */
[data-theme="light"] [style*="rgba(255,255,255,0.02)"],
[data-theme="light"] [style*="rgba(255,255,255,.02)"],
[data-theme="light"] [style*="rgba(255,255,255,0.03)"],
[data-theme="light"] [style*="rgba(255,255,255,.03)"],
[data-theme="light"] [style*="rgba(255,255,255,0.04)"],
[data-theme="light"] [style*="rgba(255,255,255,.04)"],
[data-theme="light"] [style*="rgba(255, 255, 255, 0.03)"],
[data-theme="light"] [style*="rgba(255, 255, 255, 0.04)"]{
  background-color:rgba(15,23,42,.03) !important;
}

/* Slightly stronger surfaces/borders */
[data-theme="light"] [style*="rgba(255,255,255,0.05)"],
[data-theme="light"] [style*="rgba(255,255,255,.05)"],
[data-theme="light"] [style*="rgba(255,255,255,0.06)"],
[data-theme="light"] [style*="rgba(255,255,255,.06)"],
[data-theme="light"] [style*="rgba(255,255,255,0.07)"],
[data-theme="light"] [style*="rgba(255,255,255,.07)"],
[data-theme="light"] [style*="rgba(255,255,255,0.08)"],
[data-theme="light"] [style*="rgba(255,255,255,.08)"],
[data-theme="light"] [style*="rgba(255, 255, 255, 0.06)"],
[data-theme="light"] [style*="rgba(255, 255, 255, 0.08)"]{
  border-color:rgba(15,23,42,.12) !important;
}

/* Elements that use the faint white as a BACKGROUND specifically
   (borders handled above; this catches card-like inline surfaces) */
[data-theme="light"] [style*="background:rgba(255,255,255,0.05)"],
[data-theme="light"] [style*="background:rgba(255,255,255,.05)"],
[data-theme="light"] [style*="background:rgba(255,255,255,0.06)"],
[data-theme="light"] [style*="background:rgba(255,255,255,.06)"],
[data-theme="light"] [style*="background: rgba(255,255,255,0.06)"]{
  background-color:rgba(15,23,42,.04) !important;
}

/* Pure-white inline text on (formerly dark) surfaces → dark ink.
   Excludes buttons/badges/pills/gradients where white text is intentional
   (they keep their own coloured background in both themes). */
[data-theme="light"] [style*="color:#fff"]:not(button):not(.btn):not([class*="badge"]):not([class*="pill"]):not([class*="btn"]):not([style*="gradient"]):not([style*="background:#0"]):not([style*="background:#00"]),
[data-theme="light"] [style*="color:#ffffff"]:not(button):not(.btn):not([class*="badge"]):not([class*="pill"]):not([class*="btn"]):not([style*="gradient"]),
[data-theme="light"] [style*="color: #fff"]:not(button):not(.btn):not([class*="badge"]):not([class*="pill"]):not([class*="btn"]):not([style*="gradient"]){
  color:#0f172a !important;
}
