:root {
  color-scheme: dark;
  --learn-bg: #05060a;
  --learn-ink: rgba(252, 252, 252, 0.94);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.16);
  --accent: #7ef3ff; /* Green/cyan accent from playground */
  --accent-soft: rgba(126, 243, 255, 0.25);
  --accent-hover: rgba(126, 243, 255, 0.15);
  --accent-border: rgba(126, 243, 255, 0.4);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: radial-gradient(circle at 20% 10%, rgba(126, 243, 255, 0.1), transparent 45%), #030308;
  color: var(--learn-ink);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  justify-content: space-between; /* Space between header, content, and footer */
}

/* ==========================================================================
   FIXED 3-COLUMN GRID LAYOUT - ALWAYS VISIBLE CAROUSEL
   ========================================================================== */

/* Main Layout: Fixed 3 columns with independent scrolling & resizable */
.app-container {
  display: grid;
  grid-template-columns: minmax(200px, 300px) auto 1fr auto minmax(280px, 400px);
  grid-template-rows: 80px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  gap: 0;
}

/* Adjust app-container height when footer is expanded */
body.footer-expanded .app-container {
  height: calc(100vh - 350px);
}

/* ==========================================================================
   MOBILE OPTIMIZATION - RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Mobile Portrait - Stack Vertically */
@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr !important;
    grid-template-rows: 60px auto 1fr auto !important;
    position: static;
    height: auto;
    min-height: 100vh;
  }

  .app-header {
    grid-column: 1;
    grid-row: 1;
    padding: 8px 16px;
  }

  .drawer-sidebar {
    grid-column: 1 !important;
    grid-row: 2 !important;
    max-height: 50vh;
    min-height: 300px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
  }

  .resize-handle {
    display: none !important; /* Hide resize handles on mobile */
  }

  .carousel-container,
  .lesson-content-view {
    grid-column: 1 !important;
    grid-row: 3 !important;
    min-height: 60vh;
    overflow-y: auto;
  }

  .rpg-sidebar {
    grid-column: 1 !important;
    grid-row: 4 !important;
    max-height: 50vh;
    min-height: 300px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
  }

  /* Simplify sidebar on mobile */
  .drawer-header h2 {
    font-size: 16px;
  }

  .category-toggle {
    padding: 10px;
    font-size: 12px;
  }

  .lesson-link {
    font-size: 11px;
    padding: 6px 8px;
  }

  /* Carousel cards smaller on mobile */
  .carousel-card {
    padding: 16px !important;
  }

  .card-title {
    font-size: 18px !important;
  }

  .card-meta {
    font-size: 11px !important;
  }

  /* Practice slide buttons stack vertically */
  .practice-slide-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .practice-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Mobile Landscape & Tablet Portrait */
@media (min-width: 769px) and (max-width: 1024px) {
  .app-container {
    grid-template-columns: minmax(200px, 250px) auto 1fr !important;
    grid-template-rows: 60px 1fr;
    position: fixed;
  }

  .drawer-sidebar {
    grid-column: 1 !important;
    grid-row: 2;
  }

  .resize-handle-left {
    grid-column: 2 !important;
  }

  .carousel-container,
  .lesson-content-view {
    grid-column: 3 !important;
    grid-row: 2;
  }

  .resize-handle-right {
    display: none !important;
  }

  .rpg-sidebar {
    display: none !important; /* Hide chat on tablet */
  }

  /* Smaller sidebar width on tablet */
  .drawer-sidebar {
    min-width: 200px;
    max-width: 300px;
  }
}

/* Large Tablet & Small Desktop */
@media (min-width: 1025px) and (max-width: 1440px) {
  .app-container {
    grid-template-columns: minmax(220px, 280px) auto 1fr auto minmax(300px, 360px);
  }

  .drawer-sidebar {
    min-width: 220px;
    max-width: 400px;
  }

  .rpg-sidebar {
    min-width: 300px;
    max-width: 500px;
  }
}

