
/* Coalition Theme Toggle
   Existing site styles remain the default dark theme.
   Light theme uses blue/research colors and activates with:
   <html data-theme="light">
*/

:root{
  --theme-toggle-bg:#11151b;
  --theme-toggle-line:rgba(210,170,69,.35);
  --theme-toggle-text:#f3f0e8;
  --theme-toggle-accent:#d2aa45;
}

/* Light research theme */
html[data-theme="light"]{
  --bg:#eef5fb;
  --panel:#ffffff;
  --panel2:#f4f8fc;
  --line:rgba(20,65,105,.16);
  --gold:#2f80c2;
  --text:#162433;
  --muted:#5f7184;

  --theme-toggle-bg:#ffffff;
  --theme-toggle-line:rgba(47,128,194,.32);
  --theme-toggle-text:#162433;
  --theme-toggle-accent:#2f80c2;
}

html[data-theme="light"] body{
  background:
    linear-gradient(rgba(239,246,252,.92),rgba(239,246,252,.96)),
    radial-gradient(circle at 20% 10%,rgba(47,128,194,.18),transparent 34%),
    radial-gradient(circle at 80% 20%,rgba(75,168,220,.14),transparent 30%),
    #eef5fb !important;
  color:var(--text) !important;
}

html[data-theme="light"] .site-header,
html[data-theme="light"] .topbar,
html[data-theme="light"] .coalition-topbar{
  background:rgba(255,255,255,.94) !important;
  border-bottom:1px solid rgba(47,128,194,.18) !important;
  box-shadow:0 8px 28px rgba(29,68,105,.08);
}

html[data-theme="light"] .site-title span,
html[data-theme="light"] .brand-title,
html[data-theme="light"] .coalition-brand-text strong,
html[data-theme="light"] .account-name,
html[data-theme="light"] .nav a,
html[data-theme="light"] .coalition-main-nav a,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3{
  color:#162433 !important;
}

html[data-theme="light"] .site-title small,
html[data-theme="light"] .brand-sub,
html[data-theme="light"] .coalition-brand-text small,
html[data-theme="light"] .gold,
html[data-theme="light"] .nav a.active,
html[data-theme="light"] .coalition-main-nav a:hover{
  color:#2f80c2 !important;
}

html[data-theme="light"] .panel,
html[data-theme="light"] .filter-card,
html[data-theme="light"] .store-card,
html[data-theme="light"] .admin-card,
html[data-theme="light"] .cart-summary,
html[data-theme="light"] .left-rail,
html[data-theme="light"] .right-rail,
html[data-theme="light"] .forum-row,
html[data-theme="light"] .card,
html[data-theme="light"] .cipher-box,
html[data-theme="light"] .account-dropdown{
  background:
    linear-gradient(180deg,rgba(255,255,255,.96),rgba(245,250,255,.96)) !important;
  border-color:rgba(47,128,194,.18) !important;
  color:#162433 !important;
  box-shadow:0 12px 34px rgba(29,68,105,.08);
}

html[data-theme="light"] .hero{
  background:
    linear-gradient(90deg,rgba(238,246,252,.92),rgba(255,255,255,.78)),
    radial-gradient(circle at 75% 20%,rgba(47,128,194,.18),transparent 32%) !important;
  border-bottom:1px solid rgba(47,128,194,.16) !important;
}

