@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800;900&display=swap');

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-active: rgba(56, 189, 248, 0.4);
  
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --shadow-glow: 0 0 35px rgba(6, 182, 212, 0.15);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* Background animated gradient glow */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: 
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* App Header & Top Progress Bar */
.presentation-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue), var(--accent-indigo));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.header-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-module {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-active);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* Slide Container & Viewport */
.slides-viewport {
  position: relative;
  width: 100vw;
  height: calc(100vh - 56px - 60px);
  margin-top: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 10;
}

.slide {
  position: absolute;
  width: 95%;
  max-width: 1420px;
  height: 94%;
  max-height: 840px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 24px 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(20px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

/* Typography Inside Slides */
.slide-header {
  margin-bottom: 12px;
  flex-shrink: 0;
}

.slide-tag {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.slide-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.slide-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.slide-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: 0;
}

/* Grid Layouts */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
  height: 100%;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  height: 100%;
}

/* Feature Cards & Boxes */
.card-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.card-box:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.card-box h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-box p, .card-box li {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.card-box ul {
  padding-left: 20px;
}

/* Acronym Badge / Glossary Pill */
.acronym-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-body);
  margin-bottom: 8px;
  line-height: 1.4;
  width: fit-content;
  max-width: 100%;
}

.acronym-pill strong {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.4);
  padding: 1px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.acronym-pill .katex {
  font-size: 0.9em;
}

/* Intuitive Example Card */
.example-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 4px;
}

.example-card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.example-card p {
  font-size: 0.88rem;
  color: #d1fae5;
  line-height: 1.5;
}

/* Variable Breakdown Table/Grid */
.var-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 0.86rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.var-symbol {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

.var-desc {
  color: var(--text-secondary);
}

/* Math Formula Boxes */
.formula-box {
  background: rgba(6, 182, 212, 0.06);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 8px 14px;
  margin: 4px 0;
  font-size: 0.94rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.formula-box .katex-display {
  margin: 4px 0 !important;
}

.formula-highlight {
  font-weight: 600;
  color: var(--accent-cyan);
}


/* Vector SVG Graphic Diagrams */
.svg-diagram-container {
  width: 100%;
  height: auto;
  min-height: 240px;
  max-height: 320px;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.5) 0%, rgba(10, 15, 26, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

.svg-diagram-container svg {
  width: 100%;
  height: 100%;
  max-height: 290px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.svg-text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: #94a3b8;
}

.svg-text-bold {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  fill: #f8fafc;
}

.svg-text-cyan {
  fill: #38bdf8;
  font-weight: 600;
}

.svg-text-emerald {
  fill: #34d399;
  font-weight: 600;
}

.svg-text-rose {
  fill: #fb7185;
  font-weight: 600;
}

.svg-text-amber {
  fill: #fbbf24;
  font-weight: 600;
}

/* Code & ASCII Diagram Blocks (Fallback) */
.diagram-block {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
}


/* Tables */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.custom-table th {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-primary);
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-heading);
  font-weight: 600;
  border-bottom: 1px solid var(--border-glass);
}

.custom-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

/* Interactive Simulation Canvas */
.canvas-container {
  width: 100%;
  height: 380px;
  background: #060911;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.canvas-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.btn-sim {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sim:hover, .btn-sim.active {
  background: var(--accent-cyan);
  color: #080c14;
  border-color: var(--accent-cyan);
}

/* Presentation Footer Navigation */
.presentation-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(8, 12, 20, 0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
}

.slide-counter {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.slide-counter span {
  color: var(--accent-cyan);
  font-weight: 700;
}

.nav-buttons {
  display: flex;
  gap: 14px;
}

.btn-nav {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-nav:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #080c14;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Table of Contents Drawer */
.toc-drawer {
  position: fixed;
  top: 56px;
  left: 0;
  width: 340px;
  height: calc(100vh - 56px);
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 24px;
  overflow-y: auto;
}

.toc-drawer.open {
  transform: translateX(0);
}

.toc-header {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toc-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-cyan);
}

.toc-item.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
  font-weight: 600;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* ==========================================================================
   ESTILOS ADICIONALES: PORTADA MAGISTRAL Y TEMARIO
   ========================================================================== */

.hero-presentation {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.hero-header-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 24px 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hero-header-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue), var(--accent-indigo));
}

.hero-badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.hero-tag {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-tag.tag-blue {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.hero-tag.tag-emerald {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.hero-title-main {
  font-family: var(--font-heading);
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 20%, #e2e8f0 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.hero-subtitle-main {
  font-size: 1.15rem;
  color: #94a3b8;
  font-weight: 400;
  max-width: 950px;
}

.hero-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 16px 0;
}

.hero-pillar-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.hero-pillar-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.15);
  background: rgba(30, 41, 59, 0.8);
}

.pillar-icon-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pillar-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pillar-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pillar-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
}

.pillar-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.pillar-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-footer-bar {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-footer-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.hero-footer-info strong {
  color: var(--text-primary);
}

/* Temario Grid & Cards */
.temario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.temario-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.temario-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(30, 41, 59, 0.75);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.temario-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.temario-num-badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.temario-time-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.temario-card-title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.25;
}

.temario-list {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 4px 0 8px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.temario-list li {
  position: relative;
  padding-left: 12px;
}

.temario-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
}

.temario-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.temario-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(6, 182, 212, 0.1);
  color: #7dd3fc;
  border: 1px solid rgba(6, 182, 212, 0.2);
}
