/* =========================================================
   KESEF Light Theme
   Activated via <html data-theme="light">, toggled by js/theme.js.
   Redefines the same custom properties modern.css/admin.css already
   use everywhere, plus explicit fixes for the handful of rules that
   use hardcoded colors instead of a variable (nav/topbar backgrounds,
   glass-tinted form inputs, status badges, gold-as-text contrast).
   ========================================================= */

:root[data-theme="light"] {
  --dark-base:     #f7f4ee;
  --dark-surface:  #ffffff;
  --dark-card:     #ffffff;
  --dark-card2:    #f3efe6;
  --glass:         rgba(26, 26, 46, 0.035);
  --glass-hover:   rgba(26, 26, 46, 0.06);
  --glass-border:  rgba(26, 26, 46, 0.10);
  --gold:          #96700f;
  --gold-light:    #b8882f;
  --gold-dark:     #74560c;
  --gold-glow:     rgba(150, 112, 15, 0.18);
  --text-hi:       #1a1a2e;
  --text-mid:      rgba(26, 26, 46, 0.72);
  --text-lo:       rgba(26, 26, 46, 0.48);
  --shadow-card:   0 8px 30px rgba(20, 20, 30, .08);
  --shadow-hover:  0 16px 46px rgba(20, 20, 30, .14);
}

/* ===== Hardcoded backgrounds that bypass the variables above ===== */
[data-theme="light"] .container-fluid.bg-dark:first-of-type {
  background: rgba(255, 255, 255, .95) !important;
  border-bottom: 1px solid var(--glass-border);
}

[data-theme="light"] .kesef-topbar {
  background: rgba(255, 255, 255, .92) !important;
  border-bottom: 1px solid rgba(150, 112, 15, .15);
}

[data-theme="light"] .nav-bar {
  background: rgba(255, 255, 255, .95) !important;
  border-bottom: 1px solid rgba(150, 112, 15, .18);
  box-shadow: 0 6px 30px rgba(20, 20, 30, .08);
}

/* Footer background already flips via --dark-surface/--dark-base, but its
   links use Bootstrap's hardcoded .text-white utility, which doesn't. */
[data-theme="light"] .container-fluid.bg-dark.text-white a.text-white,
[data-theme="light"] .container-fluid.bg-dark.text-white p.text-white {
  color: var(--text-hi) !important;
}

[data-theme="light"] .container-fluid.bg-dark.text-white a.text-white:hover {
  color: var(--gold) !important;
}

[data-theme="light"] .container-fluid.bg-dark.text-white .btn-outline-light {
  border-color: rgba(26, 26, 46, .25) !important;
  color: var(--text-hi) !important;
}

[data-theme="light"] .container-fluid.bg-dark.text-white .btn-outline-light:hover {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #fff !important;
}

[data-theme="light"] .container-fluid.bg-dark.text-white .border-top.border-secondary {
  border-color: rgba(26, 26, 46, .12) !important;
}

[data-theme="light"] .dropdown-menu {
  background: rgba(255, 255, 255, .98) !important;
  border: 1px solid rgba(150, 112, 15, .15) !important;
  box-shadow: 0 16px 50px rgba(20, 20, 30, .14) !important;
}

[data-theme="light"] .kesef-admin-nav {
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid rgba(150, 112, 15, .2);
}

/* Glass-tinted form inputs: white-on-white is invisible once cards
   turn light, so flip the tint to a faint dark wash instead. */
[data-theme="light"] .glass-card .form-control,
[data-theme="light"] .glass-card select.form-control {
  background: rgba(26, 26, 46, .035) !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--text-hi) !important;
}

[data-theme="light"] .glass-card .form-control:focus {
  background: rgba(26, 26, 46, .06) !important;
}

[data-theme="light"] .kesef-toggle-option {
  background: rgba(26, 26, 46, .035);
}

[data-theme="light"] .kesef-logout-btn {
  border: 1px solid rgba(26, 26, 46, .18);
}

/* Gallery page hero banner: hardcoded dark gradient + a white-to-gold
   text-clip heading, defined in gallery.php's own inline <style>. */
[data-theme="light"] .gallery-hero {
  background: linear-gradient(135deg, #fdfbf7 0%, #f3efe6 100%) !important;
}

[data-theme="light"] .gallery-hero h1 {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  color: var(--text-hi) !important;
}

/* Status badges: bright colors tuned for dark cards read poorly on
   white — use darker, more saturated variants for light mode. */
[data-theme="light"] .kesef-member-status.status-PENDING  { background: rgba(180, 130, 6, .12);  color: #b48206; }
[data-theme="light"] .kesef-member-status.status-ACTIVE   { background: rgba(21, 128, 61, .12);  color: #15803d; }
[data-theme="light"] .kesef-member-status.status-INACTIVE { background: rgba(26, 26, 46, .08);   color: var(--text-lo); }
[data-theme="light"] .kesef-member-status.status-EXPIRED  { background: rgba(194, 97, 10, .12);  color: #c2610a; }
[data-theme="light"] .kesef-member-status.status-DECEASED { background: rgba(71, 85, 105, .12);  color: #475569; }

/* Pending-approval tab + approve button: bright colors tuned for dark
   cards read poorly on white. */
[data-theme="light"] .kesef-tab-pending:not(.active) {
  border-color: rgba(180, 130, 6, .3);
  color: #b48206;
}

[data-theme="light"] .kesef-tab-pending:not(.active) .kesef-tab-badge {
  background: rgba(180, 130, 6, .15);
  color: #b48206;
}

[data-theme="light"] .kesef-approve-btn {
  background: rgba(21, 128, 61, .1);
  border-color: rgba(21, 128, 61, .3);
  color: #15803d;
}

[data-theme="light"] .kesef-approve-btn:hover {
  background: rgba(21, 128, 61, .18);
  color: #15803d;
}

/* "View" action button: light blue tuned for dark cards fails contrast
   on a white card. */
[data-theme="light"] .kesef-member-actions .view-btn {
  color: #2952a3;
  background: rgba(41, 82, 163, .08);
  border: 1px solid rgba(41, 82, 163, .25);
}

[data-theme="light"] .kesef-member-actions .view-btn:hover {
  background: rgba(41, 82, 163, .16);
}

/* Empty profile-photo placeholder: hardcoded dark gradient reads oddly
   floating in a now-light card. */
[data-theme="light"] .kesef-avatar {
  background: linear-gradient(145deg, #efece3, #e2ddd0);
}

[data-theme="light"] .kesef-avatar i {
  color: rgba(26, 26, 46, .35);
}

/* Auth card (login) is already a light card by design — keep it, just
   soften the page-level glow orbs behind it so they don't look muddy
   against a now-light backdrop. */
[data-theme="light"] .glow-orb {
  opacity: .18;
}

/* Scrollbar track should match the light page, not the dark default. */
[data-theme="light"] ::-webkit-scrollbar-track {
  background: var(--dark-base);
}

/* ===== Theme toggle button ===== */
.kesef-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  border: 1.5px solid var(--gold);
  border-radius: 50px;
  background: transparent;
  color: var(--gold);
  font-size: 12px;
  cursor: pointer;
  padding: 0 12px;
  transition: background .2s, color .2s;
  white-space: nowrap;
}

.kesef-theme-toggle-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.kesef-theme-toggle:hover {
  background: var(--gold);
  color: #1a1000;
}
