/* ============================================================
   NutriLearn — Custom CSS (animations & components not in Tailwind)
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=DM+Serif+Display:ital@0;1&display=swap');

/* ── CSS Variables ── */
:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --emerald:   #059669;
  --emerald-dk:#047857;
  --emerald-lt:#10b981;
  --gold:      #D4A853;
  --gold-lt:   #F0C97A;
  --gold-dk:   #B8882E;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.10), 0 4px 16px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08);
  --shadow-green: 0 8px 30px rgba(5,150,105,.25);
  --shadow-gold:  0 8px 30px rgba(212,168,83,.35);
  --radius-card:  22px;
  --radius-btn:   12px;
  --radius-input: 12px;
  --transition:   all .22s cubic-bezier(.4,0,.2,1);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #ffffff;
  color: #111827;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-display { font-family: 'DM Serif Display', Georgia, serif; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Selection ── */
::selection { background: rgba(5,150,105,.15); color: #047857; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nl-nav {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,.06);
  transition: var(--transition);
}
.nl-nav.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.08);
}
.nav-link {
  position: relative;
  font-size: .875rem;
  font-weight: 500;
  color: #374151;
  padding: .5rem .75rem;
  border-radius: 8px;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { color: #059669; background: rgba(5,150,105,.06); }
.nav-link.active { color: #059669; font-weight: 600; }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: #059669;
  border-radius: 2px;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: #059669;
  color: #fff;
  font-size: .9375rem;
  font-weight: 600;
  padding: .875rem 1.75rem;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-green);
  letter-spacing: -.01em;
}
.btn-primary:hover {
  background: #047857;
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(5,150,105,.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: transparent;
  color: #111827;
  font-size: .9375rem;
  font-weight: 600;
  padding: .875rem 1.75rem;
  border-radius: var(--radius-btn);
  border: 1.5px solid #e5e7eb;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  letter-spacing: -.01em;
}
.btn-secondary:hover {
  border-color: #059669;
  color: #059669;
  background: rgba(5,150,105,.04);
  transform: translateY(-1px);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: linear-gradient(135deg, #D4A853, #F0C97A);
  color: #fff;
  font-size: .9375rem;
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-gold);
  letter-spacing: -.01em;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(212,168,83,.45);
}

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,.06);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}
.card-flat {
  background: #fff;
  border-radius: var(--radius-card);
  border: 1.5px solid #f3f4f6;
  transition: var(--transition);
  overflow: hidden;
}
.card-flat:hover {
  border-color: rgba(5,150,105,.2);
  box-shadow: var(--shadow-md);
}

/* ── Course Card ── */
.course-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,.06);
  transition: var(--transition);
  overflow: hidden;
  cursor: pointer;
}
.course-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-6px);
}
.course-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform .4s ease;
}
.course-card:hover .course-card-thumb { transform: scale(1.04); }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .625rem;
  border-radius: 999px;
  letter-spacing: .01em;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-gold   { background: #fef3c7; color: #92400e; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-red    { background: #fee2e2; color: #b91c1c; }

/* ── Stars ── */
.stars { color: #f59e0b; letter-spacing: .05em; }

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ── Glassmorphism ── */
.glass {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,.6);
}
.glass-dark {
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.1);
}