/* Collapsible sidebars in lesson mode - auto-hide but expandable */
body.in-lesson-mode .app-container {
  grid-template-columns: 0px 0px 1fr 0px 0px !important;
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Expanded states */
body.in-lesson-mode.left-sidebar-expanded .app-container {
  grid-template-columns: minmax(250px, 350px) 0px 1fr 0px 0px !important;
}

body.in-lesson-mode.right-sidebar-expanded .app-container {
  grid-template-columns: 0px 0px 1fr 0px minmax(300px, 450px) !important;
}

body.in-lesson-mode.both-sidebars-expanded .app-container {
  grid-template-columns: minmax(250px, 350px) 0px 1fr 0px minmax(300px, 450px) !important;
}

/* Hide sidebars by default in lesson mode */
body.in-lesson-mode .drawer-sidebar,
body.in-lesson-mode .rpg-sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

body.in-lesson-mode .rpg-sidebar {
  transform: translateX(100%);
}

/* Show sidebars when expanded */
body.in-lesson-mode.left-sidebar-expanded .drawer-sidebar,
body.in-lesson-mode.both-sidebars-expanded .drawer-sidebar {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
}

body.in-lesson-mode.right-sidebar-expanded .rpg-sidebar,
body.in-lesson-mode.both-sidebars-expanded .rpg-sidebar {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
}

/* Hide resize handles in lesson mode */
body.in-lesson-mode .resize-handle {
  display: none !important;
}

/* Ensure lesson content stays in center */
body.in-lesson-mode .lesson-content-view {
  grid-column: 3 !important;
}

/* Smooth transitions */
.drawer-sidebar,
.rpg-sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
              opacity 0.3s ease;
}

/* Sidebar toggle buttons */
.sidebar-toggle-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px 8px;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.05);
}

/* Show toggle buttons in lesson mode */
body.in-lesson-mode .sidebar-toggle-btn {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-toggle-btn.left {
  left: 12px;
}

.sidebar-toggle-btn.right {
  right: 12px;
}

/* Hide toggle button when sidebar is expanded */
body.in-lesson-mode.left-sidebar-expanded .sidebar-toggle-btn.left,
body.in-lesson-mode.both-sidebars-expanded .sidebar-toggle-btn.left {
  opacity: 0;
  pointer-events: none;
}

body.in-lesson-mode.right-sidebar-expanded .sidebar-toggle-btn.right,
body.in-lesson-mode.both-sidebars-expanded .sidebar-toggle-btn.right {
  opacity: 0;
  pointer-events: none;
}

/* Close button inside sidebars */
.sidebar-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.05);
}

/* Show close button when sidebar is expanded */
body.in-lesson-mode.left-sidebar-expanded .drawer-sidebar .sidebar-close-btn,
body.in-lesson-mode.both-sidebars-expanded .drawer-sidebar .sidebar-close-btn {
  opacity: 1;
  pointer-events: auto;
}

body.in-lesson-mode.right-sidebar-expanded .rpg-sidebar .sidebar-close-btn,
body.in-lesson-mode.both-sidebars-expanded .rpg-sidebar .sidebar-close-btn {
  opacity: 1;
  pointer-events: auto;
}


/* Top Header - spans all columns */
.app-header {
  grid-column: 1 / -1;
  grid-row: 1;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 100;
  flex-shrink: 0;
}

.app-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--learn-ink);
}

.floating-fullscreen-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  z-index: 120;
}

.floating-fullscreen-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 640px) {
  .floating-fullscreen-btn {
    bottom: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
  }
}

/* LEFT SIDEBAR - Hierarchical Drawer */
/* LEFT SIDEBAR - Scrollable, scenario-based navigation, resizable */
.drawer-sidebar {
  grid-column: 1;
  grid-row: 2;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-4, 16px);
  min-width: 200px;
  max-width: 500px;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(235, 195, 120, 0.3) transparent;
}

.drawer-sidebar::-webkit-scrollbar {
  width: 8px;
}

.drawer-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.drawer-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(235, 195, 120, 0.3);
  border-radius: 4px;
  border: 2px solid transparent;
}

.drawer-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(235, 195, 120, 0.5);
}

/* Drawer Header - sticky at top */
.drawer-header {
  margin-bottom: var(--space-4, 16px);
  padding-bottom: var(--space-3, 12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.drawer-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--space-2, 8px);
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.3px;
}

.drawer-stats {
  font-size: 13px;
  color: rgba(235, 195, 120, 0.8);
  font-weight: 500;
}

/* Scenario Category Container */
.drawer-category,
.scenario-category {
  margin-bottom: var(--space-3, 12px);
}

