/* ============================================
   EduSphere - Design System
   Modern LMS Platform Styles
============================================ */

:root {
  /* Brand Colors */
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;

  --accent: #f59e0b;
  --accent-dark: #d97706;

  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Neutrals */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --white: #ffffff;
  --black: #000000;

  /* Layout */
  --container: 1280px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.08);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Global horizontal-scroll lock. Any child wider than the viewport
     (long URL, oversized image, code block, runaway hero) used to drag
     the whole layout sideways. This pins horizontal width to the
     viewport so scroll only happens vertically — sidebars and headers
     stay where they should. */
  overflow-x: hidden;
  max-width: 100vw;
}
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}
/* Catch wide images/iframes which are the most common cause of
   horizontal overflow on content pages. Constraining them here means
   we don't have to remember to add max-width:100% to every <img>. */
img, video, iframe, svg { max-width: 100%; height: auto; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, textarea, select { font: inherit; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

/* ============ Layout ============ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 600px) { .container { padding: 0 20px; } }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--gray-600); font-size: 17px; max-width: 600px; margin: 0 auto; }

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-50);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  transition: var(--transition);
  white-space: nowrap;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  vertical-align: middle;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--gray-900); color: var(--white); }
.btn-secondary:hover { background: var(--black); }
.btn-outline { background: transparent; border-color: var(--gray-300); color: var(--gray-800); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: var(--white); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); }

.btn-lg { padding: 0 28px; height: 48px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-sm { padding: 0 14px; height: 34px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 40px; }
.btn-icon.btn-sm { width: 34px; }
.btn-icon.btn-lg { width: 48px; }

/* ============ Forms ============ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 7px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14.5px;
  color: var(--gray-900);
  background: var(--white);
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-50);
}
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12.5px; color: var(--gray-500); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Grid children default to min-width:auto, which lets long <select> options
   and <input type="datetime-local"> blow the grid past its container.
   Forcing min-width:0 keeps the row inside whatever wraps it (e.g. a 520px
   modal) and the inputs respect their 1fr share instead. */
.form-row > * { min-width: 0; }

.input-icon { position: relative; }
.input-icon i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.input-icon .form-control { padding-left: 42px; }

.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox input { accent-color: var(--primary); width: 16px; height: 16px; }

/* ============ Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-700);
  line-height: 1.4;
  white-space: nowrap;
}
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============ Card ============ */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: transparent; }
.card-body { padding: 20px; }
.card-head { padding: 20px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-head h3 { font-size: 17px; }

/* ============ Navbar ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--gray-100);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}
.nav-search {
  flex: 1; max-width: 480px;
  position: relative;
}
.nav-search input {
  width: 100%; padding: 10px 14px 10px 42px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--gray-50);
  font-size: 14px;
  transition: var(--transition);
}
.nav-search input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-50); }
.nav-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 14px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

@media (max-width: 1100px) {
  .nav-search { display: none; }
}
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 80px 0 60px;
  background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 100%);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -150px; right: -150px;
  width: 500px; height: 500px;
  background: radial-gradient(closest-side, rgba(99,102,241,0.18), transparent);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -200px; left: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(closest-side, rgba(245,158,11,0.12), transparent);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  margin-bottom: 18px;
}
.hero h1 .accent-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  font-size: 18px;
  color: var(--gray-600);
  margin-bottom: 28px;
  max-width: 540px;
}
.hero-search {
  display: flex;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  margin-bottom: 28px;
}
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 18px;
  font-size: 15px;
  background: transparent;
}
.hero-stats {
  display: flex;
  gap: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--gray-200);
}
.hero-stat .num { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--gray-900); }
.hero-stat .label { font-size: 13px; color: var(--gray-500); }

.hero-visual {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }

.hero-floating-card {
  position: absolute;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.hero-floating-card .icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--white);
}
.hero-fc-1 { top: 20px; left: -20px; }
.hero-fc-2 { bottom: 20px; right: -20px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; aspect-ratio: 16/10; }
  .hero-stats { gap: 24px; }
}

/* ============ Categories Grid ============ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 18px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  background: var(--white);
}
.cat-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 22px;
  margin-bottom: 12px;
}
.cat-card .name { font-weight: 600; color: var(--gray-900); font-size: 14.5px; }
.cat-card .count { font-size: 12.5px; color: var(--gray-500); margin-top: 3px; }

/* ============ Course Card ============ */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.course-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.course-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: transparent; }
.course-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--gray-100);
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.course-card:hover .course-thumb img { transform: scale(1.05); }
.course-thumb .badge { position: absolute; top: 12px; left: 12px; background: var(--white); }
.course-thumb .play-overlay {
  position: absolute; inset: 0;
  background: rgba(17,24,39,0.5);
  display: grid; place-items: center;
  opacity: 0;
  transition: var(--transition);
}
.course-card:hover .play-overlay { opacity: 1; }
.play-overlay i {
  width: 52px; height: 52px;
  background: var(--white);
  color: var(--primary);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px;
}
.course-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.course-cat { font-size: 12px; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.course-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.35;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-instructor { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }
.course-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--gray-500);
  margin-bottom: 14px;
}
.course-meta i { color: var(--gray-400); margin-right: 4px; }
.course-rating { display: flex; align-items: center; gap: 4px; }
.course-rating .stars { color: var(--accent); }
.course-rating .num { font-weight: 700; color: var(--gray-800); }
.course-rating .count { color: var(--gray-500); font-size: 12px; }
.course-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
  margin-top: auto;
}
.course-price { display: flex; align-items: baseline; gap: 6px; }
.price-current { font-family: var(--font-display); font-size: 19px; font-weight: 800; color: var(--gray-900); }
.price-old { font-size: 13px; color: var(--gray-400); text-decoration: line-through; }

