/* Light mode overrides - activated by data-theme="light" on <html> */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-border: rgba(0,0,0,0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: rgba(0,0,0,0.06);
}

[data-theme="light"] body {
  background: var(--bg-primary, #ffffff) !important;
  color: var(--text-primary, #0f172a) !important;
}

[data-theme="light"] nav,
[data-theme="light"] header {
  background: rgba(255,255,255,0.9) !important;
  backdrop-filter: blur(12px) !important;
  border-bottom-color: rgba(0,0,0,0.06) !important;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] [class*="font-bold"],
[data-theme="light"] [class*="text-white"],
[data-theme="light"] summary h3 {
  color: #0f172a !important;
}

[data-theme="light"] p,
[data-theme="light"] [class*="text-gray-300"],
[data-theme="light"] [class*="text-gray-400"] {
  color: #475569 !important;
}

[data-theme="light"] [class*="text-gray-500"],
[data-theme="light"] [class*="text-gray-600"] {
  color: #64748b !important;
}

/* Cards */
[data-theme="light"] [class*="bg-[#111"],
[data-theme="light"] [style*="background:#111"],
[data-theme="light"] [class*="bg-[#0d0d0d]"],
[data-theme="light"] article[class*="bg-"] {
  background: #ffffff !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

/* Sections with dark bg */
[data-theme="light"] section[class*="bg-[#0d0d0d]"] {
  background: #f8fafc !important;
}

/* Table */
[data-theme="light"] table {
  border-color: rgba(0,0,0,0.06) !important;
}
[data-theme="light"] th {
  background: #f1f5f9 !important;
  color: #334155 !important;
}
[data-theme="light"] td {
  color: #475569 !important;
}
[data-theme="light"] tr:hover {
  background: #f8fafc !important;
}

/* Footer */
[data-theme="light"] footer {
  border-top-color: rgba(0,0,0,0.06) !important;
  background: #f8fafc !important;
}

/* Inputs */
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: #f8fafc !important;
  border-color: rgba(0,0,0,0.15) !important;
  color: #0f172a !important;
}

/* Details/FAQ */
[data-theme="light"] details {
  background: #ffffff !important;
  border-color: rgba(0,0,0,0.08) !important;
}

/* Inline styled elements */
[data-theme="light"] [style*="background:#111"],
[data-theme="light"] [style*="background: #111"] {
  background: #ffffff !important;
}
[data-theme="light"] [style*="color:#fff"],
[data-theme="light"] [style*="color: #fff"],
[data-theme="light"] [style*="color:white"] {
  color: #0f172a !important;
}
[data-theme="light"] [style*="color:#6b7280"] {
  color: #64748b !important;
}
[data-theme="light"] [style*="color:#9ca3af"] {
  color: #64748b !important;
}
[data-theme="light"] [style*="color:#d1d5db"] {
  color: #475569 !important;
}
[data-theme="light"] [style*="color:#e5e7eb"] {
  color: #334155 !important;
}
[data-theme="light"] [style*="border:1px solid rgba(255,255,255"] {
  border-color: rgba(0,0,0,0.08) !important;
}
[data-theme="light"] [style*="border-bottom:1px solid rgba(255,255,255"] {
  border-bottom-color: rgba(0,0,0,0.06) !important;
}

/* Keep gradient text & buttons visible */
[data-theme="light"] .gradient-text,
[data-theme="light"] [class*="gradient-text"] {
  background: linear-gradient(135deg,#2563eb,#7c3aed) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
[data-theme="light"] .gradient-btn,
[data-theme="light"] [class*="gradient-btn"] {
  background: linear-gradient(135deg,#2563eb,#7c3aed) !important;
  color: #fff !important;
}

/* Green check stays green */
[data-theme="light"] [class*="text-green-400"],
[data-theme="light"] [style*="color:#22c55e"] {
  color: #16a34a !important;
}

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.3s;
}
[data-theme="light"] .theme-toggle {
  border-color: rgba(0,0,0,0.1);
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.1);
}
[data-theme="light"] .theme-toggle:hover {
  background: rgba(0,0,0,0.05);
}

/* Smooth transition */
body, nav, header, section, footer, article, div, h1, h2, h3, p, a, span, td, th, input, textarea, select, details, summary {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}
