/* ==========================================================================
   IL - SISTEMA DE DISEÑO GLOBAL UNIFICADO (Core Global V9.0)
   ========================================================================== */

/* 1. TOKENS DE DISEÑO Y VARIABLES GLOBALES */
:root {
  --il-primary: #00e676;
  --il-secondary: #2979ff;
  --il-accent: #ff5252;
  --il-warning: #ffb142;
  --il-dark: #0a0f18;
  --il-darker: #05080c;
  --il-card: #14233c;
  --il-card-hover: #1c3154;
  --il-text-light: #f8fafc;
  --il-text-muted: #94a3b8;
  --il-border: #233b63;
  --il-gradient: linear-gradient(135deg, #00e676 0%, #2979ff 100%);
  --il-gradient-card: linear-gradient(145deg, #162846 0%, #0f1c30 100%);
  --il-text: #f8fafc;
}

/* 2. NORMALIZACIÓN Y COMPATIBILIDAD CON BUILDERS */
body.hostinger-ai-builder-elementor, 
body.hostinger-ai-builder-gutenberg {
  padding-top: 0px !important;
}

/* 3. CONTENEDOR RAÍZ Y TIPOGRAFÍA BASE */
.il-article-modern {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 15px;
  color: #1a1a1a;
  line-height: 1.7;
  box-sizing: border-box;
}

/* Título H1 principal y Subtítulo de Autor */
.il-article-modern h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 10px 0 8px 0;
  background: var(--il-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.il-book-subtitle {
  font-size: 1.15rem;
  color: var(--il-text-muted) !important;
  margin-top: 0;
  margin-bottom: 30px;
}

.il-book-subtitle em {
  color: var(--il-secondary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .il-article-modern h1 {
    font-size: 1.85rem;
  }
}

.il-article-modern h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 50px 0 25px 0;
  background: var(--il-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.25;
}

.il-article-modern h3 {
  font-size: 1.45rem;
  font-weight: 600;
  margin: 35px 0 15px 0;
  color: var(--il-secondary);
}

.il-article-modern p {
  margin-bottom: 20px;
  color: #1a1a1a;
}

.il-article-modern a {
  color: var(--il-secondary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.25s ease;
}

.il-article-modern a:hover {
  border-bottom-color: var(--il-secondary);
  color: var(--il-primary);
}

.il-article-modern ul, 
.il-article-modern ol {
  margin: 20px 0;
  padding-left: 30px;
}

.il-article-modern li {
  margin-bottom: 10px;
  color: #1a1a1a;
}

.il-article-modern blockquote {
  border-left: 4px solid var(--il-secondary);
  padding: 18px 24px;
  margin: 30px 0;
  background: rgba(41, 121, 255, 0.05);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: #4b5563;
}

/* 4. LAYOUT: SISTEMA DE COLUMNAS (GRID) */
.il-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  width: 100%;
  margin: 30px 0;
  box-sizing: border-box;
  align-items: start;
}

.il-grid-2col > * {
  min-width: 0;
}

@media (max-width: 850px) {
  .il-grid-2col {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* 5. MULTIMEDIA: CONTENEDOR DE IMÁGENES */
.il-img-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin: 30px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.il-img-container img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.il-img-container:hover img {
  transform: scale(1.03);
}

.il-img-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 16px 20px;
  color: #ffffff;
  font-size: 0.85rem;
}

/* 6. COMPONENTES: TARJETAS (CARDS) */
.il-card {
  background: var(--il-card);
  border: 1px solid var(--il-border);
  border-radius: 14px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.il-card:hover {
  transform: translateY(-3px);
  background: var(--il-card-hover);
  box-shadow: 0 12px 40px rgba(0, 230, 118, 0.12);
}

.il-card-accent {
  border-left: 8px solid var(--il-primary);
}

.il-card-accent-top {
  border-top: 3px solid var(--il-primary);
}

.il-card-warning {
  border-left: 8px solid var(--il-accent);
  background: linear-gradient(135deg, rgba(255, 82, 82, 0.12) 0%, var(--il-card) 100%);
}

.il-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.il-header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.il-card-header h3 {
  margin: 0;
  color: var(--il-text-light);
  font-size: 1.4rem;
  font-weight: 700;
}

.il-card h4 {
  margin: 0 0 10px 0;
  color: var(--il-primary);
  font-size: 1.15rem;
  font-weight: 700;
}

.il-card p {
  color: #ffffff;
  line-height: 1.4;
}

.il-sort-hint {
  font-size: 0.75rem;
  color: var(--il-text-muted);
  font-weight: 500;
}

/* 7. COMPONENTES: TABLAS (MODERNAS Y RESULTADOS MENSUALES) */
.il-table-responsive,
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 25px 0;
}

.il-table-modern,
.table-resultados-mensual {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.il-table-modern th,
.table-resultados-mensual th {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 14px 18px;
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border-bottom: 2px solid var(--il-primary);
  border-left: none !important;
  border-right: none !important;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.il-table-modern th[onclick],
.il-table-modern th.sortable {
  cursor: pointer;
}

.il-table-modern th:hover {
  background: rgba(41, 121, 255, 0.15);
  color: #ffffff;
}

.il-table-modern th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0.35;
  transition: opacity 0.2s ease;
}

.il-table-modern th.sort-asc .sort-icon,
.il-table-modern th.sort-desc .sort-icon {
  opacity: 1;
  color: var(--il-primary);
}

.il-table-modern td,
.table-resultados-mensual td {
  padding: 14px 18px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-left: none !important;
  border-right: none !important;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.il-table-modern tr:nth-child(even) td,
.table-resultados-mensual tr:nth-child(even) td {
  background-color: rgba(15, 23, 42, 0.35);
}

.il-table-modern tr:hover td,
.table-resultados-mensual tr:hover td {
  background-color: rgba(41, 121, 255, 0.12) !important;
  color: #ffffff;
}

/* Modificadores analíticos de tabla */
.table-resultados-mensual td:nth-child(2) { color: #94a3b8 !important; font-weight: 500; }
.table-resultados-mensual td:nth-child(3),
.table-resultados-mensual td:nth-child(5) { color: #4ade80 !important; text-shadow: 0 0 8px rgba(74, 222, 128, 0.15); }
.table-resultados-mensual td:nth-child(6) { color: #38bdf8 !important; }
.table-resultados-mensual td:nth-child(10) { width: 150px; }

/* 8. COMPONENTES: LOGOTIPOS */
.il-logo-wrapper {
  background: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  height: 32px;
  box-sizing: border-box;
}

.il-table-logo,
.table-resultados-mensual td:nth-child(1) img {
  max-height: 24px;
  max-width: 80px;
  width: auto;
  object-fit: contain;
  display: block;
  margin: auto;
}

/* 9. COMPONENTES: TARJETAS KPI */
.il-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 25px;
  width: 100%;
}

.il-kpi-card {
  background: var(--il-gradient-card);
  border: 1px solid var(--il-border);
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
}

.il-kpi-featured {
  border-color: var(--il-primary);
  background: linear-gradient(145deg, #18374d 0%, #0f2434 100%);
}

.il-kpi-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--il-text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.il-kpi-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--il-text-light);
}

@media (max-width: 900px) { .il-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .il-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* 10. COMPONENTES: PESTAÑAS (TABS) */
.il-tabs-wrapper { width: 100%; margin-bottom: 30px; }
.il-tab-nav {
  display: flex;
  gap: 10px;
  background: var(--il-darker);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--il-border);
  margin-bottom: 20px;
}
.il-tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--il-text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.il-tab-btn.active {
  background: var(--il-card);
  color: var(--il-primary);
  border: 1px solid var(--il-border);
}
.il-tab-pane { display: none; }
.il-tab-pane.active { display: block; }

/* 11. COMPONENTES: BADGES DE ESTADO (COMPATIBILIDAD TOTAL) */
.il-badge-status,
.estado {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  min-width: 85px;
  margin: 0 auto;
  box-sizing: border-box;
}

.status-activa, .status-aportando,
.estado.activa, .estado.aportando {
  background: rgba(0, 230, 118, 0.15);
  color: var(--il-primary);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.status-retirando,
.estado.retirando {
  background: rgba(255, 82, 82, 0.15);
  color: var(--il-accent);
  border: 1px solid rgba(255, 82, 82, 0.3);
}

.status-probando, .status-mantener,
.estado.probando, .estado.mantener {
  background: rgba(255, 177, 66, 0.15);
  color: var(--il-warning);
  border: 1px solid rgba(255, 177, 66, 0.3);
}

.status-default {
  background: rgba(148, 163, 184, 0.15);
  color: var(--il-text-muted);
}

.il-badge-date {
  font-size: 0.85rem;
  color: var(--il-text-muted);
  font-weight: 500;
}

/* 12. COMPONENTES: COMPARACIÓN LADO A LADO */
.il-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin: 35px 0;
}

.il-comparison-item {
  background: var(--il-card);
  border-radius: 12px;
  padding: 24px;
  border: 2px solid var(--il-border);
  transition: all 0.3s ease;
}

.il-comparison-item:hover {
  border-color: var(--il-primary);
  background: var(--il-card-hover);
}

.il-comparison-item h4 {
  font-size: 1.25rem;
  margin-bottom: 15px;
  color: var(--il-primary) !important;
}

.il-comparison-item ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.il-comparison-item li {
  padding-left: 26px;
  position: relative;
  color: #ffffff !important;
  margin-bottom: 10px;
}

.il-comparison-item li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--il-secondary);
  font-weight: 700;
}

/* 13. COMPONENTES: CHECKLIST ESTILIZADA */
.il-checklist-box {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.08) 0%, rgba(41, 121, 255, 0.04) 100%);
  border: 2px solid var(--il-primary);
  border-radius: 12px;
  padding: 25px;
  margin: 30px 0;
}

.il-checklist-box h4 {
  color: var(--il-secondary) !important;
  margin-bottom: 18px;
  font-size: 1.25rem;
}

.il-checklist-box ol {
  counter-reset: checklist;
  list-style: none;
  padding: 0;
  margin: 0;
}

.il-checklist-box li {
  counter-increment: checklist;
  padding: 10px 0 10px 48px;
  position: relative;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: #1a1a1a !important;
}

.il-checklist-box li:before {
  content: counter(checklist);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: var(--il-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--il-dark);
}

/* 14. COMPONENTES: WIDGET / CALCULADORA */
.il-timing-widget {
  background: linear-gradient(135deg, #1a2f4a 0%, #1d3557 100%);
  border: 2px solid var(--il-border);
  border-radius: 14px;
  padding: 35px;
  margin: 40px 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.il-widget-title {
  font-size: 1.6rem;
  color: var(--il-primary) !important;
  margin-bottom: 8px;
  font-weight: 700;
}

.il-widget-desc {
  color: var(--il-text-muted);
  margin-bottom: 25px;
  font-size: 1rem;
}

.il-widget-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 25px;
}

.il-widget-inputs label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: #ffffff !important;
  font-weight: 600;
}

.il-widget-inputs input {
  padding: 12px;
  background: var(--il-darker);
  border: 2px solid var(--il-border);
  border-radius: 8px;
  color: var(--il-primary);
  font-size: 1.05rem;
  font-weight: 600;
  transition: border-color 0.25s ease;
}

.il-widget-inputs input:focus {
  outline: none;
  border-color: var(--il-primary);
}

.il-widget-btn {
  width: 100%;
  padding: 16px;
  background: var(--il-gradient);
  color: var(--il-dark);
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.il-widget-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 230, 118, 0.35);
}

.il-widget-result {
  margin-top: 25px;
  padding: 25px;
  background: var(--il-darker);
  border-radius: 10px;
  border: 2px solid var(--il-border);
}

.il-widget-result p {
  margin: 10px 0;
  font-size: 1.05rem;
  color: #ffffff !important;
}

.il-loss {
  color: var(--il-accent) !important;
  font-size: 1.25rem !important;
  font-weight: 700;
}

.il-empirical-note {
  margin-top: 15px;
  padding: 14px;
  background: rgba(255, 82, 82, 0.1);
  border-radius: 8px;
  border-left: 4px solid var(--il-accent);
  font-size: 0.85rem;
  color: var(--il-text-muted);
}

/* 15. COMPONENTES: LLAMADOS A LA ACCIÓN (CTAs) */
.il-cta-final,
.cta-container {
  background: var(--il-gradient);
  border-radius: 14px;
  padding: 40px 30px;
  text-align: center;
  margin: 50px auto;
  color: var(--il-dark);
  box-sizing: border-box;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cta-container {
  background: var(--il-gradient-card);
  border: 1px solid var(--il-border);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
  width: 80%;
}

.il-cta-final h3 {
  color: var(--il-dark);
  font-size: 1.8rem;
  margin-bottom: 12px;
  font-weight: 800;
}

.il-cta-final p {
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto 25px auto;
  color: #0f1c30;
  font-weight: 600;
}

.cta-container p {
  color: var(--il-text-light);
  font-size: 1.25em;
  font-weight: 600;
  margin-bottom: 25px;
}

.il-btn-cta,
.cta-button,
.il-cta-final a {
  display: inline-block;
  background: var(--il-dark);
  color: var(--il-primary);
  padding: 14px 36px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  border: none;
  cursor: pointer;
}

.cta-button {
  background: var(--il-gradient);
  color: var(--il-dark);
  box-shadow: 0 4px 14px rgba(0, 230, 118, 0.3);
}

.il-btn-cta:hover,
.cta-button:hover,
.il-cta-final a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 230, 118, 0.4);
  color: #ffffff;
}

/* 16. COMPONENTES: ALERTAS Y NOTAS */
/* ==========================================================================
   CAJAS DE NOTAS EDITORIALES SUAVES (MÁXIMA LEGIBILIDAD)
   ========================================================================== */

.il-alert-box, 
.il-warning-box,
.nota-importante,
.il-empirical-note {
  padding: 18px 22px;
  border-radius: 8px;
  margin: 25px 0;
  box-sizing: border-box;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Nota de Análisis / Ingeniero (Verde Suave) */
.il-alert-box {
  background: rgba(0, 230, 118, 0.07);
  border-left: 4px solid var(--il-primary);
  border-top: 1px solid rgba(0, 230, 118, 0.15);
  border-right: 1px solid rgba(0, 230, 118, 0.15);
  border-bottom: 1px solid rgba(0, 230, 118, 0.15);
  color: #1e293b !important;
}

/* Nota de Advertencia / Riesgo (Ámbar Suave) */
.il-warning-box,
.nota-importante {
  background: rgba(255, 177, 66, 0.08);
  border-left: 4px solid var(--il-warning);
  border-top: 1px solid rgba(255, 177, 66, 0.15);
  border-right: 1px solid rgba(255, 177, 66, 0.15);
  border-bottom: 1px solid rgba(255, 177, 66, 0.15);
  color: #1e293b !important;
}

/* Nota de Pérdida / Empírica (Rojo Suave) */
.il-empirical-note {
  background: rgba(255, 82, 82, 0.08);
  border-left: 4px solid var(--il-accent);
  border-top: 1px solid rgba(255, 82, 82, 0.15);
  border-right: 1px solid rgba(255, 82, 82, 0.15);
  border-bottom: 1px solid rgba(255, 82, 82, 0.15);
  color: #1e293b !important;
}

/* Tipografía interior de las notas suaves */
.il-alert-box p,
.il-warning-box p,
.nota-importante p,
.il-empirical-note p {
  color: #1e293b !important;
  margin-bottom: 10px;
}

.il-alert-box p:last-child,
.il-warning-box p:last-child,
.nota-importante p:last-child,
.il-empirical-note p:last-child {
  margin-bottom: 0;
}

.il-alert-box strong,
.il-warning-box strong,
.nota-importante strong,
.il-empirical-note strong {
  color: #0f172a !important;
}

/* 17. UTILIDADES, SKELETONS Y ANIMACIONES */
.il-text-center { text-align: center; }
.il-highlight-green { color: var(--il-primary) !important; }
.il-highlight-blue { color: var(--il-secondary) !important; }
.il-highlight-gradient {
  background: var(--il-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.il-highlight {
  background: linear-gradient(120deg, rgba(0,230,118,0.3) 0%, rgba(41,121,255,0.2) 100%);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.il-skeleton {
  display: inline-block;
  height: 1rem;
  width: 60%;
  background: linear-gradient(90deg, #1c3154 25%, #233b63 50%, #1c3154 75%);
  background-size: 200% 100%;
  animation: skeletonAnim 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeletonAnim {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.il-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--il-border);
  border-top-color: var(--il-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 18. NAVEGACIÓN WORDPRESS */
.wp-block-navigation-submenu ul {
  background-color: var(--il-darker) !important;
  color: var(--il-text-light) !important;
  border: 1px solid var(--il-border);
  padding: 10px !important;
  border-radius: 8px;
}
.wp-block-navigation-submenu li {
  font-size: 0.9em !important;
  margin: 0.4em 0px;
}
@media screen and (max-width: 768px) {
  .wp-block-navigation:not(.has-text-color) .wp-block-navigation__responsive-container.is-menu-open {
    position: fixed;  
    top: 0;
    padding-top: 2em;    
    width: 280px;
    height: 100%;
    background-color: var(--il-darker) !important;
    color: var(--il-text-light) !important;
    border-right: 1px solid var(--il-border);
  }
  .wp-block-navigation ul { padding-left: 1.5em; }
}