/* Cinematic Presentation Engine - Main Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-core: #07090e;
  --bg-surface: #0e131d;
  --bg-elevated: #161c28;
  --bg-glass: rgba(14, 19, 29, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-glow: rgba(6, 182, 212, 0.25);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --shadow-cinematic: 0 30px 90px rgba(0, 0, 0, 0.8), 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 50px var(--accent-glow);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-core);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   CINEMATIC PRESENTATION STAGE (/gp)
   Zero overlays, full immersion
   ========================================================================== */

.presentation-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 50%, #0d121c 0%, #06080d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  perspective: 1500px;
  perspective-origin: 50% 50%;
}

/* Subtle ambient stage lighting */
.ambient-lighting {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(14, 165, 233, 0.04) 0%, transparent 70%),
    radial-gradient(circle at 20% 80%, rgba(245, 158, 11, 0.02) 0%, transparent 50%);
  z-index: 1;
}

/* 3D Slide Stage */
.slide-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 2;
}

/* Individual Slide Card */
.slide-card {
  position: absolute;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  box-shadow: var(--shadow-cinematic);
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
  transition: transform 0.05s ease-out; /* Smooth mouse parallax */
  overflow: hidden;
  background: #000;
}

.slide-card canvas,
.slide-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 4px;
}

/* Specular anamorphic lens shine overlay */
.slide-specular {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 65%
  );
  transform: translateX(-150%);
  z-index: 5;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-card.active .slide-specular {
  transform: translateX(150%);
}

/* ==========================================================================
   HALF-TRANSPARENT FULLSCREEN BUTTON (Bottom-Right)
   Clean, frosted glass, zero visual intrusion
   ========================================================================== */

.fullscreen-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(14, 19, 29, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  outline: none;
  opacity: 0.35;
  transform: scale(1);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.3s ease,
              border-color 0.3s ease,
              color 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.fullscreen-trigger:hover,
.fullscreen-trigger:focus-visible {
  opacity: 0.95;
  transform: scale(1.08);
  color: #fff;
  background: rgba(22, 28, 40, 0.8);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

.fullscreen-trigger:active {
  transform: scale(0.94);
}

.fullscreen-trigger svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

/* Subtle Idle Mode - cursor and UI auto-soften */
body.idle-mode {
  cursor: none !important;
}

body.idle-mode .fullscreen-trigger {
  opacity: 0.08 !important;
  pointer-events: auto;
}

/* ==========================================================================
   MINIMAL LOADING & ERROR OVERLAYS (Only shown when loading)
   ========================================================================== */

.stage-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #07090e;
  z-index: 100;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.stage-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-cyan);
  border-right-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.9s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.loader-text {
  margin-top: 20px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.loader-progress-bar {
  width: 180px;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  margin-top: 14px;
  overflow: hidden;
  position: relative;
}

.loader-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 3px;
  transition: width 0.25s ease-out;
}

/* Discreet notification toast (e.g. "Presentation Ready", "Slide 3/14") */
.discreet-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(14, 19, 29, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.discreet-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Discreet shortcut guide toggle (Press '?' to show) */
.discreet-help {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.discreet-help.show {
  opacity: 1;
  visibility: visible;
}

.discreet-help-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-cinematic);
}

.discreet-help-box h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.help-row:last-child {
  border-bottom: none;
}

.help-key {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