/* ── Section ── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .8125rem;
  font-weight: 600;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}
.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: #059669;
  border-radius: 2px;
}

/* ── Accordion ── */
.accordion-item { border-bottom: 1px solid #f3f4f6; }
.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.125rem 0;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 1rem;
  transition: var(--transition);
}
.accordion-trigger:hover .accordion-title { color: #059669; }
.accordion-title { font-size: .9375rem; font-weight: 600; color: #111827; flex: 1; }
.accordion-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .7rem;
  color: #6b7280;
  transition: var(--transition);
}
.accordion-item.open .accordion-icon {
  background: #059669;
  border-color: #059669;
  color: #fff;
  transform: rotate(45deg);
}
.accordion-content { overflow: hidden; max-height: 0; transition: max-height .35s cubic-bezier(.4,0,.2,1); }
.accordion-content-inner { padding: 0 0 1.25rem; color: #6b7280; font-size: .9rem; line-height: 1.7; }

/* ── Testimonial Carousel ── */
.testimonial-track { display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.testimonial-slide { flex: 0 0 100%; }

/* ── Floating Badges ── */
.floating-badge {
  position: absolute;
  background: #fff;
  border-radius: 16px;
  padding: .875rem 1.25rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: .75rem;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.floating-badge:nth-child(2) { animation-delay: -2s; }

/* ── Hero Gradient ── */
.hero-gradient {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 40%, #fff 100%);
}

/* ── Stat Card ── */
.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(5,150,105,.08);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ── Feature Bar ── */
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.25rem .75rem;
  text-align: center;
  border-right: 1px solid #f3f4f6;
}
.feature-item:last-child { border-right: none; }
.feature-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f0fdf4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  font-size: 1.1rem;
}

/* ── Category Card ── */
.category-card {
  background: #fff;
  border-radius: 18px;
  padding: 1.5rem;
  border: 1.5px solid #f3f4f6;
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
}
.category-card:hover {
  border-color: rgba(5,150,105,.25);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto .875rem;
}

/* ── Instructor Card (dark) ── */
.instructor-dark {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 40%, #047857 100%);
  border-radius: var(--radius-card);
  color: #fff;
  overflow: hidden;
  position: relative;
}
.instructor-dark::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}

/* ── Pricing Card ── */
.pricing-card {
  background: #fff;
  border-radius: var(--radius-card);
  border: 2px solid #f3f4f6;
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.pricing-card:hover { border-color: #059669; box-shadow: var(--shadow-xl); }
.pricing-card.featured {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-green);
}
.pricing-card.featured:hover { box-shadow: 0 20px 60px rgba(5,150,105,.4); }

/* ── FAQ ── */
.faq-item {
  border: 1.5px solid #f3f4f6;
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition);
  margin-bottom: .75rem;
}
.faq-item:hover { border-color: rgba(5,150,105,.2); }
.faq-item.open { border-color: rgba(5,150,105,.3); box-shadow: 0 4px 20px rgba(5,150,105,.08); }
.faq-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  gap: 1rem;
}
.faq-answer { padding: 0 1.5rem 1.25rem; color: #6b7280; font-size: .9rem; line-height: 1.75; }

/* ── Toast ── */
.toast {
  background: #111827;
  color: #fff;
  padding: .875rem 1.25rem;
  border-radius: 12px;
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .625rem;
  box-shadow: var(--shadow-xl);
  animation: toastIn .3s ease forwards;
  pointer-events: all;
  max-width: 380px;
}
.toast.success { background: #059669; }
.toast.error   { background: #dc2626; }
.toast.warning { background: #d97706; }
@keyframes toastIn  { from { opacity:0; transform: translateY(12px) scale(.95); } to { opacity:1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity:1; transform: translateY(0); }               to { opacity:0; transform: translateY(8px); } }

/* ── Modal ── */
.modal-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  transform: translateY(20px) scale(.97);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

/* ── OTP Inputs ── */
.otp-digit {
  width: 48px;
  height: 56px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #111827;
  outline: none;
  transition: var(--transition);
  -moz-appearance: textfield;
}
.otp-digit::-webkit-outer-spin-button,
.otp-digit::-webkit-inner-spin-button { -webkit-appearance: none; }
.otp-digit:focus { border-color: #059669; box-shadow: 0 0 0 4px rgba(5,150,105,.1); }
.otp-digit.filled { border-color: #059669; background: #f0fdf4; }

/* ── Form Inputs ── */
.nl-input {
  width: 100%;
  padding: .875rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-input);
  font-size: .9375rem;
  color: #111827;
  outline: none;
  transition: var(--transition);
  background: #fff;
  font-family: inherit;
}
.nl-input::placeholder { color: #9ca3af; }
.nl-input:focus { border-color: #059669; box-shadow: 0 0 0 4px rgba(5,150,105,.08); }
.nl-label { display: block; font-size: .875rem; font-weight: 600; color: #374151; margin-bottom: .5rem; }

/* ── Sidebar (Dashboard) ── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 1rem;
  border-radius: 12px;
  font-size: .875rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.sidebar-link:hover { background: #f0fdf4; color: #059669; }
.sidebar-link.active { background: #059669; color: #fff; box-shadow: var(--shadow-green); }
.sidebar-link .icon { width: 20px; text-align: center; font-size: 1rem; }

/* ── Dashboard Stat Card ── */
.dash-stat {
  background: #fff;
  border-radius: 18px;
  padding: 1.5rem;
  border: 1.5px solid #f3f4f6;
  transition: var(--transition);
}
.dash-stat:hover { border-color: rgba(5,150,105,.15); box-shadow: var(--shadow-md); }
.dash-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* ── Course Player ── */
.lesson-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-size: .8125rem;
}
.lesson-item:hover { background: #f9fafb; }
.lesson-item.active { background: #f0fdf4; }
.lesson-item.completed .lesson-check { background: #059669; border-color: #059669; color: #fff; }
.lesson-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  flex-shrink: 0;
  transition: var(--transition);
}

/* ── Video Player ── */
.video-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.video-wrapper iframe, .video-wrapper video { width: 100%; height: 100%; border: none; }

/* ── Quiz ── */
.quiz-option {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.25rem;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition);
  font-size: .9375rem;
}
.quiz-option:hover { border-color: #059669; background: #f0fdf4; }
.quiz-option.selected { border-color: #059669; background: #f0fdf4; }
.quiz-option.correct  { border-color: #059669; background: #dcfce7; }
.quiz-option.wrong    { border-color: #dc2626; background: #fee2e2; }
.option-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  flex-shrink: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-option.selected .option-dot { background: #059669; border-color: #059669; }
.quiz-option.selected .option-dot::after { content:''; width:8px; height:8px; background:#fff; border-radius:50%; }

/* ── Certificate ── */
.certificate-card {
  background: #fff;
  border: 3px solid #059669;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}
.cert-corner {
  position: absolute;
  width: 60px;
  height: 60px;
}
.cert-corner-tl { top: 0; left: 0; border-top: 4px solid #D4A853; border-left: 4px solid #D4A853; border-radius: 20px 0 0 0; }
.cert-corner-br { bottom: 0; right: 0; border-bottom: 4px solid #D4A853; border-right: 4px solid #D4A853; border-radius: 0 0 20px 0; }

/* ── Admin Sidebar ── */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: #111827;
  flex-shrink: 0;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 1.25rem;
  color: #9ca3af;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-radius: 10px;
  margin: .125rem .75rem;
  transition: var(--transition);
}
.admin-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav-link.active { background: #059669; color: #fff; }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity:0; transform: translateY(24px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}
@keyframes scaleIn {
  from { opacity:0; transform: scale(.92); }
  to   { opacity:1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity:0; transform: translateX(-24px); }
  to   { opacity:1; transform: translateX(0); }
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105,.4); }
  50%       { box-shadow: 0 0 0 12px rgba(5,150,105,0); }
}

.animate-fade-up     { animation: fadeInUp .6s ease forwards; }
.animate-fade-in     { animation: fadeIn .5s ease forwards; }
.animate-scale-in    { animation: scaleIn .5s cubic-bezier(.34,1.56,.64,1) forwards; }
.animate-slide-left  { animation: slideInLeft .5s ease forwards; }
.animate-pulse-green { animation: pulse-green 2s infinite; }

/* Intersection Observer driven animations */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }

/* ── Loading Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Responsive ── */
@media (max-width: 1023px) {
  #main-nav-links { display: none !important; }
  #mobile-menu-btn { display: flex !important; }
}
@media (min-width: 1024px) {
  #main-nav-links { display: flex !important; }
  #mobile-menu-btn { display: none !important; }
  #mobile-menu { display: none !important; }
}

/* ── Utility ── */
.text-gradient {
  background: linear-gradient(135deg, #059669, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-gold {
  background: linear-gradient(135deg, #D4A853, #F0C97A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.bg-green-gradient { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); }
.border-green-soft { border: 1.5px solid rgba(5,150,105,.15); }
.divide-soft > * + * { border-top: 1px solid #f3f4f6; }

/* ── Print (Certificate) ── */
@media print {
  .no-print { display: none !important; }
  .certificate-card { box-shadow: none; border: 3px solid #059669; }
  body { background: #fff; }
}