/* ============ Features ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.feature-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
}
.feature-card:hover { border-color: var(--primary-100); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.feature-card h4 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--gray-600); }

/* ============ Testimonials ============ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.testimonial {
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
}
.testimonial .stars { color: var(--accent); margin-bottom: 12px; font-size: 14px; }
.testimonial p { color: var(--gray-700); font-size: 14.5px; margin-bottom: 18px; }
.testimonial-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 15px;
}
.testimonial-user .name { font-weight: 700; font-size: 14.5px; color: var(--gray-900); }
.testimonial-user .role { font-size: 12.5px; color: var(--gray-500); }

/* ============ CTA Section ============ */
.cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-xl);
  padding: 64px 48px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15), transparent 50%);
}
.cta-inner { position: relative; z-index: 1; }
.cta h2 { color: var(--white); margin-bottom: 14px; }
.cta p { font-size: 17px; opacity: 0.9; margin-bottom: 28px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ============ Footer ============ */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 64px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}
.footer h5 { color: var(--white); font-size: 15px; margin-bottom: 18px; font-weight: 700; }
.footer ul { display: flex; flex-direction: column; gap: 10px; }
.footer a { font-size: 14px; color: var(--gray-400); transition: var(--transition); }
.footer a:hover { color: var(--white); }
.footer-brand p { font-size: 14px; color: var(--gray-400); margin: 14px 0 20px; }
.footer .brand { color: var(--white); }
.social { display: flex; gap: 10px; }
.social a {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--gray-800);
  display: grid; place-items: center;
  color: var(--gray-300);
}
.social a:hover { background: var(--primary); color: var(--white); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--gray-500);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============ Utilities ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.hidden { display: none; }
.divider { height: 1px; background: var(--gray-200); margin: 24px 0; }

.icon-circle {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
}
.icon-circle.primary { background: var(--primary-50); color: var(--primary); }
.icon-circle.success { background: var(--success-light); color: var(--success); }
.icon-circle.warning { background: var(--warning-light); color: var(--warning); }
.icon-circle.danger { background: var(--danger-light); color: var(--danger); }
.icon-circle.info { background: var(--info-light); color: var(--info); }

/* ============ Mobile Drawer ============ */
.mobile-drawer {
  position: fixed; top: 0; right: -100%;
  width: 80%; max-width: 320px; height: 100%;
  background: var(--white);
  z-index: 200;
  padding: 24px;
  transition: right 0.3s ease;
  box-shadow: var(--shadow-xl);
}
.mobile-drawer.open { right: 0; }
.mobile-drawer ul { display: flex; flex-direction: column; gap: 6px; margin: 24px 0; }
.mobile-drawer a { padding: 12px 16px; border-radius: var(--radius); font-weight: 500; color: var(--gray-700); display: block; }
.mobile-drawer a:hover { background: var(--gray-50); color: var(--primary); }
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