/* Category Toggle Button */
.category-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  padding: var(--space-3, 12px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  text-align: left;
}

.category-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(235, 195, 120, 0.3);
  transform: translateY(-1px);
}

/* Chevron Icon */
.category-toggle .chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  color: rgba(235, 195, 120, 0.7);
  stroke: currentColor;
}

.category-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.category-toggle[aria-expanded="false"] .chevron {
  transform: rotate(0deg);
}

.category-toggle:active {
  transform: translateY(0);
}

/* Category Name & Description */
.category-name {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.category-description {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
}

/* Lesson Count Badge */
.category-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(235, 195, 120, 0.15);
  border-radius: 10px;
  color: rgba(235, 195, 120, 0.95);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* Expandable Content */
.category-expand {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.category-expand.open {
  max-height: 4000px;
  opacity: 1;
  margin-top: var(--space-2, 8px);
  padding-top: var(--space-1, 4px);
}

/* Subcategory */
.subcategory {
  margin-bottom: var(--space-3, 12px);
  padding-left: var(--space-2, 8px);
}

.subcategory-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2, 8px) var(--space-3, 12px);
  margin-bottom: var(--space-1, 4px);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.5);
}

.lesson-count {
  font-size: 10px;
  color: rgba(235, 195, 120, 0.7);
  background: rgba(235, 195, 120, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Lesson List */
.lesson-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lesson-item {
  margin-bottom: 1px;
}

/* Lesson Link */
.lesson-link {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  padding: var(--space-2, 8px) var(--space-3, 12px);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
  transition: all 150ms ease;
  border-left: 2px solid transparent;
  cursor: pointer;
  border-radius: 6px;
  margin: 0 var(--space-1, 4px);
}

.lesson-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.95);
  border-left-color: rgba(235, 195, 120, 0.5);
}

.lesson-link.active {
  background: rgba(235, 195, 120, 0.12);
  color: rgba(235, 195, 120, 1);
  border-left-color: rgba(235, 195, 120, 1);
  font-weight: 600;
}

/* Lesson Status Icon */
.lesson-status {
  font-size: 11px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
}

.lesson-item[data-status="complete"] .lesson-status {
  color: rgba(126, 243, 255, 0.95);
}

.lesson-item[data-status="in-progress"] .lesson-status {
  color: rgba(255, 214, 10, 0.95);
}

/* Lesson Title */
.lesson-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-item[data-status="unstarted"] .lesson-status {
  color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   PRACTICE SLIDES - 10 BLANK SLIDES WITH NAVIGATION
   ========================================================================== */

.practice-slide {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: clamp(16px, 3vw, 32px);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  box-sizing: border-box;
}

.practice-slide-header {
  margin-bottom: var(--space-3, 12px);
  padding-bottom: var(--space-2, 8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.practice-slide-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: var(--space-2, 8px);
}

.slide-number {
  font-size: 14px;
  color: rgba(235, 195, 120, 0.8);
  font-weight: 500;
}

.practice-slide-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2, 8px);
  margin: var(--space-2, 8px) 0;
  overflow: hidden;
  min-height: 0;
}

.blank-space {
  width: 100%;
  max-width: 600px;
  padding: clamp(12px, 2vw, 24px);
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.instruction-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-3, 16px);
  font-weight: 500;
}

.instruction-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
}

