/* Echo Kardiogramma Slide Deck - Design System 4.0 (Compact 16:9 Presentation Stage) */
:root {
  --bg-dark: #040714;
  --bg-stage: #0a0e23;
  --bg-card: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(23, 37, 84, 0.7));
  --bg-card-border: rgba(0, 242, 254, 0.3);
  --cyan: #00f2fe;
  --cyan-glow: rgba(0, 242, 254, 0.45);
  --blue: #3b82f6;
  --crimson: #ff3366;
  --crimson-glow: rgba(255, 51, 102, 0.45);
  --green: #10b981;
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-code: 'Fira Code', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Ambient Radial Background Glows */
body::before {
  content: '';
  position: fixed;
  top: -15%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -15%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(255, 51, 102, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* App Container */
.app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* Vector Icons */
.svg-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Header Navigation Bar */
.top-bar {
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(4, 7, 20, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 242, 254, 0.15);
  z-index: 100;
  position: relative;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  fill: #040714;
}

.author-tag {
  font-size: 0.8rem;
  padding: 4px 12px;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 20px;
  color: var(--cyan);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--cyan);
  color: #fff;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  color: #040714;
  font-weight: 800;
  border: none;
}

.progress-bar-container {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  flex-shrink: 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--crimson));
  box-shadow: 0 0 10px var(--cyan);
  transition: width 0.3s ease;
}

/* 16:9 Presentation Stage Viewport */
.slides-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
}

/* Slide 16:9 Aspect Ratio Frame Box */
.slide {
  position: absolute;
  width: 100%;
  max-width: 1240px;
  height: 100%;
  max-height: calc(100vh - 140px);
  aspect-ratio: 16 / 9;
  background: var(--bg-stage);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 20px;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.97);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
  z-index: 10;
}

/* Compact Tight Slide Header */
.slide-header {
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-shrink: 0;
}

.slide-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slide-badge {
  font-family: var(--font-code);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cyan);
  font-weight: 700;
}

.slide-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 2.5vw, 2.2rem);
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 40%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.slide-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

/* Compact High-Density Body Layout */
.slide-body {
  flex: 1;
  display: flex;
  gap: 20px;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.col-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}

.col-full {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}

/* Glass Cards - Tight Spacing & Dense Layout */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
}

.glass-card:hover {
  border-color: rgba(0, 242, 254, 0.6);
  box-shadow: 0 12px 30px rgba(0, 242, 254, 0.2);
  transform: translateY(-2px);
}

