/* ==========================================================================
   CourseWalla — Design System & Styles
   ========================================================================== */

:root {
  /* Brand palette */
  --navy-950: #0A1122;
  --navy-900: #12213D;
  --navy-800: #1B2E52;
  --navy-700: #26406E;
  --amber-600: #E68A00;
  --amber-500: #FCA311;
  --amber-400: #FFC24D;
  --teal-600: #0B8A8A;
  --teal-500: #0EA5A5;
  --teal-100: #E1F5F5;

  /* Neutrals */
  --white: #FFFFFF;
  --gray-50: #F7F8FA;
  --gray-100: #EEF1F5;
  --gray-200: #E2E6EC;
  --gray-300: #CBD2DC;
  --gray-500: #6B7787;
  --gray-600: #4E5A6B;
  --gray-700: #364152;
  --gray-800: #232C3A;
  --gray-900: #151B26;

  /* Semantic */
  --bg: var(--gray-50);
  --surface: var(--white);
  --text: var(--gray-800);
  --text-muted: var(--gray-500);
  --border: var(--gray-200);
  --success: #1E9E6B;
  --danger: #D64545;

  /* Type */
  --font-head: 'Poppins', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;

  /* Layout */
  --container: 1180px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(18, 33, 61, 0.08), 0 1px 2px rgba(18, 33, 61, 0.06);
  --shadow-md: 0 8px 24px rgba(18, 33, 61, 0.10);
  --shadow-lg: 0 20px 48px rgba(18, 33, 61, 0.16);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy-900);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.section--muted { background: var(--white); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-600);
  background: var(--teal-100);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.section-head {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-head p { color: var(--text-muted); font-size: 1.02rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.96rem;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--amber-500); color: var(--navy-950); }
.btn-primary:hover { background: var(--amber-600); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-dark { background: var(--navy-900); color: var(--white); }
.btn-dark:hover { background: var(--navy-800); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-outline { background: transparent; border-color: var(--gray-300); color: var(--navy-900); }
.btn-outline:hover { border-color: var(--navy-900); background: var(--white); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 9px 16px; font-size: 0.86rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.28rem; color: var(--navy-900); }
.brand .brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--navy-900), var(--teal-600));
  display: flex; align-items: center; justify-content: center;
  color: var(--amber-400); flex-shrink: 0;
}
.brand .brand-mark svg { width: 20px; height: 20px; }
.brand span.dot { color: var(--amber-500); }

.main-nav { display: flex; align-items: center; gap: 34px; }
.main-nav a {
  font-weight: 500; font-size: 0.96rem; color: var(--gray-700);
  position: relative; padding: 6px 0;
}
.main-nav a:hover, .main-nav a.active { color: var(--navy-900); }
.main-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--amber-500); border-radius: 2px;
}
.header-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none; background: none; border: none; padding: 8px; color: var(--navy-900);
}
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 160% at 100% 0%, #1E3A63 0%, var(--navy-900) 45%, var(--navy-950) 100%);
  color: var(--white);
  padding: 88px 0 100px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.18) 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 65%, rgba(255,255,255,0.14) 50%, transparent 51%),
    radial-gradient(3px 3px at 85% 20%, rgba(255,255,255,0.12) 50%, transparent 51%),
    radial-gradient(2px 2px at 40% 80%, rgba(255,255,255,0.14) 50%, transparent 51%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 700px; }
.hero h1 { color: var(--white); font-size: clamp(2.1rem, 4.4vw, 3.1rem); margin-bottom: 18px; }
.hero h1 em { color: var(--amber-400); font-style: normal; }
.hero p.lead { color: rgba(255,255,255,0.78); font-size: 1.12rem; max-width: 560px; margin-bottom: 34px; }

.hero-search {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  gap: 8px;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
}
.hero-search input {
  flex: 1; border: none; outline: none; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 0.98rem; color: var(--text);
}
.hero-stats { display: flex; gap: 34px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats div strong { display: block; font-family: var(--font-head); font-size: 1.5rem; color: var(--amber-400); }
.hero-stats div span { font-size: 0.86rem; color: rgba(255,255,255,0.65); }

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.cat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal-100); color: var(--teal-600); margin-bottom: 16px;
}
.cat-icon svg { width: 24px; height: 24px; }
.cat-card h3 { font-size: 1.02rem; margin-bottom: 4px; }
.cat-card p { color: var(--text-muted); font-size: 0.86rem; margin: 0; }