.instruction-list li {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  padding: var(--space-2, 8px);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

/* Practice Slide Actions */
.practice-slide-actions {
  display: flex;
  gap: var(--space-2, 8px);
  padding-top: var(--space-3, 12px);
  margin-top: var(--space-3, 12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.practice-btn {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1, 6px);
  padding: var(--space-2, 10px) var(--space-3, 14px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.practice-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(235, 195, 120, 0.3);
  transform: translateY(-2px);
}

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

.practice-btn svg {
  flex-shrink: 0;
}

.practice-btn-restart {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.practice-btn-restart:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

.practice-btn-next {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.practice-btn-next:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
}

.practice-btn-select {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
}

.practice-btn-select:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
}

.practice-btn-download {
  background: rgba(235, 195, 120, 0.1);
  border-color: rgba(235, 195, 120, 0.3);
}

.practice-btn-download:hover {
  background: rgba(235, 195, 120, 0.2);
  border-color: rgba(235, 195, 120, 0.5);
}

.practice-btn-pdf {
  background: rgba(255, 69, 58, 0.1);
  border-color: rgba(255, 69, 58, 0.3);
}

.practice-btn-pdf:hover {
  background: rgba(255, 69, 58, 0.2);
  border-color: rgba(255, 69, 58, 0.5);
}

/* Final Slide - Review & Summary with action buttons */
.final-slide .practice-slide-actions {
  margin-top: var(--space-4, 16px);
  padding-top: var(--space-4, 16px);
  border-top: 2px solid rgba(126, 243, 255, 0.2);
}

/* ==========================================================================
   DECISION SLIDE - END OF LESSON NAVIGATION NODES
   ========================================================================== */

.decision-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 400px;
  padding: clamp(24px, 4vw, 48px);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
}

.decision-header {
  text-align: center;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.decision-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 600;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

.decision-nodes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 500px;
}

.decision-pill {
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: white;
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.decision-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(126, 243, 255, 0.4);
  transform: translateY(-1px);
}

.decision-pill:active {
  transform: translateY(0);
}

.decision-pill-primary {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
}

.decision-pill-primary:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .decision-slide {
    padding: 24px 16px;
  }

  .decision-pill {
    padding: 14px 24px;
    font-size: 15px;
  }
}

/* ==========================================================================
   COVER SLIDE STYLES
   ========================================================================== */

.cover-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 400px;
  padding: clamp(24px, 4vw, 64px);
  background: radial-gradient(circle at 50% 30%, rgba(126, 243, 255, 0.15), transparent 60%),
              radial-gradient(circle at 80% 70%, rgba(235, 195, 120, 0.1), transparent 50%),
              rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  box-sizing: border-box;
}

.cover-content {
  text-align: center;
  max-width: 700px;
  overflow: hidden;
}

.cover-logo {
  margin: 0 auto clamp(16px, 3vw, 28px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(80px, 10vw, 110px);
  height: clamp(80px, 10vw, 110px);
  background: linear-gradient(135deg, rgba(126, 243, 255, 0.2), rgba(235, 195, 120, 0.2));
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.cover-logo svg {
  color: var(--accent);
  filter: drop-shadow(0 4px 12px rgba(126, 243, 255, 0.3));
}

.cover-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: clamp(12px, 2vw, 20px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(126, 243, 255, 0.9));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cover-description {
  font-size: clamp(14px, 2vw, 17px);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: clamp(16px, 3vw, 28px);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cover-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 10px);
  font-size: clamp(12px, 1.5vw, 14px);
  color: rgba(235, 195, 120, 0.9);
  font-weight: 600;
  margin-bottom: clamp(20px, 4vw, 48px);
}

.cover-divider {
  color: rgba(255, 255, 255, 0.3);
}

.cover-footer {
  padding-top: clamp(12px, 2vw, 24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cover-watermark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 8px);
  font-size: 16px;
  font-weight: 700;
  color: rgba(126, 243, 255, 0.8);
  letter-spacing: 0.5px;
}

.watermark-symbol {
  font-size: 12px;
  opacity: 0.6;
}

/* ==========================================================================
   OBJECTIVES SLIDE STYLES
   ========================================================================== */

.objectives-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 400px;
  padding: clamp(24px, 4vw, 64px);
  background: radial-gradient(circle at 30% 40%, rgba(235, 195, 120, 0.12), transparent 60%),
              radial-gradient(circle at 70% 60%, rgba(126, 243, 255, 0.08), transparent 50%),
              rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  box-sizing: border-box;
}

.objectives-content {
  max-width: 750px;
  width: 100%;
}

.objectives-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: clamp(16px, 3vw, 32px);
  text-align: center;
  background: linear-gradient(135deg, rgba(235, 195, 120, 0.95), rgba(255, 255, 255, 0.9));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.objectives-intro {
  margin-bottom: clamp(20px, 3vw, 32px);
  text-align: center;
}

.objectives-intro p {
  font-size: clamp(16px, 2vw, 18px);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.objectives-list {
  list-style: none;
  padding: 0;
  margin: 0 0 clamp(24px, 4vw, 40px) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 20px);
}

