/* ============================================
   Session Presentation v0 — Custom Styles
   Responsive-first: BYOL + fluid CSS + container queries
   ============================================ */

/* ---------- Global Overrides ---------- */
:root {
  --accent: #42affa;
  --accent-glow: rgba(66, 175, 250, 0.3);
  --accent-2: #f97316;
  --accent-3: #a78bfa;
  --bg-dark: #0f0f1a;
  --bg-card: #1a1a2e;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Fluid Typography */
  --fs-hero: clamp(2rem, 5vw + 1rem, 4.5rem);
  --fs-h1: clamp(1.75rem, 3.5vw + 0.5rem, 3rem);
  --fs-h2: clamp(1.25rem, 2.5vw + 0.5rem, 2.2rem);
  --fs-h3: clamp(1rem, 1.5vw + 0.5rem, 1.5rem);
  --fs-body: clamp(0.875rem, 1vw + 0.25rem, 1.1rem);
  --fs-small: clamp(0.75rem, 0.8vw + 0.25rem, 0.9rem);
  --fs-xs: clamp(0.625rem, 0.6vw + 0.2rem, 0.8rem);
  --fs-stat: clamp(1.5rem, 4vw + 0.5rem, 2.8rem);

  /* Fluid Spacing */
  --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
  --space-sm: clamp(0.5rem, 1vw, 1rem);
  --space-md: clamp(1rem, 2vw, 2rem);
  --space-lg: clamp(1.5rem, 3vw, 3rem);
  --space-xl: clamp(2rem, 4vw, 4rem);
  --slide-pad: clamp(1rem, 3vw, 3.75rem);
}

.reveal {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.reveal .slides {
  text-align: left;
}

/* ---------- BYOL Slide Layout ---------- */
.reveal .slides section {
  padding: var(--slide-pad);
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  overflow-y: auto;
  container-type: inline-size;
}

/* Scroll indicator for overflowing slides */
.reveal .slides section.has-overflow::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--bg-dark));
  pointer-events: none;
  z-index: 10;
}

/* ---------- Typography ---------- */
.reveal h1, .reveal h2, .reveal h3 {
  text-transform: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.reveal h1 { font-size: var(--fs-h1); }
.reveal h2 { font-size: var(--fs-h2); }
.reveal h3 { font-size: var(--fs-h3); color: var(--accent); }

.reveal p, .reveal li {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text-main);
  text-wrap: pretty;
}

.reveal ul { list-style: none; padding-left: 0; }
.reveal ul li { padding: var(--space-xs) 0; padding-left: 1.5em; position: relative; }
.reveal ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* ---------- Hero Slide ---------- */
.hero-title {
  font-size: var(--fs-hero);
  font-weight: 800;
  background: linear-gradient(135deg, #42affa, #a78bfa, #f97316);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
  width: 100%;
  overflow: hidden;
  word-break: break-word;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: var(--fs-h3);
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.hero-meta {
  margin-top: var(--space-lg);
  font-size: var(--fs-small);
  color: var(--text-muted);
  opacity: 0.7;
}

/* ---------- Interactive Buttons ---------- */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  border: none;
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin: var(--space-xs);
  font-family: inherit;
  min-height: 44px;
  min-width: 44px;
}

.btn-primary {
  background: var(--accent);
  color: #0f0f1a;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #0f0f1a;
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent);
}

.btn-large {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--fs-body);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: var(--transition);
  cursor: default;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.card h4 {
  color: var(--accent);
  font-size: var(--fs-h3);
  margin: 0 0 var(--space-xs) 0;
}
.card p {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ---------- Interactive Card (clickable, flippable) ---------- */
.flip-card {
  perspective: 1000px;
  min-height: 220px;
  cursor: pointer;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}
.flip-card-front {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
}
.flip-card-back {
  background: linear-gradient(135deg, #1a1a2e, #2a1a3e);
  border: 1px solid var(--accent-3);
  transform: rotateY(180deg);
}
.flip-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: auto;
  opacity: 0.5;
}

/* ---------- Diagram / Flow ---------- */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
  flex-wrap: wrap;
}

