/* ============================================================
   THEME TOGGLE - Modo Claro / Oscuro
   UAP Analysis System - añadido 2026-10-17
   ============================================================ */

html, body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== MODO CLARO: override de variables CSS compartidas ===== */
html[data-theme="light"] {
  --background: #f4f6fb;
  --bg: #f4f6fb;
  --bg-light: #f4f6fb;
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #5a6472;
  --border: #d8dce3;
  --dark: #f4f6fb;
  --light: #1a1a2e;
  --neon-glow: rgba(0, 150, 200, 0.25);
}

/* ===== MODO CLARO: index.html (fondo hardcodeado, sin variable) ===== */
html[data-theme="light"] body {
  color: #1a1a2e;
  background: linear-gradient(180deg, #eef2fb 0%, #ffffff 55%, #f4f6fb 100%);
}

/* ===== MODO CLARO: login.html / register.html (glass card cyan sobre negro) ===== */
html[data-theme="light"] .login-container,
html[data-theme="light"] .register-container {
  background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(240,248,255,0.98) 50%, rgba(255,255,255,0.97) 100%) !important;
  border-color: rgba(0, 140, 190, 0.45) !important;
  box-shadow: 0 0 40px rgba(0, 140, 190, 0.15), 0 20px 60px rgba(20, 30, 60, 0.12) !important;
}
html[data-theme="light"] .form-control {
  background: rgba(255,255,255,0.95) !important;
  color: #1a1a2e !important;
  border-color: rgba(0, 140, 190, 0.35) !important;
}
html[data-theme="light"] .form-control::placeholder { color: #8891a0 !important; }
html[data-theme="light"] .logo h1,
html[data-theme="light"] .form-label,
html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3,
html[data-theme="light"] h4, html[data-theme="light"] h5, html[data-theme="light"] h6 {
  color: #1a1a2e;
}
html[data-theme="light"] .form-label { color: #3a4454 !important; }
html[data-theme="light"] p, html[data-theme="light"] span, html[data-theme="light"] li {
  color: inherit;
}

/* ===== MODO CLARO: pricing.html tarjetas de plan ===== */
html[data-theme="light"] .plan-card {
  background: rgba(255,255,255,0.97) !important;
  color: #1a1a2e;
}

/* ===== MODO CLARO: tarjetas/contenedores genericos (dashboard, subir-analisis, mis-reportes, biblioteca, notifications) ===== */
/* !important necesario: varias tarjetas usan estilos inline con fondos oscuros hardcodeados */
html[data-theme="light"] .card,
html[data-theme="light"] .container-card,
html[data-theme="light"] .welcome-card {
  background: var(--card-bg) !important;
  color: var(--text-primary);
}
html[data-theme="light"] .card *,
html[data-theme="light"] .welcome-card * {
  color: inherit;
}

/* ===== MODO CLARO: texto blanco hardcodeado via inline style (muy comun en este codebase) ===== */
html[data-theme="light"] [style*="color: white"],
html[data-theme="light"] [style*="color:white"],
html[data-theme="light"] [style*="color: #fff"],
html[data-theme="light"] [style*="color:#fff"],
html[data-theme="light"] [style*="color: #ffffff"] {
  color: #1a1a2e !important;
}
html[data-theme="light"] .navbar.navbar-dark {
  background-color: #ffffff !important;
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .navbar.navbar-dark .navbar-brand,
html[data-theme="light"] .navbar.navbar-dark span,
html[data-theme="light"] .navbar.navbar-dark i {
  color: #1a1a2e !important;
}

/* Sombra neón mas suave en claro para elementos con box-shadow cyan fuerte */
html[data-theme="light"] * {
  --neon-glow: rgba(0, 150, 200, 0.2);
}

/* ============================================================
   BOTON FLOTANTE DE CAMBIO DE TEMA
   ============================================================ */
#theme-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--primary, #00d9ff);
  background: var(--card-bg, #1a1a1a);
  color: var(--text-primary, #ffffff);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.3s ease, color 0.3s ease;
  padding: 0;
}
#theme-toggle-btn:hover {
  transform: scale(1.1);
}
#theme-toggle-btn:active {
  transform: scale(0.95);
}
@media (max-width: 576px) {
  #theme-toggle-btn {
    bottom: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
    font-size: 19px;
  }
}

/* ===== MODO CLARO: index.html hero (texto blanco sobre fondo claro) ===== */
html[data-theme="light"] .hero p,
html[data-theme="light"] .hero-content p,
html[data-theme="light"] .hero-content small,
html[data-theme="light"] .hero-content span:not(.badge) {
  color: #2a3345 !important;
  text-shadow: none !important;
}
html[data-theme="light"] .btn-hero {
  color: #12203a !important;
}

/* ===== MODO CLARO: zona de subida (texto blanco inline !important -> fondo oscuro) ===== */
html[data-theme="light"] .image-upload-area {
  background: #12203a !important;
  border-color: #00d9ff !important;
}

/* ===== MODO CLARO: register.html (consentimientos y anti-robot) ===== */
html[data-theme="light"] .register-container p[style*="#ccc"],
html[data-theme="light"] .divider {
  color: #4a5568 !important;
}
html[data-theme="light"] .form-check-label { color: #2a3345 !important; }
html[data-theme="light"] .form-check-label a { color: #0077a8 !important; }
html[data-theme="light"] .captcha-box {
  background: #12203a !important;
  border-color: #00d9ff !important;
}

/* ===== MODO CLARO: login.html (halo blanco de textos que ahora son oscuros) ===== */
html[data-theme="light"] .login-container [style*="text-shadow"] {
  text-shadow: none !important;
}
html[data-theme="light"] .login-container .btn-outline-secondary {
  border-color: #5a6472 !important;
}

/* ===== MODO CLARO: dashboard - barra superior y menú lateral ===== */
/* La barra tenía fondo blanco pero conservaba un degradado oscuro encima; ahora es realmente clara. */
html[data-theme="light"] nav.navbar.navbar-dark {
  background: #ffffff !important;
  background-image: none !important;
  border-bottom: 1px solid #d8dce3 !important;
  box-shadow: 0 2px 12px rgba(20, 30, 60, 0.08) !important;
}
html[data-theme="light"] nav.navbar.navbar-dark a,
html[data-theme="light"] nav.navbar.navbar-dark span,
html[data-theme="light"] nav.navbar.navbar-dark small,
html[data-theme="light"] nav.navbar.navbar-dark i,
html[data-theme="light"] nav.navbar.navbar-dark .btn {
  color: #1a1a2e !important;
  text-shadow: none !important;
}
html[data-theme="light"] nav.navbar.navbar-dark a:hover,
html[data-theme="light"] nav.navbar.navbar-dark a:hover span,
html[data-theme="light"] nav.navbar.navbar-dark .btn:hover {
  color: #00698a !important;
}
html[data-theme="light"] nav.navbar.navbar-dark .btn {
  border-color: rgba(0, 140, 190, 0.55) !important;
}
html[data-theme="light"] nav.navbar.navbar-dark .badge { color: #ffffff !important; }

/* Menú lateral: el CSS propio fija texto blanco con sombra blanca (invisible sobre fondo claro) */
html[data-theme="light"] .sidebar {
  box-shadow: 2px 0 16px rgba(20, 30, 60, 0.06);
}
html[data-theme="light"] .sidebar .nav-link,
html[data-theme="light"] .sidebar .nav-link span,
html[data-theme="light"] .sidebar .nav-link i {
  color: #2a3345 !important;
  text-shadow: none !important;
}
html[data-theme="light"] .sidebar .nav-link:hover,
html[data-theme="light"] .sidebar .nav-link:hover span,
html[data-theme="light"] .sidebar .nav-link:hover i,
html[data-theme="light"] .sidebar .nav-link.active,
html[data-theme="light"] .sidebar .nav-link.active span,
html[data-theme="light"] .sidebar .nav-link.active i {
  color: #00698a !important;
}
html[data-theme="light"] .sidebar .nav-link:hover {
  background: rgba(0, 140, 190, 0.08) !important;
  border-color: rgba(0, 140, 190, 0.35) !important;
}
html[data-theme="light"] .sidebar .nav-link.active {
  background: rgba(0, 140, 190, 0.12) !important;
  border-color: #0088b0 !important;
  box-shadow: 0 0 12px rgba(0, 140, 190, 0.18) !important;
}
