/* ===========================================================
   VallasLed · Tema claro (por defecto: oscuro)
   Se activa con <html data-theme="light">
   =========================================================== */

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-soft: #ffffff;
  --text: #0f172a;
  --muted: #526076;
  --border: #dde5ef;
  --wave-color: rgba(15, 23, 42, .05);
}

html[data-theme="light"] body {
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* Transición suave al cambiar de tema */
body, .card, #app-footer, header, .vl-sel-bar, #vlVersionBar {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

/* ---------- Utilidades del sitio (calendario, blog, fichas…) ---------- */
html[data-theme="light"] .text-white,
html[data-theme="light"] .text-slate-100,
html[data-theme="light"] .text-slate-200 { color: #0f172a !important; }
html[data-theme="light"] .text-slate-300 { color: #334155 !important; }
html[data-theme="light"] .text-slate-400 { color: #5b6b80 !important; }
html[data-theme="light"] .text-slate-500 { color: #64748b !important; }
html[data-theme="light"] .text-gray-400 { color: #64748b !important; }
html[data-theme="light"] .text-gray-300 { color: #334155 !important; }

html[data-theme="light"] .bg-slate-950,
html[data-theme="light"] .bg-slate-900 { background: #ffffff !important; }
html[data-theme="light"] .bg-slate-900\/50,
html[data-theme="light"] .bg-slate-900\/60,
html[data-theme="light"] .bg-slate-900\/70,
html[data-theme="light"] .bg-slate-900\/80 { background: rgba(255, 255, 255, .78) !important; }

html[data-theme="light"] .bg-slate-800 { background: #f1f5f9 !important; }
html[data-theme="light"] .bg-slate-800\/40,
html[data-theme="light"] .bg-slate-800\/50,
html[data-theme="light"] .bg-slate-800\/60,
html[data-theme="light"] .bg-slate-800\/70 { background: rgba(241, 245, 249, .75) !important; }

html[data-theme="light"] .bg-slate-700,
html[data-theme="light"] .bg-slate-600 { background: #e2e8f0 !important; }

html[data-theme="light"] .border-slate-800,
html[data-theme="light"] .border-slate-700,
html[data-theme="light"] .border-slate-600 { border-color: #d8e0ea !important; }

html[data-theme="light"] .divide-slate-700 > :not([hidden]) ~ :not([hidden]) { border-color: #e2e8f0 !important; }

/* Formularios */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #94a3b8 !important; }

/* Tarjetas */
html[data-theme="light"] .card {
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .07);
}

/* ---------- Widgets del sitio ---------- */
html[data-theme="light"] .vl-sel-bar {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #d8e0ea !important;
}
html[data-theme="light"] .vl-sel-btn-ghost {
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}
html[data-theme="light"] .vl-sel-panel {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #d8e0ea !important;
}

html[data-theme="light"] #vlVersionBar {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
}
html[data-theme="light"] #vlVersionBar .vlvb-text b { color: #0f172a; }

/* ---------- Botón de tema (la luna) ---------- */
#vlThemeBtn {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 100600;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, .35);
  background: rgba(15, 23, 42, .55);
  color: #e2e8f0;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
  transition: transform .18s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}
#vlThemeBtn:hover { transform: translateY(-2px) scale(1.03); border-color: rgba(56, 189, 248, .6); }
#vlThemeBtn:active { transform: scale(.96); }
#vlThemeBtn svg { width: 21px; height: 21px; display: block; }

html[data-theme="light"] #vlThemeBtn {
  background: #ffffff;
  color: #0f172a;
  border-color: #d8e0ea;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .16);
}

@media (max-width: 520px) {
  #vlThemeBtn { left: 12px; bottom: 12px; width: 40px; height: 40px; }
}
@media print { #vlThemeBtn { display: none !important; } }

/* ===== Catálogo: app.override.css fuerza tarjetas oscuras (#catalogo .card !important) ===== */
html[data-theme="light"] #catalogo .card {
  background: #ffffff !important;
  border-color: #dde5ef !important;
  color: #0f172a !important;
}
html[data-theme="light"] #catalogo .border { border-color: #dde5ef !important; }
html[data-theme="light"] #catalogo label { color: #475569 !important; }
html[data-theme="light"] #catalogo input[type=text],
html[data-theme="light"] #catalogo input[type=search],
html[data-theme="light"] #catalogo select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] #catalogo .card-content h3,
html[data-theme="light"] #catalogo .card-content .card-title { color: #0f172a !important; }

/* Aviso de versión y barra de selección legibles en claro */
html[data-theme="light"] #vlVersionBar,
html[data-theme="light"] #vlVersionBar .vlvb-text { color: #0f172a !important; }
html[data-theme="light"] .vl-sel-bar .vl-sel-count,
html[data-theme="light"] .vl-sel-bar .vl-sel-count span { color: #0f172a !important; }
html[data-theme="light"] .vl-sel-chip { background:#f1f5f9 !important; color:#0f172a !important; border-color:#d8e0ea !important; }
/* ===== Destacadas y controles del catálogo en claro ===== */
html[data-theme="light"] .featured-row .card { background:#ffffff !important; color:#0f172a !important; border-color:#dde5ef !important; }
html[data-theme="light"] .page-size { background:#ffffff !important; color:#0f172a !important; border-color:#cbd5e1 !important; }
html[data-theme="light"] #toast { background:#0f172a; color:#fff; }
/* ===== Botones outline y detalles en tema claro ===== */
html[data-theme="light"] .btn-outline {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .btn-outline:hover { background: #f1f5f9 !important; border-color: #94a3b8 !important; }

/* La luna por encima del launcher de la guía (que va abajo a la izquierda) */
@media (min-width: 521px) {
  #vlThemeBtn { bottom: 84px !important; left: 14px !important; }
}
@media (max-width: 520px) {
  #vlThemeBtn { bottom: 76px !important; left: 12px !important; }
}
/* ===== Franjas oscuras inline del calendario/blog y grises intermedios ===== */
html[data-theme="light"] [style*="#0b1220"],
html[data-theme="light"] [style*="#0B1220"] {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="light"] .bg-slate-700\/40,
html[data-theme="light"] .bg-slate-700\/50,
html[data-theme="light"] .bg-slate-700\/60,
html[data-theme="light"] .bg-slate-700\/70,
html[data-theme="light"] .bg-slate-700\/80 { background: rgba(226, 232, 240, .7) !important; }
html[data-theme="light"] .bg-slate-600 { background: #cbd5e1 !important; }
html[data-theme="light"] .bg-slate-500 { background: #e2e8f0 !important; }
/* ===== Cabeceras de página (calendario, blog, fichas) en claro ===== */
html[data-theme="light"] header {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #dde5ef !important;
}
html[data-theme="light"] .bg-slate-800\/80 { background: rgba(241, 245, 249, .85) !important; }
/* Enlaces legibles en claro (el footer define --link casi blanco) */
html[data-theme="light"] { --link: #1d4ed8; }
/* ===== Tarjetas del catálogo: datos más legibles y en negrita (tema claro) ===== */
html[data-theme="light"] .card .card-content > div[style*="grid-template-columns"] {
  color: #334155 !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .card .card-content > div[style*="grid-template-columns"] * {
  color: #334155 !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .card .card-content > p.text-gray-400 {
  color: #475569 !important;
  font-weight: 600 !important;
}
html[data-theme="light"] .card .card-content span[style*="border:1px solid #334155"] {
  color: #334155 !important;
  border-color: #cbd5e1 !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .card .card-content .text-green-400 { color: #047857 !important; }
html[data-theme="light"] .card .card-content .text-red-400 { color: #b91c1c !important; }

/* En oscuro, un pelín más de contraste para esos mismos datos */
.card .card-content > div[style*="grid-template-columns"] { font-weight: 600; }
/* ===== Footer: oscuro como en modo oscuro, letras blancas (también en tema claro) ===== */
html[data-theme="light"] #app-footer {
  background: #0b1220 !important;
  color: #f8fafc !important;
  border-top: 1px solid #1f2a3a !important;
}
html[data-theme="light"] #app-footer .chip {
  background: rgba(255, 255, 255, .06) !important;
  border-color: rgba(148, 163, 184, .35) !important;
  color: #f8fafc !important;
}
html[data-theme="light"] #app-footer .f-acc-btn { color: #f8fafc !important; }
html[data-theme="light"] #app-footer .btn-reseller-login {
  color: #dbeafe !important;
  background: linear-gradient(135deg, rgba(37, 99, 235, .22), rgba(34, 197, 94, .18)) !important;
  border-color: rgba(96, 165, 250, .35) !important;
}
html[data-theme="light"] #app-footer .btn-wa { color: #052e16 !important; }
html[data-theme="light"] #app-footer a:not(.btn-wa) { color: #e2e8f0 !important; }
html[data-theme="light"] #app-footer a:not(.btn-wa):hover { color: #93c5fd !important; }
html[data-theme="light"] #app-footer .text-white { color: #ffffff !important; }
html[data-theme="light"] #app-footer .text-slate-100,
html[data-theme="light"] #app-footer .text-slate-200 { color: #f1f5f9 !important; }
html[data-theme="light"] #app-footer .text-slate-300 { color: #e2e8f0 !important; }
html[data-theme="light"] #app-footer .text-slate-400,
html[data-theme="light"] #app-footer .text-slate-500 { color: #cbd5e1 !important; }
html[data-theme="light"] #app-footer #footer-bottom,
html[data-theme="light"] #app-footer .footer-legal { border-color: #1f2a3a !important; }
/* ===== Footer: letras blancas en ambos temas (enlaces incluidos) ===== */
#app-footer a:not(.btn-wa) { color: #e2e8f0 !important; }
#app-footer a:not(.btn-wa):hover { color: #93c5fd !important; }
#app-footer .f-acc-btn { color: #f8fafc !important; }
/* ===== Tema claro: navegación del header y botones legibles ===== */
html[data-theme="light"] .nav-desktop a { color: #0f172a !important; }
html[data-theme="light"] .nav-desktop a:hover { color: var(--color-primary, #2563eb) !important; }
html[data-theme="light"] .mobile-toggle { color: #0f172a !important; }
html[data-theme="light"] .mm-link { color: #0f172a !important; }
html[data-theme="light"] .btn-mobile-login { color: #0f172a !important; border-color: #cbd5e1 !important; }

/* Botones con fondo oscuro: letra blanca también en claro */
html[data-theme="light"] .btn-accent {
  background: #334155 !important;
  color: #ffffff !important;
}
html[data-theme="light"] .btn-accent svg { color: #ffffff !important; stroke: currentColor !important; }
html[data-theme="light"] .btn-accent:hover { background: #3b465a !important; color: #ffffff !important; }

/* Cualquier botón con fondo "accent" oscuro mantiene texto blanco */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-danger,
html[data-theme="light"] .btn-hero { color: #ffffff !important; }