/* =========================================================
   THEME OVERRIDE (LOAD LAST)
   Makes light theme readable even if pages hardcode white text
   ========================================================= */

/* 0) Ensure light theme tokens are in effect */
html[data-theme="light"]{
  color-scheme: light;
}

/* 1) Nuclear fix: force readable text across typical content elements */
html[data-theme="light"] body :where(
  p, span, div, li, td, th, label, small, strong, em,
  h1, h2, h3, h4, h5, h6,
  a, button,
  .card, .card-body, .accordion, .accordion-button, .accordion-body,
  .glass-card, .info-card, .mini-card, .hero-panel,
  .news-card, .single-post, .dash-shell, .dash-topbar
){
  color: var(--text) !important;
}

/* 2) Muted text stays muted */
html[data-theme="light"] :where(.text-muted, .muted, .section-sub, .hero-sub, .note-sub){
  color: var(--muted) !important;
}

/* 3) Keep your gold links/buttons gold */
html[data-theme="light"] :where(.link-gold, .text-gold, .btn-outline-gold){
  color: var(--gold) !important;
}

/* 4) Don’t break gradient gold text */
html[data-theme="light"] .hero-gold{
  color: transparent !important;
}

/* 5) Fix bootstrap utility classes that often cause “white text” */
html[data-theme="light"] :where(.text-white, .text-light){
  color: var(--text) !important;
}

/* 6) Fix common dark backgrounds that make text look “missing” */
html[data-theme="light"] :where(.dropdown-glass, .nav-glass, .top-bar, .hero-panel, .glass-card, .info-card, .mini-card){
  background: var(--card) !important;
  border-color: var(--border) !important;
}

/* 7) Ticker price */
html[data-theme="light"] .coin .price{
  color: var(--text) !important;
}

/* 8) Popups / floating UI */
html[data-theme="light"] :where(.withdrawal-popup, .sound-toggle){
  background: rgba(255,255,255,.92) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow2) !important;
}
/* ================= LIGHT MODE ================= */
html[data-theme="light"] .table-glass{
  background: #ffffff !important;
  border-radius: 16px;
  overflow: hidden;
}

html[data-theme="light"] .table-head-glass th{
  background: #f8f9fa !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
}

html[data-theme="light"] .table-glass tbody td{
  color: var(--text) !important;
}

html[data-theme="light"] .table-glass td,
html[data-theme="light"] .table-glass th{
  border-top: 1px solid rgba(0,0,0,.06) !important;
}

html[data-theme="light"] .table-glass tbody tr:hover{
  background: rgba(0,0,0,.02) !important;
}


/* ================= DARK MODE ================= */
html[data-theme="dark"] .table-glass{
  background: rgba(20,20,22,.85) !important;
  border-radius: 16px;
  overflow: hidden;
}

html[data-theme="dark"] .table-head-glass th{
  background: rgba(35,35,40,.95) !important;
  color: rgba(246,242,232,.92) !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
}

html[data-theme="dark"] .table-glass tbody td{
  color: rgba(246,242,232,.85) !important;
  background: transparent !important;
}

html[data-theme="dark"] .table-glass td,
html[data-theme="dark"] .table-glass th{
  border-top: 1px solid rgba(255,255,255,.08) !important;
}

html[data-theme="dark"] .table-glass tbody tr:hover{
  background: rgba(255,255,255,.05) !important;
}


/* ================= TEXT SELECTION FIX ================= */
html[data-theme="dark"] ::selection{
  background: rgba(245,197,66,.35);
  color: rgba(246,242,232,.95);
}