.objective-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  padding: clamp(12px, 2vw, 16px) clamp(16px, 3vw, 24px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(126, 243, 255, 0.15);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.objective-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(126, 243, 255, 0.3);
  transform: translateX(4px);
}

.objective-item::before {
  content: "✓";
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(126, 243, 255, 0.2), rgba(235, 195, 120, 0.2));
  border-radius: 50%;
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}

.objectives-footer {
  padding-top: clamp(16px, 3vw, 24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.objectives-note {
  font-size: clamp(13px, 1.5vw, 15px);
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  text-align: center;
  font-style: italic;
}

.objectives-note strong {
  color: rgba(235, 195, 120, 0.9);
  font-style: normal;
}

/* ==========================================================================
   OUTLINE GUIDANCE STYLES
   ========================================================================== */

.practice-slide-content {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-4, 24px);
}

.outline-guidance {
  display: flex;
  gap: var(--space-2, 12px);
  padding: clamp(12px, 2vw, 20px);
  background: rgba(126, 243, 255, 0.05);
  border: 1px solid rgba(126, 243, 255, 0.2);
  border-radius: 12px;
  margin-bottom: var(--space-2, 8px);
  flex-shrink: 0;
}

.guidance-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.guidance-text {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.note-area {
  flex: 1;
  min-height: 100px;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: clamp(12px, 2vw, 20px);
  margin-top: var(--space-2, 8px);
  overflow: hidden;
}

/* ==========================================================================
   TOAST NOTIFICATIONS & ANIMATIONS
   ========================================================================== */

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.download-success-toast {
  animation: slideInRight 0.3s ease-out;
}

/* RESIZE HANDLES */
.resize-handle {
  grid-row: 2;
  width: 4px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.2s ease;
  position: relative;
  z-index: 10;
}

.resize-handle:hover,
.resize-handle.resizing {
  background: rgba(235, 195, 120, 0.3);
}

.resize-handle::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  right: -2px;
  /* Wider hit area for easier grabbing */
}

.resize-handle-left {
  grid-column: 2;
}

.resize-handle-right {
  grid-column: 4;
}

/* CENTER COLUMN - Carousel or Lesson View (always visible, scrolls independently) */
.carousel-container,
.lesson-content-view {
  grid-column: 3;
  grid-row: 2;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
  perspective: 1500px;
  /* CRITICAL: Constrain height to viewport - prevent overflow */
  max-height: calc(100vh - 80px);
  height: 100%;
}

.carousel-container {
  transition: opacity 0.3s ease;
}

.carousel-container.hidden {
  display: none;
}

.lesson-content-view {
  display: none;
}

.lesson-content-view.active {
  display: block;
}

.lesson-header {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.lesson-back-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.lesson-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

.lesson-header-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
}

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

.lesson-header-progress span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* Show presenter mode button in header when in lesson */
body.in-lesson-mode #headerPresentationToggle {
  display: flex !important;
}

/* Hide presenter button in presentation mode */
.app-container.presentation-mode .app-header {
  display: none !important;
}

/* Presentation Mode */
body.presentation-mode {
  overflow: hidden;
}

.app-container.presentation-mode .drawer-sidebar,
.app-container.presentation-mode .rpg-sidebar,
.app-container.presentation-mode .app-header,
.app-container.presentation-mode .lesson-header,
.app-container.presentation-mode .carousel-nav,
.app-container.presentation-mode .carousel-indicators {
  display: none !important;
}

.app-container.presentation-mode {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.app-container.presentation-mode .lesson-content-view {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #030308;
  z-index: 9999 !important;
  max-height: none !important;
}

.app-container.presentation-mode .carousel-wrapper {
  width: 100vw !important;
  height: 100vh !important;
  top: 0 !important;
  left: 0 !important;
  transform: none !important;
}

.app-container.presentation-mode .carousel-track {
  width: 100vw !important;
  height: 100vh !important;
}

.app-container.presentation-mode .slide-card {
  width: 100vw;
  height: 100vh;
  max-width: none;
  padding: clamp(60px, 8vw, 120px);
  border: none;
  border-radius: 0;
}

.app-container.presentation-mode .slide-card.prev,
.app-container.presentation-mode .slide-card.next {
  transform: translateX(-2000px) scale(0.3) rotateY(25deg);
  opacity: 0;
  pointer-events: none;
}

.app-container.presentation-mode .slide-card.next {
  transform: translateX(2000px) scale(0.3) rotateY(-25deg);
}

.app-container.presentation-mode .slide-card.active {
  transform: translateX(0) scale(1) rotateY(0deg);
}

.presentation-exit-hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.08em;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.app-container.presentation-mode .presentation-exit-hint {
  opacity: 1;
  animation: fadeInOut 3s ease-in-out 1s forwards;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: 1; }
}