.glass-card.card-accent-crimson {
  border-color: rgba(255, 51, 102, 0.35);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Compact Image Frame */
.img-frame-box {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: #02040b;
  border: 1px solid rgba(0, 242, 254, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.real-img-card {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-caption-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  padding: 6px 12px;
  background: rgba(4, 7, 20, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--cyan);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Hero Title / Cover Slide */
.hero-slide-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 32px;
  width: 100%;
}

.hero-text {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 4vw, 3.8rem);
  font-weight: 900;
  line-height: 1.05;
  background: linear-gradient(135deg, #ffffff 20%, var(--cyan) 60%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 700px;
}

.hero-meta {
  display: flex;
  gap: 12px;
}

.meta-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 20px;
  font-size: 0.88rem;
  color: var(--cyan);
  font-weight: 600;
}

.hero-img-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img {
  width: 100%;
  max-width: 420px;
  max-height: 380px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(0, 242, 254, 0.4);
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* Feature List */
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #e2e8f0;
}

.check-icon {
  color: var(--cyan);
  background: rgba(0, 242, 254, 0.18);
  padding: 1px 6px;
  border-radius: 50%;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.75rem;
  margin-top: 2px;
}

.formula-tag {
  font-family: var(--font-code);
  color: var(--cyan);
  background: rgba(0, 242, 254, 0.12);
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  border: 1px solid rgba(0, 242, 254, 0.3);
  font-weight: 700;
}

/* Metric Callout Box */
.metric-box {
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid var(--cyan);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-val {
  font-family: var(--font-code);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--cyan);
}

/* Simulators Box */
.sim-box {
  background: rgba(4, 7, 20, 0.95);
  border: 1px solid var(--cyan);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 14px;
  border-radius: 8px;
}

.sim-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sim-slider {
  flex: 1;
  accent-color: var(--cyan);
  height: 5px;
  border-radius: 3px;
  cursor: pointer;
}

.sim-val {
  font-family: var(--font-code);
  font-weight: 700;
  color: var(--cyan);
  font-size: 0.9rem;
}

.sim-canvas {
  width: 100%;
  height: 150px;
  background: #02040b;
  border-radius: 8px;
  border: 1px solid rgba(0, 242, 254, 0.25);
}

/* Heart Ejection Fraction Animation Box */
.cardiac-sim-wrap {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
}

.heart-svg-box {
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.heart-svg {
  width: 90px;
  height: 90px;
  fill: var(--crimson);
  filter: drop-shadow(0 0 15px var(--crimson-glow));
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Compact Pipeline Rows (Slide 8 Process Steps) */
.timeline-pipeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.timeline-step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 10px;
  padding: 8px 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.timeline-step-row:hover, .timeline-step-row.active {
  border-color: var(--cyan);
  box-shadow: 0 0 14px var(--cyan-glow);
  transform: translateX(3px);
}

.step-num-pill {
  font-family: var(--font-code);
  font-size: 1rem;
  font-weight: 800;
  color: var(--cyan);
  padding: 3px 8px;
  background: rgba(0, 242, 254, 0.12);
  border-radius: 6px;
  border: 1px solid rgba(0, 242, 254, 0.3);
  flex-shrink: 0;
}

.step-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.step-title-text {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
}

.step-desc-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Bottom Controls Dock Bar */
.bottom-dock {
  height: 52px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(4, 7, 20, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 242, 254, 0.15);
  z-index: 100;
  position: relative;
  flex-shrink: 0;
}

.dock-left, .dock-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dock-center {
  display: flex;
  align-items: center;
  gap: 14px;
}

.slide-counter {
  font-family: var(--font-code);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
  padding: 4px 14px;
  background: rgba(0, 242, 254, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

/* Modal Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 4, 12, 0.92);
  backdrop-filter: blur(24px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 90%;
  max-width: 1050px;
  max-height: 85vh;
  background: #0b1329;
  border: 1px solid var(--cyan);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: #fff;
  font-weight: 800;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  overflow-y: auto;
}

.overview-thumb {
  aspect-ratio: 16/9;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.overview-thumb:hover, .overview-thumb.active {
  border-color: var(--cyan);
  box-shadow: 0 0 15px var(--cyan-glow);
  transform: scale(1.02);
}

.thumb-num {
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: var(--cyan);
  font-weight: 700;
}

.thumb-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

/* Printable PDF Layout */
@media print {
  @page {
    size: 16/9 landscape;
    margin: 0;
  }
  
  body, html {
    background: #040714 !important;
    overflow: visible !important;
    height: auto !important;
  }

  .top-bar, .bottom-dock, #bg-canvas, .modal-overlay {
    display: none !important;
  }

  .app-container, .slides-viewport {
    height: auto !important;
    overflow: visible !important;
  }


  .slide {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    page-break-after: always !important;
    height: 100vh !important;
    max-height: 100vh !important;
    padding: 20px 30px !important;
    pointer-events: auto !important;
  }
}

/* Dense Layout Helpers & Fill Components */
.card-fill {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.dense-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 0.82rem;
}

.dense-table th, .dense-table td {
  padding: 6px 10px;
  border: 1px solid rgba(0, 242, 254, 0.2);
  text-align: left;
}

.dense-table th {
  background: rgba(0, 242, 254, 0.12);
  color: var(--cyan);
  font-family: var(--font-code);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.dense-table td {
  color: #cbd5e1;
  background: rgba(4, 7, 20, 0.5);
}

.info-banner {
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.12), rgba(37, 99, 235, 0.12));
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #e2e8f0;
  margin-top: auto;
}

.info-banner-crimson {
  background: linear-gradient(90deg, rgba(255, 51, 102, 0.12), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(255, 51, 102, 0.35);
}

.stat-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.stat-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-code);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cyan);
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.chip-cyan {
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--cyan);
}

