/* ═══════════════════════════════════════════════════════════════
   DataBeta AI Bootcamp — Standalone Presentation Styles
   Dark theme, full-viewport slides, print-to-PDF support
   ═══════════════════════════════════════════════════════════════ */

/* ─── Variables (shared with main theme) ─── */
:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --bg-main: #0c0c14;
  --bg-card: #141420;
  --bg-card-hover: #1a1a2e;
  --border-default: rgba(255,255,255,.06);
  --border-accent: rgba(255,255,255,.1);

  --text-primary: #e4e4ed;
  --text-secondary: #b0b0c8;
  --text-muted: #5e5e76;

  --accent-indigo: hsl(239,84%,67%);
  --accent-emerald: hsl(160,84%,39%);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --transition-base: .18s ease;
}

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-primary);
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════ */

.pres-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(12,12,20,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.pres-topbar-left,
.pres-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pres-topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.pres-logo {
  height: 22px;
  opacity: .8;
}

.pres-module-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .3px;
}

.pres-slide-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.pres-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-accent);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
}
.pres-btn:hover {
  background: rgba(255,255,255,.08);
  color: var(--text-primary);
  border-color: rgba(255,255,255,.15);
}

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════ */

.pres-progress-track {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,.04);
  z-index: 99;
}

.pres-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-emerald));
  transition: width .35s cubic-bezier(.25,.8,.25,1);
  border-radius: 0 2px 2px 0;
}

/* ═══════════════════════════════════════════════════════════════
   SLIDE VIEWPORT
   ═══════════════════════════════════════════════════════════════ */

.pres-viewport {
  position: fixed;
  top: 51px; /* topbar + progress */
  left: 0;
  right: 0;
  bottom: 56px; /* nav height */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  overflow: hidden;
}

/* Loading */
.pres-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.pres-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-accent);
  border-top-color: var(--accent-indigo);
  border-radius: 50%;
  animation: pres-spin .8s linear infinite;
}

@keyframes pres-spin {
  to { transform: rotate(360deg); }
}

/* ─── Slide Card (fixed 16:9 like PowerPoint) ─── */
.pres-slide {
  display: none;
  /* Fill the viewport but maintain 16:9 */
  width: 100%;
  height: 100%;
}

.pres-slide.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes pres-fade-in {
  from { opacity: 0; transform: scale(.98); }
  to { opacity: 1; transform: scale(1); }
}

.pres-slide-inner {
  /* Fixed 16:9 aspect ratio frame */
  aspect-ratio: 16 / 9;
  height: 100%;
  max-height: calc(100vh - 51px - 56px - 32px);
  max-width: calc((100vh - 51px - 56px - 32px) * 16 / 9);
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  animation: pres-fade-in .3s ease;
  /* Subtle scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

.pres-slide-inner::-webkit-scrollbar {
  width: 4px;
}

.pres-slide-inner::-webkit-scrollbar-track {
  background: transparent;
}

.pres-slide-inner::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.08);
  border-radius: 2px;
}

/* Slide number badge */
.pres-slide-number {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* Typography */
.pres-slide-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.2;
}

.pres-slide-subtitle {
  font-size: 15px;
  color: var(--accent-indigo);
  font-weight: 600;
  margin-bottom: 24px;
}

.pres-slide-content p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Key points */
.pres-key-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
}

.pres-key-point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(99,102,241,.05);
  border-left: 3px solid var(--accent-indigo);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.pres-key-point::before {
  content: '→';
  color: var(--accent-indigo);
  font-weight: 700;
  flex-shrink: 0;
}

/* AI Context callout */
.pres-ai-context {
  margin: 20px 0;
  padding: 14px 18px;
  background: rgba(16,185,129,.06);
  border: 1px solid rgba(16,185,129,.15);
  border-radius: var(--radius-md);
}

.pres-ai-context-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent-emerald);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pres-ai-context p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Checklist grid */
.pres-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.pres-checklist-group {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
}

.pres-checklist-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.pres-checklist-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pres-checklist-group li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.pres-checklist-group li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-emerald);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   VISUAL ELEMENTS — Images, Highlights, Stats
   ═══════════════════════════════════════════════════════════════ */

