@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=VT323&display=swap');

:root {
  /* Dynamic values updated by JS based on slide */
  --glow-color-1: rgba(30, 41, 59, 0.5);
  --glow-color-2: rgba(15, 23, 42, 0.8);
  --accent-glow: rgba(59, 130, 246, 0.4);
  
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'VT323', monospace;
  
  --bg-color: #080c14;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  
  --transition-speed: 0.8s;
  --transition-ease: cubic-bezier(0.25, 1, 0.5, 1);
}

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

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

/* Ambient Background Glow */
.ambient-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: linear-gradient(135deg, var(--glow-color-1) 0%, var(--glow-color-2) 100%);
  transition: background var(--transition-speed) var(--transition-ease);
}

.ambient-background::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 60%);
  filter: blur(100px);
  opacity: 0.6;
  z-index: 2;
  pointer-events: none;
  animation: float-glow 20s infinite alternate ease-in-out;
  transition: background var(--transition-speed) var(--transition-ease),
              radial-gradient var(--transition-speed) var(--transition-ease);
}

@keyframes float-glow {
  0% { transform: translate(-5%, -5%) scale(1); }
  100% { transform: translate(5%, 5%) scale(1.1); }
}

/* App Logo and Navigation Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  pointer-events: none;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(to right, #6366f1, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  pointer-events: auto;
}

.logo span {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-left: 8px;
  text-transform: uppercase;
}

.help-hint {
  font-size: 14px;
  color: var(--text-secondary);
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px rgba(255, 255, 255, 0.1) solid;
  backdrop-filter: blur(5px);
}

/* Main Container and Slides */
main {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-speed) var(--transition-ease),
              visibility var(--transition-speed) var(--transition-ease);
}

.slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Left Content Column */
.slide-content-col {
  padding: 120px 60px 80px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  backdrop-filter: none;
  border-right: none;
  z-index: 5;
  overflow-y: auto;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera to keep the screen merged seamlessly */
.slide-content-col::-webkit-scrollbar {
  display: none;
}

/* Slide Content Animations */
.slide-content-col > * {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.6s var(--transition-ease),
              opacity 0.6s var(--transition-ease);
}

.slide.active .slide-content-col > * {
  transform: translateY(0);
  opacity: 1;
}

.slide.active .slide-content-col > *:nth-child(1) { transition-delay: 0.1s; }
.slide.active .slide-content-col > *:nth-child(2) { transition-delay: 0.2s; }
.slide.active .slide-content-col > *:nth-child(3) { transition-delay: 0.3s; }
.slide.active .slide-content-col > *:nth-child(4) { transition-delay: 0.4s; }
.slide.active .slide-content-col > *:nth-child(5) { transition-delay: 0.5s; }

.slide-tag {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #a855f7;
  font-weight: 600;
  margin-bottom: 12px;
}

.slide-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.slide-description {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Interactive Widget Containers */
.interactive-widget {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin-top: auto;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.interactive-widget:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Right Visual Column */
.slide-visual-col {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

.slide-image-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  /* Use linear gradient mask to fade the left side of the visual wrapper */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.05) 10%, black 75%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.05) 10%, black 75%);
}

/* Edge blending and theme-color grading overlay */
.slide-image-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    /* Top & bottom edge fades */
    linear-gradient(to bottom, var(--glow-color-2) 0%, transparent 15%, transparent 85%, var(--glow-color-2) 100%),
    /* Right edge fade */
    linear-gradient(to left, var(--glow-color-2) 0%, transparent 15%),
    /* Ambient color tint overlay (soft glow-color-2 wash) */
    radial-gradient(circle at center, transparent 40%, var(--glow-color-2) 100%);
  pointer-events: none;
  z-index: 2;
  transition: background var(--transition-speed) var(--transition-ease);
}

.slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  filter: brightness(0.85) contrast(1.1) saturate(0.9);
  transition: opacity var(--transition-speed) var(--transition-ease);
}

.slide.active .slide-image {
  animation: slide-ken-burns 30s infinite alternate ease-in-out;
}

