/* ==========================================================================
   DU PIXEL CODE - Demo Interactiva: Evaluación 360° & Analítica SQL Wasm
   Estética: Dark-Mode Luxury, Luminous Geometry, Cybernetic Elegance
   ========================================================================== */

:root {
  --sql-neon-cyan: #00d2ff;
  --sql-neon-cyan-rgb: 0, 210, 255;
  --sql-gold: #ffd700;
  --sql-tech-gold: #c5a059;
  --sql-emerald: #10b981;
  --sql-dark-bg: #050608;
  --sql-card-bg: rgba(9, 13, 18, 0.94);
  --sql-border: rgba(0, 210, 255, 0.25);
  --sql-code-bg: #070a0e;
}

body.sql-demo-page {
  background: var(--sql-dark-bg);
  color: #e2e8f0;
  font-family: 'Lato', sans-serif;
  overflow-x: hidden;
}

.sql-demo-page .site-header {
  position: fixed;
  z-index: 100;
}

/* Banner de Acceso / Clave */
.sql-access-banner {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.12), rgba(255, 215, 0, 0.08), rgba(16, 185, 129, 0.08));
  border-bottom: 1px solid rgba(0, 210, 255, 0.25);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #cbd5e1;
  position: relative;
  z-index: 101;
}

.sql-access-tag {
  background: rgba(255, 215, 0, 0.16);
  border: 1px solid rgba(255, 215, 0, 0.45);
  color: var(--sql-gold);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sql-access-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sql-emerald);
  font-weight: 700;
  font-size: 0.75rem;
}

.sql-access-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sql-emerald);
  box-shadow: 0 0 8px var(--sql-emerald);
  display: inline-block;
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* Hero de la Demo SQL */
.sql-hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: 140px max(24px, 5vw) 70px;
  background: radial-gradient(circle at 75% 25%, rgba(0, 210, 255, 0.12), transparent 45%),
              radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.06), transparent 50%),
              #050608;
  overflow: hidden;
}

.sql-hero__content {
  max-width: 820px;
  position: relative;
  z-index: 2;
}

.sql-hero h1 {
  font-size: clamp(2.8rem, 5.5vw, 5.2rem);
  line-height: 1.05;
  color: #ffffff;
  margin: 20px 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
}

.sql-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #00d2ff 0%, #38bdf8 60%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sql-hero__lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.7;
  color: #94a3b8;
  max-width: 700px;
  margin-bottom: 30px;
}

/* KPI Strip */
.sql-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1240px;
  margin: -40px auto 40px;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

.sql-kpi-card {
  background: var(--sql-card-bg);
  border: 1px solid var(--sql-border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.sql-kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--sql-neon-cyan);
}

.sql-kpi-card small {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
  font-weight: 700;
}

.sql-kpi-card strong {
  font-size: 1.85rem;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  display: block;
}

.sql-kpi-card span {
  font-size: 0.72rem;
  color: #00d2ff;
  margin-top: 4px;
  display: inline-block;
}

/* Contenedor Principal de la Demo */
.sql-workspace {
  max-width: 1240px;
  margin: 0 auto 90px;
  padding: 0 24px;
}

.sql-section-head {
  margin-bottom: 32px;
}

.sql-section-head h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  margin: 8px 0 12px;
}

.sql-section-head p {
  color: #94a3b8;
  max-width: 650px;
  font-size: 0.98rem;
  line-height: 1.6;
}

/* Consola SQL & Terminal */
.sql-terminal-box {
  background: var(--sql-code-bg);
  border: 1px solid rgba(0, 210, 255, 0.35);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 210, 255, 0.12);
  overflow: hidden;
  margin-bottom: 40px;
}

.sql-terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(4, 6, 9, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}

.sql-dots {
  display: flex;
  gap: 7px;
}

.sql-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.sql-dots i:nth-child(1) { background: #ff5f56; }
.sql-dots i:nth-child(2) { background: #ffbd2e; }
.sql-dots i:nth-child(3) { background: #27c93f; }

.sql-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sql-preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sql-preset-btn:hover, .sql-preset-btn.is-active {
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--sql-neon-cyan);
  color: #ffffff;
}

.sql-editor-wrap {
  padding: 24px;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #c7d2fe;
  background: #06090e;
  position: relative;
}

.sql-editor-wrap .kwd { color: #f472b6; font-weight: bold; }
.sql-editor-wrap .fn { color: #38bdf8; }
.sql-editor-wrap .str { color: #34d399; }
.sql-editor-wrap .num { color: #fbbf24; }

.sql-terminal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(4, 6, 9, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}

.sql-metric-badge {
  font-family: monospace;
  font-size: 0.76rem;
  color: var(--sql-emerald);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-run-sql {
  background: linear-gradient(135deg, #00d2ff 0%, #0284c7 100%);
  border: none;
  color: #030a10;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 18px rgba(0, 210, 255, 0.35);
}

.btn-run-sql:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 210, 255, 0.55);
}

/* Grid de Análisis (Radar + Tabla) */
.sql-analytics-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  margin-bottom: 50px;
}

.sql-card {
  background: var(--sql-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.sql-card--radar {
  border-color: rgba(0, 210, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.sql-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sql-card-title h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

/* Radar SVG Chart */
.radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
}

.radar-svg {
  width: 100%;
  max-width: 380px;
  height: auto;
  filter: drop-shadow(0 0 16px rgba(0, 210, 255, 0.2));
}

.radar-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  color: #cbd5e1;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot--cyan { background: var(--sql-neon-cyan); box-shadow: 0 0 8px var(--sql-neon-cyan); }
.legend-dot--gold { background: var(--sql-gold); box-shadow: 0 0 8px var(--sql-gold); }
.legend-dot--emerald { background: var(--sql-emerald); box-shadow: 0 0 8px var(--sql-emerald); }

/* Tabla de Datos Relacionales */
.sql-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.sql-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.sql-table th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sql-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.sql-table tr:hover td {
  background: rgba(0, 210, 255, 0.04);
}

.score-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 800;
  font-family: monospace;
}

.score-badge--high {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.score-badge--med {
  background: rgba(0, 210, 255, 0.18);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.4);
}

.score-badge--rev {
  background: rgba(255, 215, 0, 0.18);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.4);
}

/* Acciones de Exportación */
.sql-export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-export {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-export:hover {
  background: rgba(0, 210, 255, 0.12);
  border-color: var(--sql-neon-cyan);
  color: #ffffff;
}

/* Call to Action Final */
.sql-cta-banner {
  background: radial-gradient(circle at 80% 20%, rgba(0, 210, 255, 0.15), transparent 45%),
              linear-gradient(135deg, rgba(9, 13, 18, 0.98), #050608);
  border: 1px solid rgba(0, 210, 255, 0.35);
  border-radius: 24px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6);
  margin-top: 60px;
}

.sql-cta-banner h2 {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 16px;
}

.sql-cta-banner h2 em {
  font-style: normal;
  color: var(--sql-neon-cyan);
}

.sql-cta-banner p {
  color: #94a3b8;
  max-width: 640px;
  margin: 0 auto 30px;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Responsive */
@media (max-width: 980px) {
  .sql-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sql-analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sql-kpi-grid {
    grid-template-columns: 1fr;
  }
  .sql-terminal-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-run-sql {
    width: 100%;
    justify-content: center;
  }
}