.carousel-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.carousel-card {
  position: absolute;
  width: 500px;
  height: 600px;
  max-height: calc(100vh - 160px); /* CRITICAL: Prevent overflow */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--glass-border);
  border-radius: 40px;
  padding: 48px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform-style: preserve-3d;
  transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
  cursor: pointer;
  overflow-y: auto;
}

.carousel-card.active {
  transform: translateX(0) scale(1) rotateY(0deg);
  opacity: 1;
  z-index: 10;
  filter: blur(0) brightness(1);
  backdrop-filter: blur(20px);
}

.carousel-card.prev {
  transform: translateX(-450px) scale(0.75) rotateY(25deg);
  opacity: 0.3;
  z-index: 5;
  pointer-events: none;
  filter: blur(20px) brightness(0.6);
  backdrop-filter: blur(40px);
}

.carousel-card.next {
  transform: translateX(450px) scale(0.75) rotateY(-25deg);
  opacity: 0.3;
  z-index: 5;
  pointer-events: none;
  filter: blur(20px) brightness(0.6);
  backdrop-filter: blur(40px);
}

.carousel-card.hidden {
  transform: translateX(0) scale(0.5);
  opacity: 0;
  pointer-events: none;
  filter: blur(40px) brightness(0.4);
  backdrop-filter: blur(60px);
}

.card-status-badge {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.55);
}

.card-status-badge.complete {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.78);
}

.card-status-badge.in-progress {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.78);
}

.card-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
  line-height: 1.2;
}

.card-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.card-description {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 32px;
}

.card-objectives {
  margin-bottom: 32px;
}

.card-objectives h4 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
}

.card-objectives ul {
  list-style: none;
  padding: 0;
}

.card-objectives li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.card-objectives li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

.card-actions {
  display: flex;
  gap: 12px;
}

.card-btn {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
}

.card-btn-primary:hover {
  transform: translateY(-2px);
  background: var(--accent);
  color: #000;
  box-shadow: 0 8px 24px rgba(126, 243, 255, 0.3);
}

.card-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.card-btn-secondary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Slide Cards - 16:9 aspect ratio, no scrolling */
.slide-card {
  position: absolute;
  width: 70%;
  max-width: min(70vw, calc(70vh * 16 / 9));
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--glass-border);
  border-radius: 40px;
  padding: clamp(24px, 3vw, 48px);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform-style: preserve-3d;
  transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.slide-card.active {
  transform: translateX(0) scale(1) rotateY(0deg);
  opacity: 1;
  z-index: 10;
}

.slide-card.prev {
  transform: translateX(-120%) scale(0.65) rotateY(25deg);
  opacity: 0.3;
  z-index: 5;
  pointer-events: none;
}

.slide-card.next {
  transform: translateX(120%) scale(0.65) rotateY(-25deg);
  opacity: 0.3;
  z-index: 5;
  pointer-events: none;
}

.slide-card.hidden {
  transform: translateX(0) scale(0.5);
  opacity: 0;
  pointer-events: none;
}

.slide-number {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.55);
}

.slide-title {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 28px;
  color: #fff;
  line-height: 1.2;
}

.slide-content {
  font-size: 18px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.slide-content h4 {
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 14px;
  color: #fff;
}

.slide-content p {
  margin-bottom: 16px;
}

.slide-content ul, .slide-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.slide-content li {
  margin-bottom: 8px;
}

.slide-callout {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 20px 22px;
  margin: 32px 0;
}

.slide-callout strong {
  color: rgba(255, 255, 255, 0.95);
}

.slide-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
}

.slide-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slide-btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  flex: 1;
}

.slide-btn-primary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

.slide-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.slide-btn-secondary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Carousel Controls */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
}

.carousel-nav.prev {
  left: 40px;
}

.carousel-nav.next {
  right: 40px;
}