.flow-step {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  min-width: min(140px, 100%);
  flex: 1 1 auto;
  transition: var(--transition);
  min-height: 44px;
}
.flow-step.active {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.flow-step .step-icon {
  font-size: var(--fs-h2);
  margin-bottom: var(--space-xs);
}
.flow-step .step-label {
  font-size: var(--fs-xs);
  color: var(--text-main);
  font-weight: 600;
}

.flow-arrow {
  color: var(--accent);
  font-size: var(--fs-h2);
  opacity: 0.5;
}

/* ---------- Progress Bar ---------- */
.progress-bar-container {
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  height: 12px;
  overflow: hidden;
  margin: var(--space-sm) 0;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Stat Counter ---------- */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin: var(--space-md) 0;
  justify-content: center;
}
.stat {
  text-align: center;
  flex: 1 1 auto;
  min-width: min(150px, 100%);
}
.stat-number {
  font-size: var(--fs-stat);
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ---------- Code Blocks ---------- */
.prompt-example {
  background: #1e1e2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: var(--space-md);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: var(--fs-xs);
  line-height: 1.8;
  color: var(--text-main);
  position: relative;
  overflow-x: auto;
  margin: var(--space-sm) 0;
}
.prompt-example .prompt-label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: var(--fs-xs);
  color: var(--accent);
  font-family: inherit;
  opacity: 0.6;
}
.prompt-example .good { color: #4ade80; }
.prompt-example .bad { color: #f87171; }
.prompt-example .highlight { color: var(--accent); font-weight: 600; }

/* ---------- Comparison (Good vs Bad) ---------- */
.comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0;
}
.comparison-col {
  border-radius: var(--radius);
  padding: var(--space-md);
}
.comparison-col.good-col {
  background: rgba(74, 222, 128, 0.06);
  border: 1px solid rgba(74, 222, 128, 0.2);
}
.comparison-col.bad-col {
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.comparison-col h4 {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--fs-body);
}
.comparison-col.good-col h4 { color: #4ade80; }
.comparison-col.bad-col h4 { color: #f87171; }
.comparison-col p, .comparison-col code {
  font-size: var(--fs-small);
  line-height: 1.6;
}

/* ---------- Tag / Pill ---------- */
.tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 600;
  margin: 3px;
}
.tag-blue { background: rgba(66, 175, 250, 0.15); color: var(--accent); }
.tag-orange { background: rgba(249, 115, 22, 0.15); color: var(--accent-2); }
.tag-purple { background: rgba(167, 139, 250, 0.15); color: var(--accent-3); }
.tag-green { background: rgba(74, 222, 128, 0.15); color: #4ade80; }

/* ---------- Tooltip ---------- */
.tooltip-trigger {
  border-bottom: 2px dashed var(--accent);
  cursor: help;
  position: relative;
}
.tooltip-trigger:hover .tooltip-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #2a2a3e;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: var(--space-sm);
  font-size: var(--fs-xs);
  width: 250px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 100;
  text-align: center;
  color: var(--text-main);
}

/* ---------- Animated Entry ---------- */
.slide-in-left {
  animation: slide-in-left 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

.fade-up {
  animation: fade-up 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.scale-in {
  animation: scale-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Pulse Glow ---------- */
.glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 5px var(--accent-glow); }
  50% { box-shadow: 0 0 25px var(--accent-glow), 0 0 50px rgba(66, 175, 250, 0.1); }
}

/* ---------- Typing Effect ---------- */
.typing-text {
  border-right: 2px solid var(--accent);
  white-space: nowrap;
  overflow: hidden;
  animation: typing-cursor 0.8s step-end infinite;
}
@keyframes typing-cursor {
  from, to { border-color: var(--accent); }
  50% { border-color: transparent; }
}

/* ---------- Section Divider ---------- */
.section-divider {
  text-align: center;
  align-items: center;
}
.section-divider h2 {
  font-size: var(--fs-h1);
}
.section-number {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  color: var(--accent);
  opacity: 0.2;
  line-height: 1;
  margin-bottom: calc(var(--space-sm) * -1);
  width: 100%;
}

/* ---------- Live Demo Indicator ---------- */
.live-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 20px;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--fs-xs);
  color: #f87171;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.live-dot {
  width: 8px;
  height: 8px;
  background: #f87171;
  border-radius: 50%;
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---------- Q&A Slide ---------- */
.qa-container {
  text-align: center;
  padding: var(--space-xl) 0;
  align-items: center;
}
.qa-icon {
  font-size: clamp(2.5rem, 6vw, 5rem);
  margin-bottom: var(--space-md);
  animation: float 3s ease-in-out infinite;
  width: 100%;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* ---------- Tool Grid ---------- */
.tool-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition);
  cursor: pointer;
  min-height: 44px;
}
.tool-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.tool-icon {
  font-size: var(--fs-h2);
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.tool-info h5 {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--text-main);
}
.tool-info p {
  margin: 2px 0 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ---------- Navigation Dots Custom ---------- */
.reveal .progress { height: 3px; }
.reveal .progress span { background: var(--accent); }

/* ---------- Container Queries ---------- */
@container (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .comparison {
    grid-template-columns: 1fr;
  }
  .stats-row {
    flex-direction: column;
    gap: var(--space-md);
  }
  .flow-diagram {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-arrow {
    transform: rotate(90deg);
    text-align: center;
  }
  .flow-step {
    min-width: 100%;
  }
}

@container (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Fallback for browsers without container queries */
@supports not (container-type: inline-size) {
  @media (max-width: 600px) {
    .card-grid {
      grid-template-columns: 1fr;
    }
    .comparison {
      grid-template-columns: 1fr;
    }
    .stats-row {
      flex-direction: column;
      gap: var(--space-md);
    }
    .flow-diagram {
      flex-direction: column;
      align-items: stretch;
    }
    .flow-arrow {
      transform: rotate(90deg);
      text-align: center;
    }
  }
}
