/* ==========================================================
   Neural Learning - Luxury Minimalist Design System
   Full Responsive Engine: Desktop (1440px+), Tablet (768px-1024px), Mobile (<768px)
   ========================================================== */

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #ffffff;
  --bg-teal-light: #e0f2fe;
  --bg-teal-soft: #f0fdfa;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --accent-teal: #0d9488;
  --accent-teal-hover: #0f766e;
  --accent-cyan: #0ea5e9;
  --accent-dark: #0f172a;
  --accent-dark-hover: #1e293b;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --warning: #f59e0b;

  --border-subtle: #e2e8f0;
  --border-focus: #0d9488;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --shadow-subtle: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 12px 30px -4px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 20px 40px -8px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(13, 148, 136, 0.25);
  
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Containers */
.app-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
}

.lesson-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

/* Luxury Top Navigation */
.luxury-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-subtle);
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f2fe, #ccfbf1);
  border: 1px solid rgba(13, 148, 136, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-teal);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.brand-title span {
  color: var(--accent-teal);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card-subtle);
}

.nav-link.active {
  background: #e6fffa;
  color: var(--accent-teal);
}

.nav-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-teal);
  color: #ffffff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
  white-space: nowrap;
}

.nav-cta-btn:hover {
  background: var(--accent-teal-hover);
  transform: translateY(-1px);
}

/* Hero Section */
.luxury-hero {
  text-align: center;
  max-width: 840px;
  margin: 0 auto 2.5rem;
  padding: 0 0.5rem;
}

.luxury-hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.luxury-hero p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Value Cards (Neural Traveler Style) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: rgba(13, 148, 136, 0.3);
}

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f0fdfa;
  border: 1px solid rgba(13, 148, 136, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--accent-teal);
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Course Selector Grid */
.course-selector-section {
  margin-bottom: 2.5rem;
}

.course-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.course-select-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
}

.course-select-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-card);
}

.course-select-card.active {
  border-color: var(--accent-teal);
  background: #f0fdfa;
  box-shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.15);
}

/* Course Main Banner */
.course-main-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  margin-bottom: 2.25rem;
  box-shadow: var(--shadow-card);
}

.instructor-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f0fdfa;
  color: var(--accent-teal);
  border: 1px solid rgba(13, 148, 136, 0.2);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.level-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.level-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: rgba(13, 148, 136, 0.3);
}

.level-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.level-badge.basic {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.level-badge.medium {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.level-badge.advanced {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1.35rem;
  min-height: 44px;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: var(--transition);
  user-select: none;
}

.btn-dark {
  background: var(--accent-dark);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}
.btn-dark:hover {
  background: var(--accent-dark-hover);
  transform: translateY(-1px);
}

.btn-teal {
  background: var(--accent-teal);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}
.btn-teal:hover {
  background: var(--accent-teal-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-outline:hover {
  background: var(--bg-card-subtle);
  border-color: #cbd5e1;
}

/* Lesson Engine */
.lesson-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-icon-nav {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-subtle);
  flex-shrink: 0;
}
.btn-icon-nav:hover {
  color: var(--text-primary);
  background: var(--bg-card-subtle);
}

.segmented-progress {
  flex: 1;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.segmented-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #0ea5e9);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-title {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.theory-body {
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  color: var(--text-secondary);
  line-height: 1.75;
}
.theory-body p { margin-bottom: 1rem; }
.theory-body ul { margin-bottom: 1rem; padding-left: 1.5rem; }
.theory-body li { margin-bottom: 0.5rem; }
.theory-body h3 { font-size: 1.2rem; color: var(--text-primary); margin: 1.25rem 0 0.5rem; font-weight: 800; }
.theory-body pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.88rem;
  margin: 1.25rem 0;
  border: 1px solid #334155;
  -webkit-overflow-scrolling: touch;
}

.tip-box {
  background: #f0fdfa;
  border-left: 4px solid var(--accent-teal);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  color: #0f766e;
  border-top: 1px solid rgba(13, 148, 136, 0.15);
  border-right: 1px solid rgba(13, 148, 136, 0.15);
  border-bottom: 1px solid rgba(13, 148, 136, 0.15);
}

/* Persistent Notes Section */
.notes-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2.5vw, 1.75rem);
  box-shadow: var(--shadow-subtle);
  margin-top: 1.5rem;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.notes-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notes-status-badge {
  font-size: 0.78rem;
  color: #059669;
  font-weight: 600;
  opacity: 0;
  transition: var(--transition);
}

.notes-status-badge.visible {
  opacity: 1;
}

.notes-textarea {
  width: 100%;
  min-height: 110px;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #f8fafc;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
  transition: var(--transition);
}

.notes-textarea:focus {
  outline: none;
  border-color: var(--accent-teal);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.notes-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Interactive Canvas Viewport */
.interactive-viewport {
  position: relative;
  width: 100%;
  height: clamp(260px, 45vh, 360px);
  background: #0f172a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.25rem 0;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.interactive-viewport canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.interactive-overlay-controls {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.interactive-chip-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  min-height: 38px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
}
.interactive-chip-btn:hover, .interactive-chip-btn.active {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
}

/* Quiz Options */
.quiz-question-prompt {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  min-height: 52px;
  color: var(--text-primary);
  font-size: clamp(0.88rem, 1.8vw, 0.98rem);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  touch-action: manipulation;
}

.quiz-option-btn:hover:not(.disabled) {
  border-color: var(--accent-teal);
  background: var(--bg-teal-soft);
  transform: translateY(-1px);
}

.quiz-option-btn.selected {
  border-color: var(--accent-teal);
  background: #f0fdfa;
}

.quiz-option-btn.correct {
  border-color: var(--success) !important;
  background: var(--success-bg) !important;
  color: #065f46;
}

.quiz-option-btn.incorrect {
  border-color: var(--error) !important;
  background: var(--error-bg) !important;
  color: #991b1b;
}

.option-key {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Feedback Drawer */
.feedback-drawer {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.25rem;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-subtle);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.feedback-drawer.correct {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.feedback-drawer.incorrect {
  background: #fef2f2;
  border-color: #fecaca;
}

.feedback-header {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.feedback-drawer.correct .feedback-header { color: #065f46; }
.feedback-drawer.incorrect .feedback-header { color: #991b1b; }

.feedback-explanation {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Luxury Footer */
.luxury-footer {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.newsletter-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--accent-teal);
  background: #ffffff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 768px) {
  .luxury-navbar { padding: 0.65rem 1rem; margin-bottom: 1.5rem; }
  .nav-links { display: none; }
  .brand-title { font-size: 1.15rem; }
  .features-grid { grid-template-columns: 1fr; }
  .course-selector-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .btn { width: 100%; }
  .interactive-viewport { height: 280px; }
}

@media (max-width: 480px) {
  .app-container { padding: 1rem 0.75rem 3rem; }
  .lesson-container { padding: 1rem 0.6rem 3rem; }
  .stage-card { padding: 1.15rem 0.9rem; border-radius: var(--radius-lg); }
  .course-main-banner { padding: 1.25rem 1rem; }
  .quiz-option-btn { padding: 0.8rem 0.9rem; }
  .interactive-viewport { height: 240px; }
  .interactive-overlay-controls { padding: 0.35rem; }
  .interactive-chip-btn { font-size: 0.74rem; padding: 0.35rem 0.65rem; }
}