/* Slide image */
.pres-image-wrapper {
  margin: 20px 0;
  text-align: center;
}

.pres-image {
  max-width: 100%;
  max-height: 340px;
  border-radius: var(--radius-md);
  object-fit: contain;
  animation: pres-image-enter .6s ease .15s both;
}

@keyframes pres-image-enter {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

.pres-image-caption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Highlight cards */
.pres-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.pres-highlight-card {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  transition: all .25s ease;
  animation: pres-card-enter .5s ease both;
}

.pres-highlight-card:nth-child(1) { animation-delay: .1s; }
.pres-highlight-card:nth-child(2) { animation-delay: .2s; }
.pres-highlight-card:nth-child(3) { animation-delay: .3s; }
.pres-highlight-card:nth-child(4) { animation-delay: .4s; }
.pres-highlight-card:nth-child(5) { animation-delay: .5s; }
.pres-highlight-card:nth-child(6) { animation-delay: .6s; }

@keyframes pres-card-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.pres-highlight-card:hover {
  border-color: var(--accent-indigo);
  background: rgba(99,102,241,.04);
  transform: translateY(-2px);
}

.pres-highlight-icon {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}

.pres-highlight-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pres-highlight-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Stat counters */
.pres-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.pres-stat {
  text-align: center;
  animation: pres-stat-enter .5s ease both;
}

.pres-stat:nth-child(1) { animation-delay: .15s; }
.pres-stat:nth-child(2) { animation-delay: .3s; }
.pres-stat:nth-child(3) { animation-delay: .45s; }
.pres-stat:nth-child(4) { animation-delay: .6s; }

@keyframes pres-stat-enter {
  from { opacity: 0; transform: scale(.7); }
  to { opacity: 1; transform: scale(1); }
}

.pres-stat-value {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.pres-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Staggered key points animation */
.pres-key-point {
  animation: pres-card-enter .4s ease both;
}
.pres-key-point:nth-child(1) { animation-delay: .1s; }
.pres-key-point:nth-child(2) { animation-delay: .2s; }
.pres-key-point:nth-child(3) { animation-delay: .3s; }
.pres-key-point:nth-child(4) { animation-delay: .4s; }
.pres-key-point:nth-child(5) { animation-delay: .5s; }

/* ═══════════════════════════════════════════════════════════════
   CODE BLOCKS (reuse shared styles from main theme)
   ═══════════════════════════════════════════════════════════════ */

.code-wrapper {
  background: #0a0a12;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin: 16px 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border-default);
  font-size: 12px;
  color: var(--text-muted);
}

.code-title {
  font-weight: 600;
  color: var(--text-secondary);
}

.code-lang {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 6px;
  background: rgba(99,102,241,.1);
  color: var(--accent-indigo);
  border-radius: 4px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-base);
}
.copy-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.copy-btn.copied { color: var(--accent-emerald); border-color: var(--accent-emerald); }

.code-wrapper pre {
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.code-wrapper code { font-family: inherit; }

/* Syntax tokens */
.tok-comment  { color: #6a6a86; font-style: italic; }
.tok-string   { color: #a5d6a7; }
.tok-keyword  { color: #c792ea; font-weight: 600; }
.tok-function { color: #82aaff; }
.tok-flag     { color: #f0c674; }
.tok-variable { color: #ff7043; }
.tok-operator { color: #89ddff; }
.tok-number   { color: #f78c6c; }

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION BAR
   ═══════════════════════════════════════════════════════════════ */

.pres-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(12,12,20,.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 20px;
  z-index: 100;
}

.pres-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}
.pres-nav-btn:hover {
  background: rgba(255,255,255,.08);
  color: var(--text-primary);
  border-color: rgba(255,255,255,.15);
}
.pres-nav-btn:disabled {
  opacity: .3;
  cursor: default;
}

.pres-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pres-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-accent);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  padding: 0;
}
.pres-dot:hover { background: var(--text-muted); }
.pres-dot.active {
  background: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
  transform: scale(1.3);
}

/* ═══════════════════════════════════════════════════════════════
   PRINT CONTAINER (hidden in screen, shown in print)
   ═══════════════════════════════════════════════════════════════ */

.pres-print-all {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   PDF SLIDE RENDERING
   ═══════════════════════════════════════════════════════════════ */

/* PDF slides use the same hidden/shown behavior as regular .pres-slide */

.pres-slide-pdf.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pres-pdf-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  animation: pres-fade-in .3s ease;
}

.pres-pdf-canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,.4), 0 0 0 1px var(--border-accent);
  /* Crisp rendering for text */
  image-rendering: auto;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .pres-slide-inner { padding: 28px 28px; }
  .pres-slide-title { font-size: 22px; }
  .pres-viewport { padding: 8px 12px; }
  .pres-topbar-center { display: none; }
  .pres-pdf-canvas { border-radius: var(--radius-sm); }
}

@media (max-width: 480px) {
  .pres-slide-inner { padding: 20px 18px; }
  .pres-slide-title { font-size: 18px; }
  .pres-key-point { font-size: 13px; padding: 8px 10px; }
  .pres-viewport { padding: 4px 6px; }
}

.pres-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES — renders ALL slides, white background, one per page
   ═══════════════════════════════════════════════════════════════ */

@media print {
  /* Reset page */
  @page {
    size: A4 landscape;
    margin: 1.5cm;
  }

  html, body {
    height: auto;
    overflow: visible;
    background: #fff;
    color: #1a1a1a;
    font-size: 12pt;
  }

  /* Hide UI chrome */
  .pres-topbar,
  .pres-progress-track,
  .pres-nav,
  .pres-viewport,
  .pres-loading {
    display: none !important;
  }

  /* Show print container */
  .pres-print-all {
    display: block !important;
  }

  .print-slide {
    page-break-after: always;
    page-break-inside: avoid;
    padding: 0;
    margin: 0;
  }

  .print-slide:last-child {
    page-break-after: auto;
  }

  .print-slide-inner {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 32px 40px;
    margin-bottom: 0;
  }

  /* Print typography */
  .print-slide-number {
    font-size: 10pt;
    color: #999;
    font-weight: 700;
    text-align: right;
    margin-bottom: 8px;
  }

  .print-slide-title {
    font-size: 22pt;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 4px;
  }

  .print-slide-subtitle {
    font-size: 12pt;
    color: #4c4cc9;
    font-weight: 600;
    margin-bottom: 16px;
  }

  .print-slide-content p {
    font-size: 11pt;
    line-height: 1.6;
    color: #333;
    margin-bottom: 8px;
  }

  .print-key-point {
    padding: 6px 10px;
    border-left: 3px solid #4c4cc9;
    margin-bottom: 6px;
    font-size: 10pt;
    color: #333;
    background: #f5f5ff;
  }

  .print-ai-context {
    padding: 10px 14px;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    background: #f1f8e9;
    margin: 12px 0;
  }

  .print-ai-context-title {
    font-size: 9pt;
    font-weight: 700;
    color: #2e7d32;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .print-ai-context p {
    font-size: 10pt;
    color: #333;
  }

  /* Print code blocks */
  .code-wrapper {
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 10px 0;
    break-inside: avoid;
  }

  .code-header {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    color: #666;
  }

  .copy-btn { display: none !important; }

  .code-wrapper pre {
    background: #fafafa;
    color: #333;
    font-size: 9pt;
    line-height: 1.5;
  }

  /* Print syntax tokens */
  .tok-comment  { color: #888; }
  .tok-string   { color: #2e7d32; }
  .tok-keyword  { color: #7b1fa2; }
  .tok-function { color: #1565c0; }
  .tok-flag     { color: #f57f17; }
  .tok-variable { color: #d84315; }
  .tok-operator { color: #00838f; }
  .tok-number   { color: #e65100; }

  /* Print footer branding */
  .print-footer {
    text-align: center;
    font-size: 8pt;
    color: #999;
    margin-top: 16px;
    border-top: 1px solid #eee;
    padding-top: 8px;
  }

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

  .pres-checklist-group {
    background: #f9f9f9;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  .pres-checklist-group-title { color: #1a1a1a; }
  .pres-checklist-group li { color: #333; }
  .pres-checklist-group li::before { color: #2e7d32; }

  .code-lang {
    background: #e8eaf6;
    color: #3949ab;
  }
}