@keyframes slide-ken-burns {
  0% {
    transform: scale(1.02) translate(0, 0);
  }
  50% {
    transform: scale(1.07) translate(-1%, 0.5%);
  }
  100% {
    transform: scale(1.02) translate(0.5%, -0.5%);
  }
}

/* Overlays inside Visual side */
.visual-caption {
  position: absolute;
  bottom: 40px;
  left: 40px;
  right: 40px;
  background: rgba(8, 12, 20, 0.75);
  backdrop-filter: blur(16px);
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 500px;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-speed) var(--transition-ease), opacity var(--transition-speed) var(--transition-ease);
}

.visual-caption p {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

/* Slide 3 Widget: AI Avatar Question */
.avatar-checkin {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
  animation: avatar-float 3s ease-in-out infinite alternate;
}

@keyframes avatar-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.avatar-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-primary);
  position: relative;
}

.avatar-bubble::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 18px;
  border-width: 4px 8px 4px 0;
  border-style: solid;
  border-color: transparent rgba(255, 255, 255, 0.05) transparent transparent;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
}

.option-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: #a855f7;
  transform: translateX(4px);
}

/* Slide 4 Widget: Mood Gradient Creator */
.gradient-builder {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gradient-preview-card {
  height: 90px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.5s ease;
  position: relative;
  overflow: hidden;
}

.gradient-preview-card .card-text {
  font-size: 13px;
  font-weight: 500;
  z-index: 2;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.gradient-preview-card .card-reactions {
  font-size: 12px;
  z-index: 2;
  display: flex;
  gap: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.glow-bubble-spawner {
  position: absolute;
  bottom: 8px;
  right: 12px;
  z-index: 5;
  cursor: pointer;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  transition: transform 0.2s;
}

.glow-bubble-spawner:active {
  transform: scale(0.9);
}

.floating-bubble {
  position: absolute;
  pointer-events: none;
  font-size: 14px;
  bottom: 20px;
  right: 20px;
  animation: bubble-up 1.5s forwards ease-out;
}

@keyframes bubble-up {
  0% { transform: translateY(0) scale(0.8); opacity: 1; }
  100% { transform: translateY(-60px) scale(1.4); opacity: 0; }
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-row label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mood-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.mood-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #06b6d4;
  cursor: pointer;
  transition: transform 0.2s;
}

.mood-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Slide 5 Widget: Letter Writer */
.bottle-writer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.letter-prompt-selector {
  display: flex;
  gap: 8px;
}

.prompt-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-tag.selected {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
}

.letter-textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  resize: none;
  height: 80px;
  outline: none;
  transition: border-color 0.3s;
}

.letter-textarea:focus {
  border-color: #8b5cf6;
}

.send-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 10px;
  color: white;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.send-btn:active {
  transform: translateY(0);
}

/* Floating Controls (Page Navigation) */
.controls-overlay {
  position: fixed;
  bottom: 40px;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 100;
}

.nav-arrows {
  display: flex;
  gap: 12px;
}

.nav-arrow {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  transition: all 0.3s ease;
}

.nav-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.nav-arrow:active:not(:disabled) {
  transform: translateY(0);
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Navigation Indicator (Dots) */
.nav-dots {
  position: fixed;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 100;
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-dot::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.nav-dot.active {
  background: var(--text-primary);
  transform: scale(1.3);
}

.nav-dot.active::after {
  border-color: var(--text-primary);
}

.nav-dot-label {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(8, 12, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}

.nav-dot:hover .nav-dot-label {
  opacity: 1;
  visibility: visible;
  left: 20px;
}

/* Responsive Layout */
@media (max-width: 960px) {
  .slide {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  
  .slide-content-col {
    padding: 80px 32px 32px 32px;
    border-right: none;
    border-bottom: none;
  }
  
  .slide-visual-col {
    height: 100%;
  }

  .slide-image-wrapper {
    /* Fade the top side of the visual wrapper on mobile */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.05) 10%, black 75%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.05) 10%, black 75%);
  }
  
  .nav-dots {
    display: none; /* Hide dots on mobile to clean up layout */
  }
  
  .controls-overlay {
    bottom: 20px;
    right: 20px;
  }
  
  .visual-caption {
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding: 12px 16px;
  }
  
  .visual-caption p {
    font-size: 16px;
  }
}
