/* ==========================================================================
   IMNOVAPANEL - SISTEMA DE DISEÑO LIGHT PREMIUM & ELEGANTE
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta Light Premium */
  --bg-main: #ffffff;
  --bg-surface: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --border-subtle: #e2e8f0;
  --border-card: #eaecf0;

  /* Tipografía */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  /* Acentos de Marca */
  --accent-purple: #5b21b6;
  --accent-violet: #7c3aed;
  --accent-indigo: #6366f1;
  --accent-cyan: #0284c7;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  /* Gradientes */
  --grad-primary: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar estilizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.font-mono {
  font-family: var(--font-mono);
}

.text-gradient-purple {
  color: #6d28d9;
}

/* Efectos de Cristal / Glow en Light Theme */
.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: rgba(109, 40, 217, 0.3);
  box-shadow: 0 20px 35px -10px rgba(109, 40, 217, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  transform: translateY(-2px);
}

/* Matriz de Puntos Decorativos (Dot Grid) */
.dot-matrix {
  background-image: radial-gradient(rgba(124, 58, 237, 0.25) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
}

/* Soft Ambient Glows en Blanco */
.purple-glow-hero {
  position: absolute;
  top: 0;
  right: 0;
  width: 700px;
  height: 650px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.09) 0%, rgba(99, 102, 241, 0.04) 50%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.purple-glow-left {
  position: absolute;
  top: 25%;
  left: -10%;
  width: 600px;
  height: 550px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* Botones principales estilo Premium Light */
.btn-purple {
  background: linear-gradient(135deg, #5b21b6 0%, #6d28d9 100%);
  color: #ffffff;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(91, 33, 182, 0.25);
}
.btn-purple:hover {
  background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 100%);
  box-shadow: 0 6px 20px rgba(91, 33, 182, 0.35);
  transform: translateY(-1px);
}

.btn-light {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}
.btn-light:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Frame para la captura del panel */
.screenshot-frame {
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.14), 0 0 35px -5px rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

/* Badge de Estado */
.status-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.active {
  background-color: #10b981;
}
.status-dot.active::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.3);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* Modales */
.modal-overlay {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* ==========================================================================
   Contenido de la documentación (documentacion.html)
   ========================================================================== */
.doc-prose { color: #475569; font-size: 14px; line-height: 1.75; }
.doc-prose > * + * { margin-top: 1rem; }
.doc-prose h3 { margin-top: 2.25rem; font-size: 1.15rem; font-weight: 800; color: #0f172a; letter-spacing: -0.01em; }
.doc-prose h4 { margin-top: 1.75rem; font-size: 1rem; font-weight: 700; color: #0f172a; }
.doc-prose h5 { margin-top: 1.25rem; font-size: 0.9rem; font-weight: 700; color: #334155; }
.doc-prose h3 + *, .doc-prose h4 + *, .doc-prose h5 + * { margin-top: 0.5rem; }
.doc-prose strong { color: #0f172a; font-weight: 700; }
.doc-prose a { color: #6d28d9; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(109, 40, 217, 0.3); text-underline-offset: 3px; }
.doc-prose a:hover { text-decoration-color: #6d28d9; }
.doc-prose ul { list-style: disc; padding-left: 1.25rem; }
.doc-prose ol { list-style: decimal; padding-left: 1.25rem; }
.doc-prose li + li { margin-top: 0.35rem; }
.doc-prose li::marker { color: #a78bfa; }
.doc-prose ul:has(> li > input[type="checkbox"]) { list-style: none; padding-left: 0; }
.doc-prose :not(pre) > code { font-family: var(--font-mono); font-size: 0.85em; color: #6d28d9; background: #f1f5f9; padding: 0.1rem 0.4rem; border-radius: 0.375rem; overflow-wrap: anywhere; }
.doc-prose pre code { font-family: var(--font-mono); white-space: pre; }
.doc-prose table { width: 100%; text-align: left; font-size: 12px; border-collapse: collapse; }
.doc-prose thead { background: #f8fafc; }
.doc-prose th { padding: 0.8rem 1.25rem; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #1e293b; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.doc-prose td { padding: 0.75rem 1.25rem; border-top: 1px solid #f1f5f9; vertical-align: top; }
.doc-prose tbody tr:hover { background: rgba(248, 250, 252, 0.6); }
.doc-prose td:first-child { font-weight: 600; color: #0f172a; }
.doc-prose hr { border: 0; border-top: 1px solid #e2e8f0; margin: 2rem 0; }
.doc-prose blockquote { border-left: 3px solid #e2e8f0; padding-left: 1rem; color: #64748b; }
.doc-prose em { color: #64748b; }
.doc-callout p { margin: 0.35rem 0 0; }
.doc-nav-active { color: #ffffff !important; background: linear-gradient(135deg, #6428e8 0%, #7c3aed 100%) !important; font-weight: 700 !important; box-shadow: 0 4px 12px rgba(100, 40, 232, 0.25) !important; }
.doc-nav-active svg, .doc-nav-active i, .doc-nav-active span { color: #ffffff !important; }
.doc-prose td code { white-space: nowrap; overflow-wrap: normal; }

/* Transición suave para cambio de pestañas de documentación (SPA Mode) */
.doc-section {
  animation: docTabFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes docTabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   ENTRANCE ANIMATION: VENETIAN SHUTTER CURTAIN (BLACK LUXURY THEME)
   ========================================================================== */
.preloader-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  pointer-events: all;
  overflow: hidden;
  background-color: transparent;
}

.shutter-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.shutter-row {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 50vh;
  flex: 1 1 50%;
  overflow: hidden;
}

.shutter-row.top-row {
  align-items: flex-start;
  justify-content: center;
}

.shutter-row.bottom-row {
  align-items: flex-end;
  justify-content: center;
}

.shutter-col {
  flex: 1 0 20%;
  width: 20%;
  height: 100%;
  background-color: #090d16; /* Deep Black Brand */
  transform-origin: top center;
  will-change: transform;
}

.bottom-row .shutter-col {
  transform-origin: bottom center;
}

/* Logo Hero Center Badge on Preloader */
.preloader-center-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.preloader-logo-card {
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
  filter: drop-shadow(0 15px 35px rgba(100, 40, 232, 0.45));
}

.preloader-logo-card img {
  height: 110px;
  max-width: 90vw;
  width: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 768px) {
  .preloader-logo-card img {
    height: 70px;
  }
}

/* Top Purple Sweep Progress Line */
.top-entrance-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #6428e8, #7c3aed, #a855f7);
  z-index: 1000001;
  transform: translateX(-100%);
  transform-origin: left center;
  pointer-events: none;
}


/* ==========================================================================
   MODO OSCURO
   Se activa con la clase .dark en <html> (js/theme.js). Las paginas usan
   colores claros de Tailwind fijos en el HTML; esta capa los reemplaza por sus
   equivalentes oscuros, asi el mismo HTML funciona en los dos modos.
   ========================================================================== */
html.dark {
  color-scheme: dark;
  --bg-main: #0b1120;
  --bg-surface: #0f172a;
  --bg-card: #111a2e;
  --border-subtle: #1e293b;
  --border-card: #1e293b;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-soft: #64748b;
}
html.dark body { background-color: var(--bg-main); color: var(--text-main); }
html.dark ::-webkit-scrollbar-track { background: #0f172a; }
html.dark ::-webkit-scrollbar-thumb { background: #334155; }
html.dark .text-gradient-purple { color: #a78bfa; }

html.dark .glass-nav { background: rgba(11, 17, 32, 0.9); border-bottom-color: rgba(30, 41, 59, 0.9); }
html.dark .glass-panel { background: var(--bg-card); border-color: #1e293b; box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35); }
html.dark .glass-panel:hover { border-color: rgba(167, 139, 250, 0.45); box-shadow: 0 20px 35px -10px rgba(124, 58, 237, 0.25); }
html.dark .purple-glow-hero { background: radial-gradient(circle, rgba(124, 58, 237, 0.18) 0%, rgba(99, 102, 241, 0.08) 50%, transparent 70%); }
html.dark .purple-glow-left { background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%); }

/* Superficies */
html.dark .bg-white { background-color: var(--bg-card); }
html.dark .bg-white\/95 { background-color: rgba(17, 26, 46, 0.95); }
html.dark .bg-slate-50 { background-color: #0f172a; }
html.dark .bg-slate-50\/70, html.dark .bg-slate-50\/60 { background-color: rgba(15, 23, 42, 0.7); }
html.dark .bg-slate-100 { background-color: #1e293b; }
html.dark .bg-purple-50, html.dark .bg-violet-50, html.dark .bg-indigo-50 { background-color: rgba(124, 58, 237, 0.14); }
html.dark .bg-emerald-50 { background-color: rgba(16, 185, 129, 0.12); }
html.dark .bg-amber-50 { background-color: rgba(245, 158, 11, 0.12); }
html.dark .bg-sky-50 { background-color: rgba(14, 165, 233, 0.12); }
html.dark .bg-rose-50 { background-color: rgba(244, 63, 94, 0.12); }
html.dark .from-slate-50 { --tw-gradient-from: #0f172a var(--tw-gradient-from-position); --tw-gradient-to: rgba(15, 23, 42, 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
html.dark .to-purple-50\/40, html.dark .to-purple-50\/30 { --tw-gradient-to: rgba(124, 58, 237, 0.08) var(--tw-gradient-to-position); }

/* Texto */
html.dark .text-slate-900, html.dark .text-slate-800, html.dark .text-\[\#090d16\] { color: #f1f5f9; }
html.dark .text-slate-700 { color: #cbd5e1; }
html.dark .text-slate-600 { color: #b6c2d3; }
html.dark .text-slate-500 { color: #94a3b8; }
html.dark .text-purple-700, html.dark .text-purple-900, html.dark .text-purple-950 { color: #c4b5fd; }
html.dark .text-purple-600, html.dark .text-violet-600, html.dark .text-\[\#6428e8\] { color: #a78bfa; }
html.dark .text-indigo-600 { color: #a5b4fc; }
html.dark .text-emerald-600 { color: #34d399; }
html.dark .text-emerald-700, html.dark .text-emerald-800, html.dark .text-emerald-950 { color: #6ee7b7; }
html.dark .text-amber-600, html.dark .text-amber-700, html.dark .text-amber-800, html.dark .text-amber-900, html.dark .text-amber-950 { color: #fcd34d; }
html.dark .text-sky-700, html.dark .text-sky-950 { color: #7dd3fc; }
html.dark .text-rose-700, html.dark .text-rose-950 { color: #fda4af; }

/* Bordes */
html.dark .border-slate-100, html.dark .border-slate-200 { border-color: #1e293b; }
html.dark .border-slate-300 { border-color: #334155; }
html.dark .border-purple-200 { border-color: rgba(167, 139, 250, 0.3); }
html.dark .border-emerald-200 { border-color: rgba(52, 211, 153, 0.3); }
html.dark .border-amber-200 { border-color: rgba(251, 191, 36, 0.3); }
html.dark .border-sky-200 { border-color: rgba(56, 189, 248, 0.3); }
html.dark .border-rose-200 { border-color: rgba(251, 113, 133, 0.3); }
html.dark .divide-slate-100 > * + *, html.dark .divide-slate-200 > * + * { border-color: #1e293b; }

/* Estados hover */
html.dark .hover\:bg-slate-50:hover, html.dark .hover\:bg-slate-100:hover { background-color: #1e293b; }
html.dark .hover\:bg-purple-50:hover, html.dark .hover\:bg-purple-100:hover { background-color: rgba(124, 58, 237, 0.2); }
html.dark .hover\:text-slate-900:hover, html.dark .hover\:text-slate-800:hover { color: #ffffff; }
html.dark .hover\:text-slate-600:hover, html.dark .hover\:text-slate-700:hover { color: #e2e8f0; }
html.dark .hover\:text-purple-600:hover, html.dark .hover\:text-purple-700:hover { color: #c4b5fd; }
html.dark .hover\:border-slate-300:hover { border-color: #475569; }

/* Formularios */
html.dark input:not([type="checkbox"]):not([type="radio"]), html.dark select, html.dark textarea { color: #e2e8f0; }
html.dark input::placeholder, html.dark textarea::placeholder { color: #64748b; }

/* Documentacion */
html.dark .doc-prose { color: #b6c2d3; }
html.dark .doc-prose h3, html.dark .doc-prose h4, html.dark .doc-prose strong, html.dark .doc-prose td:first-child { color: #f1f5f9; }
html.dark .doc-prose h5 { color: #cbd5e1; }
html.dark .doc-prose a { color: #c4b5fd; text-decoration-color: rgba(196, 181, 253, 0.35); }
html.dark .doc-prose :not(pre) > code { color: #c4b5fd; background: #1e293b; }
html.dark .doc-prose thead { background: #0f172a; }
html.dark .doc-prose th { color: #e2e8f0; border-bottom-color: #1e293b; }
html.dark .doc-prose td { border-top-color: #1e293b; }
html.dark .doc-prose tbody tr:hover { background: rgba(30, 41, 59, 0.5); }
html.dark .doc-prose hr { border-top-color: #1e293b; }
html.dark .doc-prose blockquote { border-left-color: #334155; color: #94a3b8; }

/* Aviso de cookies (estilos en linea de js/cookie-notice.js) */
html.dark #cookie-notice { background: #111a2e !important; color: #cbd5e1 !important; border-color: #1e293b !important; }
html.dark #cookie-notice a { color: #c4b5fd !important; }

/* Boton de modo claro/oscuro */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid #e2e8f0; background: #ffffff; color: #475569; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.theme-toggle:hover { color: #5b21b6; border-color: #c4b5fd; }
.theme-toggle.floating { position: fixed; left: 16px; bottom: 16px; z-index: 9997; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15); }
html.dark .theme-toggle { background: #111a2e; border-color: #1e293b; color: #cbd5e1; }
html.dark .theme-toggle:hover { color: #c4b5fd; border-color: rgba(167, 139, 250, 0.5); }

/* Modo oscuro: fondos pastel con transparencia y etiquetas (-100) */
html.dark [class*="bg-emerald-50/"], html.dark .bg-emerald-100 { background-color: rgba(16, 185, 129, 0.16); }
html.dark [class*="bg-amber-50/"], html.dark .bg-amber-100 { background-color: rgba(245, 158, 11, 0.16); }
html.dark [class*="bg-sky-50/"], html.dark .bg-blue-50 { background-color: rgba(14, 165, 233, 0.12); }
html.dark [class*="bg-purple-50/"], html.dark .bg-purple-100 { background-color: rgba(124, 58, 237, 0.18); }
html.dark [class*="bg-rose-50/"] { background-color: rgba(244, 63, 94, 0.12); }
html.dark [class*="bg-slate-50/"], html.dark [class*="bg-slate-100/"], html.dark [class*="bg-slate-200/"] { background-color: rgba(30, 41, 59, 0.55); }
