@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #FAFAF8;
  --bg-warm: #FFF8F0;
  --text: #1A1A2E;
  --text-light: #555;
  --green: #2D6A4F;
  --green-light: #40916C;
  --orange: #E76F51;
  --coral: #F4845F;
  --yellow: #F7DC6F;
  --blue: #457B9D;
  --teal: #2A9D8F;
  --radius: 16px;
}

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

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Progress Bar */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 4px;
  background: linear-gradient(90deg, var(--green), var(--teal));
  transition: width 0.4s ease; z-index: 100;
}

/* Slide Container */
.deck { position: relative; width: 100vw; height: 100vh; }

.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 80px 140px;
  opacity: 0; transform: translateX(60px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  text-align: center;
}
.slide.active {
  opacity: 1; transform: translateX(0);
  pointer-events: auto;
}
.slide.prev {
  opacity: 0; transform: translateX(-60px);
}

/* Slide Visual Area */
.slide-visual {
  flex: 1; display: flex; align-items: center; justify-content: center;
  width: 100%; max-height: 55vh;
}
.slide-visual img {
  max-height: 100%; max-width: 80%; object-fit: contain;
  border-radius: var(--radius);
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.08));
}
.slide-visual .emoji-hero {
  font-size: 120px; line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Typography */
.slide h1 {
  font-size: 3rem; font-weight: 800;
  background: linear-gradient(135deg, var(--green), var(--teal));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 12px; line-height: 1.2;
}
.slide h2 {
  font-size: 2rem; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.slide h3 {
  font-size: 1.3rem; font-weight: 400; color: var(--text-light);
  max-width: 700px; line-height: 1.6;
}
.slide .tag {
  display: inline-block; padding: 6px 18px; border-radius: 50px;
  font-size: 0.85rem; font-weight: 600; margin: 6px 4px;
}
.tag-green { background: #D8F3DC; color: var(--green); }
.tag-orange { background: #FFE8D6; color: var(--orange); }
.tag-blue { background: #D4E8F0; color: var(--blue); }

/* Section Title Slides */
.slide.section-slide {
  background: linear-gradient(135deg, var(--green) 0%, var(--teal) 100%);
}
.slide.section-slide h1 {
  color: #fff; -webkit-text-fill-color: #fff;
  background: none; font-size: 3.2rem;
}
.slide.section-slide h3 { color: rgba(255,255,255,0.8); }
.slide.section-slide .section-num {
  font-size: 5rem; font-weight: 800; color: rgba(255,255,255,0.15);
  position: absolute; top: 40px; right: 60px;
}

/* Cards Grid */
.cards { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.card {
  background: #fff; border-radius: var(--radius);
  padding: 28px 24px; min-width: 200px; flex: 1; max-width: 280px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  border-top: 4px solid var(--green);
  transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-4px); }
.card .card-icon { font-size: 2.5rem; margin-bottom: 12px; }
.card .card-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.card .card-text { font-size: 0.85rem; color: var(--text-light); line-height: 1.5; }
.card.orange-top { border-top-color: var(--orange); }
.card.blue-top { border-top-color: var(--blue); }

/* Five Systems */
.systems { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.system-item {
  background: #fff; border-radius: 12px; padding: 16px 14px;
  width: 140px; text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
}
.system-item:hover { transform: scale(1.05); }
.system-item .sys-icon { font-size: 2rem; margin-bottom: 8px; }
.system-item .sys-name { font-size: 0.8rem; font-weight: 600; }

/* Quote */
.quote {
  font-size: 1.4rem; font-style: italic; font-weight: 300;
  max-width: 650px; line-height: 1.8; color: var(--text);
  position: relative; padding: 0 40px;
}
.quote::before, .quote::after {
  content: '"'; font-size: 4rem; color: var(--green);
  opacity: 0.2; position: absolute; font-style: normal;
  font-weight: 800; line-height: 1;
}
.quote::before { top: -10px; left: 0; }
.quote::after { bottom: -30px; right: 0; content: '"'; }

/* Diagram: Insulin Lock */
.diagram {
  display: flex; align-items: center; gap: 24px;
  background: #fff; border-radius: var(--radius);
  padding: 32px; box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.diagram-step {
  text-align: center; flex: 1;
}
.diagram-step .step-icon { font-size: 2.5rem; margin-bottom: 8px; }
.diagram-step .step-text { font-size: 0.85rem; font-weight: 500; }
.diagram-arrow { font-size: 1.5rem; color: var(--orange); }

/* Footer */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #eee;
  z-index: 50; transition: height 0.3s ease;
}
.footer-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; height: 50px;
}
.nav-buttons { display: flex; align-items: center; gap: 12px; }
.nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #ddd; background: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text);
  transition: all 0.2s ease;
}
.nav-btn:hover { border-color: var(--green); color: var(--green); }
.slide-counter { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }

/* Notes Toggle */
.notes-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--text-light);
}
.toggle-switch {
  width: 40px; height: 22px; border-radius: 11px;
  background: #ddd; cursor: pointer; position: relative;
  transition: background 0.3s ease;
}
.toggle-switch.on { background: var(--green); }
.toggle-switch .toggle-knob {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; position: absolute; top: 2px; left: 2px;
  transition: left 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.on .toggle-knob { left: 20px; }

/* Notes Panel */
.notes-panel {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 24px; background: #FAFAF8;
  border-top: 1px solid #eee;
}
.notes-panel.open {
  max-height: 200px; padding: 16px 24px;
}
.notes-panel p {
  font-size: 0.82rem; color: var(--text-light);
  line-height: 1.7; max-width: 900px;
}

/* Fullscreen button */
.fs-btn {
  background: none; border: 1px solid #ddd; border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font-size: 0.85rem;
  color: var(--text-light); transition: all 0.2s ease;
}
.fs-btn:hover { border-color: var(--green); color: var(--green); }

/* Responsive */
@media (max-width: 768px) {
  .slide { padding: 40px 24px 130px; }
  .slide h1 { font-size: 2rem; }
  .slide h2 { font-size: 1.4rem; }
  .slide h3 { font-size: 1rem; }
  .cards { flex-direction: column; align-items: center; }
  .card { max-width: 100%; }
  .systems { gap: 8px; }
  .system-item { width: 100px; padding: 10px 8px; }
  .diagram { flex-direction: column; gap: 12px; }
  .diagram-arrow { transform: rotate(90deg); }
  .quote { font-size: 1.1rem; padding: 0 20px; }
}