.nav-btn {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
}

.nav-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-border);
  color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(126, 243, 255, 0.2);
}

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

.nav-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Carousel Indicators */
.carousel-indicators {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 20;
}

.indicator {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(126, 243, 255, 0.4);
}

/* Empty State */
.carousel-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  max-width: 400px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.3;
}

.empty-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.empty-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

/* RIGHT SIDEBAR - Chat Copilot (scrollable, resizable) */
.rpg-sidebar {
  grid-column: 5;
  grid-row: 2;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-4, 16px);
  min-width: 280px;
  max-width: 600px;
}

/* Player Card */
.player-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.player-avatar {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 12px;
}

.player-level {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
}

.player-name {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.xp-bar-container {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.xp-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 5px;
  transition: width 1s ease;
  box-shadow: 0 0 8px rgba(126, 243, 255, 0.4);
}

.xp-text {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

/* Skills */
.skills-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
}

.skill-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.skill-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.skill-level {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 6px;
}

.skill-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 1s ease;
  box-shadow: 0 0 8px rgba(126, 243, 255, 0.4);
}

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.achievement {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  transition: all 0.2s ease;
}

.achievement.unlocked {
  border-color: var(--accent-border);
  background: var(--accent-hover);
}

.achievement.locked {
  opacity: 0.3;
}

.achievement-icon {
  font-size: 24px;
  margin-bottom: 4px;
  filter: grayscale(1);
}

.achievement.unlocked .achievement-icon {
  filter: grayscale(0);
}

.achievement-name {
  font-size: 9px;
  font-weight: 600;
  color: #fff;
}

/* Site Footer Styling - Collapsible */
.site-footer {
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: all 0.3s ease;
}

/* Footer Toggle Button */
.footer-toggle {
  width: 100%;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
  z-index: 10;
}

.footer-copyright-minimized {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 400;
  flex: 1;
  text-align: left;
  transition: opacity 0.3s ease;
}

/* Hide copyright in toggle when footer is expanded */
.site-footer.expanded .footer-copyright-minimized {
  opacity: 0;
  pointer-events: none;
}

.footer-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
}

.footer-toggle-icon {
  font-size: 12px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.site-footer.expanded .footer-toggle-icon {
  transform: rotate(180deg);
}

/* Footer Content - Hidden by default */
.footer-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0 20px;
}

.site-footer.expanded .footer-content {
  max-height: 1000px; /* Large enough for content */
  opacity: 1;
  padding: 24px 20px 16px;
}

.site-footer .footer-content .section-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0; /* Padding handled by .footer-content */
}

/* Override footer colors for dark theme */
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px; /* Reduced */
  padding-bottom: 20px; /* Reduced */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px; /* Reduced */
}

.site-footer .footer-column h4 {
  font-size: 11px; /* Slightly smaller */
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px; /* Reduced */
}

.site-footer .footer-column a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px; /* Slightly smaller */
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
  margin-bottom: 6px; /* Reduced */
}

.site-footer .footer-column a:hover {
  color: rgba(255, 255, 255, 0.95);
}

.site-footer .footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px; /* Reduced */
  padding-top: 16px; /* Reduced */
  text-align: center;
}

.site-footer .footer-copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin: 0;
}

.site-footer .footer-legal {
  display: flex;
  gap: 16px;
  align-items: center;
}

.site-footer .footer-legal a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer .footer-legal a:hover {
  color: rgba(255, 255, 255, 0.95);
}

