/* 
   Ecoinme Design System
   RADICAL SOLUTION: Ultimate Force Overrides for Light & Dark Modes
*/

/* ===============================
   1. Light Mode - ZERO GRAY POLICY
   =============================== */
[data-bs-theme="light"] {
    --bs-body-bg: #ffffff !important;
    --bs-body-color: #000000 !important;
    --bs-tertiary-bg: #ffffff !important;
    --bs-secondary-bg: #f8f9fa !important;
    --bs-light-bg-subtle: #ffffff !important;
    --bs-dark-bg-subtle: #f8f9fa !important;
    
    --bs-secondary-color: #000000 !important;
    --bs-tertiary-color: #000000 !important;
    --bs-emphasis-color: #000000 !important;
    --bs-heading-color: #000000 !important;
    
    --bs-border-color: #000000 !important; /* High contrast border */
    --bs-light-border-subtle: #000000 !important;
    
    --bs-card-bg: #ffffff !important;
    --bs-card-color: #000000 !important;
    --bs-card-border-color: #000000 !important;
}

/* Force every single text element to be black in Light Mode (except primary/danger/success colors) */
[data-bs-theme="light"] body,
[data-bs-theme="light"] p,
[data-bs-theme="light"] h1,
[data-bs-theme="light"] h2,
[data-bs-theme="light"] h3,
[data-bs-theme="light"] h4,
[data-bs-theme="light"] h5,
[data-bs-theme="light"] h6,
[data-bs-theme="light"] span:not(.text-primary):not(.text-danger):not(.text-success):not(.badge),
[data-bs-theme="light"] div:not(.bg-primary):not(.bg-success):not(.bg-danger):not(.badge) > a:not(.btn) {
    color: #000000 !important;
}

/* Force all backgrounds to be pure white in Light Mode */
[data-bs-theme="light"] .bg-body,
[data-bs-theme="light"] .bg-body-tertiary,
[data-bs-theme="light"] .bg-light,
[data-bs-theme="light"] .bg-light-subtle,
[data-bs-theme="light"] .card,
[data-bs-theme="light"] section,
[data-bs-theme="light"] footer,
[data-bs-theme="light"] .accordion-item,
[data-bs-theme="light"] .form-control {
    background-color: #ffffff !important;
}

/* Kill all opacity utilities that make text gray */
[data-bs-theme="light"] .text-muted,
[data-bs-theme="light"] .text-body-secondary,
[data-bs-theme="light"] .opacity-75,
[data-bs-theme="light"] .opacity-50,
[data-bs-theme="light"] .text-white-50 {
    color: #000000 !important;
    opacity: 1 !important;
}

/* ===============================
   2. Dark Mode Variables
   =============================== */
[data-bs-theme="dark"] {
    --bs-body-bg: #0f1115 !important;
    --bs-body-color: #f8f9fa !important;
    --bs-tertiary-bg: #1a1d24 !important;
    --bs-secondary-bg: #1a1d24 !important;
    --bs-light-bg-subtle: #1a1d24 !important;
    
    --bs-secondary-color: #c0c0c0 !important;
    --bs-tertiary-color: #9ba1a6 !important;
    --bs-emphasis-color: #ffffff !important;
    --bs-heading-color: #ffffff !important;
    
    --bs-border-color: #2c3038 !important;
    --bs-card-bg: #1a1d24 !important;
    --bs-card-color: #f8f9fa !important;
    --bs-card-border-color: #2c3038 !important;
}

/* Force backgrounds in dark mode */
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-light-subtle {
    background-color: #1a1d24 !important;
}

/* ===============================
   3. Base Styles & Transitions
   =============================== */
body {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar-custom {
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}
[data-bs-theme="light"] .navbar-custom {
    background-color: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 2px solid #000000 !important;
}
[data-bs-theme="dark"] .navbar-custom {
    background-color: rgba(15, 17, 21, 0.95) !important;
    border-bottom: 1px solid #2c3038 !important;
}

/* Links Hover */
a { text-decoration: none; }
a:hover { color: var(--bs-primary) !important; }

/* Protected Colors */
.btn-primary, .btn-primary * { color: #ffffff !important; }
.badge.bg-primary { color: #ffffff !important; }
.badge.bg-danger { color: #ffffff !important; }
.badge.bg-success { color: #ffffff !important; }
.text-warning { color: #ffc107 !important; }
[data-bs-theme="light"] .badge.bg-dark { background-color: var(--bs-primary) !important; color: #ffffff !important; }

/* Glass effect */
[data-bs-theme="light"] .glass-effect { background-color: rgba(255, 255, 255, 0.95) !important; border: 1px solid #000; }
[data-bs-theme="dark"] .glass-effect { background-color: rgba(15, 17, 21, 0.85) !important; border: 1px solid #2c3038; }