/* ---------- Course cards ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.course-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.course-thumb {
  height: 130px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.92);
  font-family: var(--font-head); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.02em;
  position: relative;
}
.course-thumb svg { width: 34px; height: 34px; opacity: 0.85; }
.course-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase;
}
.badge-cat { background: var(--teal-100); color: var(--teal-600); }
.badge-level { background: var(--gray-100); color: var(--gray-600); }
.badge-free { background: #E4F6EC; color: var(--success); }
.course-card h3 { font-size: 1.04rem; margin: 0; }
.course-provider { font-size: 0.84rem; color: var(--text-muted); }
.course-meta {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.course-rating { display: flex; align-items: center; gap: 5px; font-size: 0.86rem; color: var(--gray-700); font-weight: 600; }
.course-rating svg { width: 15px; height: 15px; color: var(--amber-500); }
.course-price { font-family: var(--font-head); font-weight: 700; color: var(--navy-900); }
.course-price.free { color: var(--success); }

/* thumb gradients keyed by category */
.thumb-web { background: linear-gradient(135deg, #1B2E52, #0EA5A5); }
.thumb-data { background: linear-gradient(135deg, #26406E, #6C4FD1); }
.thumb-business { background: linear-gradient(135deg, #0A1122, #E68A00); }
.thumb-design { background: linear-gradient(135deg, #B0356B, #FCA311); }
.thumb-marketing { background: linear-gradient(135deg, #0B8A8A, #12213D); }
.thumb-growth { background: linear-gradient(135deg, #1E9E6B, #12213D); }
.thumb-finance { background: linear-gradient(135deg, #12213D, #4E5A6B); }
.thumb-language { background: linear-gradient(135deg, #C1440E, #E68A00); }

/* ---------- Value props ---------- */
.value-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.value-card { text-align: left; }
.value-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--navy-900); color: var(--amber-400);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.value-icon svg { width: 24px; height: 24px; }
.value-card h3 { font-size: 1.02rem; }
.value-card p { color: var(--text-muted); font-size: 0.92rem; margin: 0; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(120deg, var(--navy-900), var(--navy-950));
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  color: var(--white);
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.cta-banner h2 { color: var(--white); margin-bottom: 8px; }
.cta-banner p { color: rgba(255,255,255,0.72); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: rgba(255,255,255,0.7); padding: 60px 0 26px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
.footer-grid .brand { color: var(--white); margin-bottom: 14px; }
.footer-grid p { font-size: 0.9rem; max-width: 280px; }
.footer-grid h4 { color: var(--white); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid a { font-size: 0.92rem; color: rgba(255,255,255,0.65); }
.footer-grid a:hover { color: var(--amber-400); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 0.84rem;
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
}
.footer-social svg { width: 16px; height: 16px; }
.footer-social a:hover { background: var(--amber-500); color: var(--navy-950); }
.disclosure-note {
  font-size: 0.78rem; color: rgba(255,255,255,0.45); max-width: 720px; margin-top: 10px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--navy-900); }
.breadcrumb span { color: var(--gray-300); }

/* ---------- Page header (inner pages) ---------- */
.page-header {
  background: linear-gradient(120deg, var(--navy-900), var(--navy-800));
  color: var(--white);
  padding: 52px 0 40px;
}
.page-header h1 { color: var(--white); margin-bottom: 8px; }
.page-header p { color: rgba(255,255,255,0.72); margin: 0; max-width: 560px; }

/* ---------- Browse layout ---------- */
.browse-layout { display: grid; grid-template-columns: 260px 1fr; gap: 34px; align-items: start; }
.filter-panel {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 22px; position: sticky; top: 96px;
}
.filter-panel h4 { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-600); margin: 20px 0 12px; }
.filter-panel h4:first-child { margin-top: 0; }
.filter-option { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 0.92rem; color: var(--gray-700); }
.filter-option input { accent-color: var(--teal-600); width: 16px; height: 16px; }
.filter-reset { margin-top: 18px; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.toolbar .result-count { font-size: 0.94rem; color: var(--text-muted); }
.search-box { position: relative; flex: 1; max-width: 320px; }
.search-box input {
  width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none; font-size: 0.92rem;
}
.search-box input:focus { border-color: var(--teal-500); }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--gray-500); }
.sort-select { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; background: var(--white); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 46px; height: 46px; margin-bottom: 14px; color: var(--gray-300); }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 36px; }
.pagination button {
  width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--white); font-weight: 600; color: var(--gray-700);
}
.pagination button.active { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.pagination button:hover:not(.active) { border-color: var(--navy-900); }

/* ---------- Course detail ---------- */
.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.detail-thumb { border-radius: var(--radius-lg); height: 220px; margin-bottom: 28px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.9); }
.detail-thumb svg { width: 56px; height: 56px; opacity: 0.85; }
.detail-main h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.detail-section { margin-top: 34px; }
.detail-section h2 { font-size: 1.2rem; }
.learn-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.learn-list li { display: flex; gap: 10px; font-size: 0.94rem; color: var(--gray-700); align-items: flex-start; }
.learn-list svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; margin-top: 2px; }

.buy-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 26px; position: sticky; top: 96px;
}
.buy-card .price { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; color: var(--navy-900); margin-bottom: 4px; }
.buy-card .price.free { color: var(--success); }
.buy-card .price-note { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 20px; }
.buy-card .spec-list { margin: 20px 0; }
.buy-card .spec-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.buy-card .spec-list li:last-child { border-bottom: none; }
.buy-card .spec-list span:first-child { color: var(--text-muted); }
.buy-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 14px; text-align: center; }

.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 18px; }

/* ---------- About page ---------- */
.about-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: center; }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 20px; }
.stat-strip div { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; text-align: center; }
.stat-strip strong { display: block; font-family: var(--font-head); font-size: 1.6rem; color: var(--navy-900); }
.stat-strip span { font-size: 0.82rem; color: var(--text-muted); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-card { text-align: center; padding: 10px; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--amber-500); color: var(--navy-950);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700;
  margin: 0 auto 16px;
}

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 46px; align-items: start; }
.contact-info-card {
  background: var(--navy-900); color: var(--white); border-radius: var(--radius-lg); padding: 32px;
}
.contact-info-card h3 { color: var(--white); }
.contact-info-row { display: flex; gap: 14px; margin-top: 20px; align-items: flex-start; }
.contact-info-row .ic {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-info-row .ic svg { width: 18px; height: 18px; color: var(--amber-400); }
.contact-info-row span { font-size: 0.9rem; color: rgba(255,255,255,0.75); }
.contact-form { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.86rem; font-weight: 600; color: var(--gray-700); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none; font-size: 0.94rem; background: var(--gray-50);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal-500); background: var(--white); }
.field textarea { resize: vertical; min-height: 120px; }
.form-msg { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 18px; display: none; }
.form-msg.show { display: block; }
.form-msg.success { background: #E4F6EC; color: var(--success); }
.form-msg.error { background: #FBE9E9; color: var(--danger); }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
  .browse-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .detail-layout { grid-template-columns: 1fr; }
  .buy-card { position: static; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .about-hero { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav, .header-actions .btn { display: none; }
  .nav-toggle { display: block; }
  .cat-grid, .course-grid, .value-grid, .related-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 70px; }
  .hero-search { flex-direction: column; }
  .hero-stats { gap: 22px; }
  .cta-banner { flex-direction: column; align-items: flex-start; padding: 40px 26px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .section { padding: 52px 0; }
}

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed; inset: 74px 0 0 0; background: var(--white); z-index: 99;
  padding: 24px; overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 14px 0; font-size: 1.05rem; font-weight: 600; color: var(--navy-900); border-bottom: 1px solid var(--border); }
.mobile-nav .btn { margin-top: 20px; }