.site-footer .footer-legal a:not(:last-child)::after {
  content: '|';
  margin-left: 16px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

@media (max-width: 1024px) {
  .site-footer .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Tablet: Reduce sidebar widths */
  .app-container {
    grid-template-columns: 280px 1fr 260px;
  }
  
  .carousel-card {
    width: 450px;
    height: 550px;
    padding: 40px;
  }
  
  .slide-card {
    width: 800px;
    height: 600px;
    padding: 48px;
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  /* Single column layout on mobile */
  .app-container {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto 1fr;
    height: calc(100vh - 50px);
  }
  
  /* Hide sidebars by default on mobile */
  .drawer-sidebar,
  .rpg-sidebar {
    display: none;
  }
  
  /* Show sidebars when in lesson mode as overlays */
  body.in-lesson-mode .drawer-sidebar,
  body.in-lesson-mode .rpg-sidebar {
    display: block;
    position: fixed;
    top: 0;
    bottom: 0;
    width: 60px !important;
    z-index: 200;
    margin: 0;
    border-radius: 0;
  }
  
  body.in-lesson-mode .drawer-sidebar {
    left: 0;
  }
  
  body.in-lesson-mode .rpg-sidebar {
    right: 0;
  }
  
  /* Header optimizations */
  .app-header {
    padding: 10px 16px;
    flex-wrap: wrap;
  }
  
  .app-logo {
    font-size: 16px;
  }
  
  .header-nav {
    order: 3;
    width: 100%;
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .header-btn {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  /* Carousel card mobile sizing */
  .carousel-card {
    width: calc(100vw - 32px);
    max-width: 400px;
    height: auto;
    min-height: 500px;
    padding: 32px 24px;
    margin: 0 auto;
  }
  
  .card-title {
    font-size: 28px;
    margin-bottom: 12px;
  }
  
  .card-description {
    font-size: 14px;
    margin-bottom: 24px;
  }
  
  .card-objectives {
    margin-bottom: 24px;
  }
  
  .card-objectives h4 {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  .card-objectives li {
    font-size: 13px;
    padding: 6px 0;
  }
  
  .card-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .card-btn {
    padding: 14px;
    font-size: 14px;
    min-height: 44px; /* Touch-friendly */
  }
  
  /* Slide card mobile sizing */
  .slide-card {
    width: calc(100vw - 32px);
    max-width: 100%;
    height: auto;
    min-height: 500px;
    padding: 32px 24px;
    margin: 0 auto;
  }
  
  .slide-title {
    font-size: 28px;
    margin-bottom: 20px;
  }
  
  .slide-content {
    font-size: 16px;
    line-height: 1.6;
  }
  
  .slide-content h4 {
    font-size: 18px;
    margin: 20px 0 12px;
  }
  
  .slide-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
  }
  
  .slide-btn {
    min-height: 44px; /* Touch-friendly */
    font-size: 14px;
  }
  
  /* Lesson header mobile */
  .lesson-header {
    top: 10px;
    left: 16px;
    right: 16px;
    transform: none;
    padding: 12px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .lesson-header-info h3 {
    font-size: 16px;
  }
  
  .lesson-back-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  /* Navigation buttons mobile */
  .carousel-nav {
    display: none; /* Hide on mobile, use swipe instead */
  }
  
  .carousel-indicators {
    bottom: 20px;
    gap: 6px;
  }
  
  .indicator {
    width: 6px;
    height: 6px;
  }
  
  .indicator.active {
    width: 20px;
  }
  
  /* Carousel wrapper adjustments */
  .carousel-wrapper {
    padding: 0 16px;
  }
}

@media (max-width: 640px) {
  .site-footer .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .site-footer.expanded .footer-content {
    padding: 20px 16px 16px;
  }
  
  /* Extra small mobile optimizations */
  .app-container {
    height: calc(100vh - 45px);
  }
  
  .app-header {
    padding: 8px 12px;
  }
  
  .app-logo {
    font-size: 14px;
  }
  
  .header-nav {
    gap: 6px;
  }
  
  .header-btn {
    font-size: 11px;
    padding: 5px 10px;
    min-height: 36px; /* Touch-friendly */
  }
  
  .carousel-card {
    width: calc(100vw - 24px);
    padding: 24px 20px;
    min-height: 450px;
  }
  
  .card-title {
    font-size: 24px;
  }
  
  .slide-card {
    width: calc(100vw - 24px);
    padding: 24px 20px;
    min-height: 450px;
  }
  
  .slide-title {
    font-size: 24px;
  }
  
  .slide-content {
    font-size: 15px;
  }
  
  .lesson-header {
    left: 12px;
    right: 12px;
    padding: 10px 16px;
  }
  
  .floating-fullscreen-btn {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  
  /* Prevent text size adjustment on iOS */
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  
  /* Improve touch targets */
  button, a, .card-btn, .slide-btn, .nav-btn, .lesson-back-btn {
    -webkit-tap-highlight-color: rgba(126, 243, 255, 0.2);
    tap-highlight-color: rgba(126, 243, 255, 0.2);
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