html[data-theme="light"] .product-card{
  background:linear-gradient(180deg,#ffffff,#f4f8fc) !important;
  border-color:rgba(47,128,194,.18) !important;
  color:#162433 !important;
}

html[data-theme="light"] .product-img{
  background:radial-gradient(circle at center,#dbeaf5,#ffffff) !important;
}

html[data-theme="light"] .muted,
html[data-theme="light"] .micro,
html[data-theme="light"] .crumb,
html[data-theme="light"] .benefit span{
  color:#5f7184 !important;
}

html[data-theme="light"] a{
  color:#205f94;
}

html[data-theme="light"] .btn,
html[data-theme="light"] button{
  border-color:rgba(47,128,194,.28) !important;
}

html[data-theme="light"] .btn.gold,
html[data-theme="light"] .badge,
html[data-theme="light"] .mini-badge,
html[data-theme="light"] .dropdown-badge{
  background:linear-gradient(#4ba8dc,#2f80c2) !important;
  color:#ffffff !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .select,
html[data-theme="light"] .search{
  background:#ffffff !important;
  color:#162433 !important;
  border-color:rgba(47,128,194,.25) !important;
}

html[data-theme="light"] .account-dropdown a{
  color:#162433 !important;
}

html[data-theme="light"] .account-dropdown a:hover,
html[data-theme="light"] .account-dropdown a.active{
  color:#2f80c2 !important;
  background:rgba(47,128,194,.10) !important;
}

html[data-theme="light"] .user-avatar-wrap{
  border-color:rgba(47,128,194,.85) !important;
  background:#ffffff !important;
}

html[data-theme="light"] .user-avatar-fallback{
  background:linear-gradient(135deg,#dceefb,#ffffff) !important;
  color:#2f80c2 !important;
}

html[data-theme="light"] table th{
  background:#e6f1fa !important;
  color:#162433 !important;
}

html[data-theme="light"] table td{
  border-bottom-color:rgba(47,128,194,.14) !important;
}

/* Toggle control */
.theme-toggle{
  height:38px;
  min-width:38px;
  padding:0 12px;
  border:1px solid var(--theme-toggle-line);
  border-radius:999px;
  background:var(--theme-toggle-bg);
  color:var(--theme-toggle-text);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  font-weight:800;
  font-size:13px;
  line-height:1;
  box-shadow:0 8px 20px rgba(0,0,0,.10);
}

.theme-toggle:hover{
  border-color:var(--theme-toggle-accent);
  color:var(--theme-toggle-accent);
}

.theme-toggle-icon{
  font-size:16px;
}

.theme-toggle-text{
  display:inline-block;
}

@media(max-width:800px){
  .theme-toggle{
    width:36px;
    height:36px;
    min-width:36px;
    padding:0;
  }

  .theme-toggle-text{
    display:none;
  }
}


/* v44 move theme toggle to settings page */
.profile-settings{
  border:1px solid var(--line);
  background:rgba(4,10,12,.52);
  padding:18px;
  margin:10px 0 4px;
}
.profile-settings h2{
  margin:0 0 14px;
  font-family:Cinzel,serif;
  color:var(--gold2);
  letter-spacing:.18em;
  text-transform:uppercase;
  font-size:18px;
}
.settings-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.settings-row strong{
  color:var(--gold);
  letter-spacing:.12em;
  text-transform:uppercase;
}
.settings-row .muted{
  margin:6px 0 0;
  max-width:520px;
}
.settings-theme-toggle{
  flex:0 0 auto;
}
@media(max-width:720px){
  .settings-row{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* v45 functional theme toggle repair
   Loaded globally after assets/style.css so light mode can override late dark baseline rules. */
html[data-theme="light"] .page-shell{
  background:linear-gradient(180deg,rgba(239,246,252,.96),rgba(239,246,252,.99)) !important;
}
html[data-theme="light"] .panel,
html[data-theme="light"] .card,
html[data-theme="light"] .profile-card,
html[data-theme="light"] .profile-settings,
html[data-theme="light"] .forum-table,
html[data-theme="light"] .left-rail,
html[data-theme="light"] .right-rail .panel,
html[data-theme="light"] .coalition-chat{
  background:#ffffff !important;
  color:#162433 !important;
  border-color:rgba(47,128,194,.22) !important;
  box-shadow:0 10px 34px rgba(29,68,105,.08) !important;
}
html[data-theme="light"] .profile-settings{
  background:#f4f8fc !important;
}
html[data-theme="light"] .footer{
  background:transparent !important;
}

