/* =========================================================================
   Sarh LMS - stylesheet
   ========================================================================= */
/* Self-hosted Inter (variable font, latin subset) - no external font requests needed. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2');
}

:root {
  --primary: #5624d0;
  --primary-dark: #401b9c;
  --primary-light: #ede5f9;
  --accent: #a435f0;
  --dark: #1c1d1f;
  --gray: #6a6f73;
  --gray-light: #d1d7dc;
  --bg: #f7f9fa;
  --white: #ffffff;
  --star: #eb8a2f;
  --green: #1e6055;
  --green-light: #e0f2ec;
  --red: #d2413a;
  --red-light: #fbe9e8;
  --yellow: #f3ca8c;
  --yellow-light: #fdf4e3;
  --blue-light: #e4f0ff;
  --radius: 6px;
  --shadow: 0 2px 4px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.14);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 2.2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.15rem; } h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
.container { width: 100%; max-width: 1340px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 900px; }
.muted { color: var(--gray); }
.muted-light { color: #cfd4d8; }
.small { font-size: .8rem; }
.tiny { font-size: .72rem; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2.5rem; }
.flex { display: flex; gap: 1rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1; }
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: -4px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 0 1.2rem; height: 48px; font: inherit; font-weight: 700; font-size: 1rem;
  border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-outline { background: #fff; color: var(--dark); border-color: var(--dark); }
.btn-outline:hover { background: #f7f9fa; color: var(--dark); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #164b43; color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-light); }
.btn-sm { height: 36px; font-size: .85rem; padding: 0 .9rem; }
.btn-xs { height: 30px; font-size: .78rem; padding: 0 .6rem; font-weight: 600; }
.btn-lg { height: 54px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-icon { padding: 0; width: 40px; height: 40px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .35rem; }
.form-control, input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: .7rem .9rem; font: inherit; font-size: .95rem; color: var(--dark);
  border: 1px solid var(--dark); border-radius: var(--radius); background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(86,36,208,.18); border-color: var(--primary); }
textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: .8rem; color: var(--gray); margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.checkbox input { width: auto; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.08); }
.header-inner { display: flex; align-items: center; gap: 1rem; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.35rem; color: var(--dark); letter-spacing: -.02em; }
.logo:hover { color: var(--primary); }
.logo-light { color: #fff; } .logo-light:hover { color: #fff; }
.nav-link { color: var(--dark); font-size: .9rem; padding: .5rem .6rem; border-radius: 4px; white-space: nowrap; }
.nav-link:hover { color: var(--primary); }
.search-form { flex: 1; position: relative; max-width: 700px; }
.search-form input { height: 48px; padding-left: 48px; border-radius: 999px; border: 1px solid var(--dark); background: var(--bg); font-size: .9rem; }
.search-form button { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--gray); cursor: pointer; display: flex; padding: 0; }
.header-right { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--dark); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--bg); color: var(--primary); }
.cart-badge { position: absolute; top: 2px; right: 2px; background: var(--primary); color: #fff; font-size: .65rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 36px; height: 36px; font-size: .85rem; }
.avatar-md { width: 48px; height: 48px; font-size: 1rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 2rem; }
.avatar-xl { width: 128px; height: 128px; font-size: 2.6rem; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; display: flex; }
.menu-toggle { display: none; }

.nav-item { position: relative; }
.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 260px; background: #fff; border: 1px solid var(--gray-light); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .5rem 0; display: none; z-index: 200; margin-top: 4px;
}
.dropdown-right { left: auto; right: 0; }
.has-dropdown:hover .dropdown, .has-dropdown.open .dropdown { display: block; }
.has-dropdown::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 8px; }
.dropdown a { display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; color: var(--dark); font-size: .9rem; }
.dropdown a:hover { background: var(--bg); color: var(--primary); }
.dropdown-head { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--gray-light); margin-bottom: .4rem; }
.mobile-menu { display: none; padding: 1rem 24px; border-top: 1px solid var(--gray-light); background: #fff; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: .6rem 0; color: var(--dark); font-weight: 500; }
.mobile-menu .search-form { margin-bottom: .6rem; }
.mobile-menu-title { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--gray-light); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); font-weight: 700; }

/* ---------- Demo bar ---------- */
.demo-bar { background: var(--yellow-light); border-bottom: 1px solid #f0d9a5; color: #5a4a1a; font-size: .85rem; text-align: center; padding: .45rem 16px; }
.demo-bar a { font-weight: 700; color: var(--primary); text-decoration: underline; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; top: 84px; right: 20px; z-index: 500; display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.toast { padding: .8rem 1rem; border-radius: var(--radius); background: var(--dark); color: #fff; box-shadow: var(--shadow-lg); font-size: .9rem; animation: toast-in .25s ease; border-left: 4px solid var(--primary); }
.toast-success { border-left-color: #2ecc71; }
.toast-error { border-left-color: var(--red); }
.toast-info { border-left-color: #3498db; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; background: linear-gradient(120deg, #2d1b69 0%, #5624d0 45%, #a435f0 100%); color: #fff; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 40%), radial-gradient(circle at 20% 80%, rgba(255,255,255,.10), transparent 40%); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; min-height: 440px; padding-top: 3rem; padding-bottom: 3rem; }
.hero-inner > * { min-width: 0; }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -.03em; }
.hero p.lead { font-size: 1.15rem; opacity: .92; max-width: 520px; }
.hero-search { display: flex; background: #fff; border-radius: 999px; padding: 6px; max-width: 560px; margin-top: 1.5rem; box-shadow: var(--shadow-lg); }
.hero-search input { border: 0; background: none; flex: 1; min-width: 0; width: 100%; padding: 0 1.2rem; font-size: 1rem; }
.hero-search input:focus { box-shadow: none; }
.hero-search .btn { border-radius: 999px; }
.hero-art { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hero-card { background: rgba(255,255,255,.12); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 1.2rem; }
.hero-card strong { font-size: 1.8rem; display: block; }
.hero-card span { font-size: .85rem; opacity: .85; }
.hero-card:nth-child(2) { transform: translateY(24px); }
.hero-card:nth-child(3) { transform: translateY(-12px); }
.hero-art-photo { display: block; position: relative; padding: 0 20px 28px 28px; }
.hero-photo { width: 100%; aspect-ratio: 9 / 7; object-fit: cover; border-radius: 18px; box-shadow: 0 24px 48px rgba(0,0,0,.35); display: block; }
.hero-card-float { position: absolute; background: #fff; color: var(--dark); border: 0; box-shadow: var(--shadow-lg); transform: none !important; min-width: 170px; }
.hero-card-float strong { color: var(--primary); }
.hero-card-float span { color: var(--gray); opacity: 1; }
.hero-card-a { left: 0; bottom: 0; }
.hero-card-b { right: 0; top: 28px; }
.cta-photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; display: block; }
.teach-hero-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.teach-photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; box-shadow: 0 24px 48px rgba(0,0,0,.35); }

/* ---------- Sections ---------- */
.section { padding-top: 3rem; padding-bottom: 3rem; }
.section-alt { background: var(--bg); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.75rem; }
.section-head p { margin: .3rem 0 0; color: var(--gray); }

/* ---------- Course cards ---------- */
.course-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.course-grid-5 { grid-template-columns: repeat(5, 1fr); }
.course-card { background: #fff; border-radius: var(--radius); display: flex; flex-direction: column; position: relative; transition: transform .15s, box-shadow .15s; border: 1px solid transparent; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--gray-light); }
.course-card-link { color: inherit; display: flex; flex-direction: column; flex: 1; }
.course-card-link:hover { color: inherit; }
.course-thumb { aspect-ratio: 16/9; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: #eee; border: 1px solid var(--gray-light); }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-body { padding: .7rem .5rem .9rem; flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.course-title { font-size: 1rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.course-instructor { font-size: .78rem; color: var(--gray); margin: 0; }
.course-rating { display: flex; align-items: center; gap: .3rem; font-size: .8rem; }
.course-price { font-size: 1rem; margin-top: .2rem; }
.course-price s { font-weight: 400; font-size: .85rem; margin-left: .2rem; }
.course-card-footer { padding: 0 .5rem .8rem; }
.badge { display: inline-block; padding: .2rem .5rem; font-size: .72rem; font-weight: 700; border-radius: 3px; background: var(--yellow); color: #3d3c0a; align-self: flex-start; margin-top: .3rem; }
.badge-bestseller { background: #eceb98; color: #3d3c0a; }
.badge-new { background: #cfe8f4; color: #0d3b52; }
.badge-highest-rated { background: #d3f0e5; color: #0f4d3d; }
.badge-draft { background: #eee; color: #555; }
.badge-published { background: var(--green-light); color: var(--green); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-danger { background: var(--red-light); color: var(--red); }

/* Stars */
.rating { display: inline-flex; align-items: center; gap: .3rem; }
.rating-number { color: #b4690e; font-size: .85rem; }
.stars { position: relative; display: inline-block; font-size: .9rem; letter-spacing: 1px; color: #dcdcdc; line-height: 1; }
.stars > span { background: linear-gradient(90deg, var(--star) var(--pct), #dcdcdc var(--pct)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Progress bar */
.progress { height: 6px; background: var(--gray-light); border-radius: 3px; overflow: hidden; margin-top: .4rem; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.progress-lg { height: 10px; }

/* ---------- Category tiles ---------- */
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.category-tile { background: #fff; border: 1px solid var(--gray-light); border-radius: 8px; padding: 1.4rem 1rem; text-align: center; color: var(--dark); transition: all .15s; }
.category-tile:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--primary); }
.category-tile .cat-icon { font-size: 2rem; margin-bottom: .5rem; }
.category-tile strong { display: block; font-size: .95rem; }
.category-tile span { font-size: .78rem; color: var(--gray); }

/* Stats / features */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { text-align: center; padding: 1.2rem; }
.stat strong { display: block; font-size: 2rem; color: var(--primary); }
.stat span { color: var(--gray); font-size: .9rem; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature { padding: 1.5rem; background: #fff; border-radius: 8px; border: 1px solid var(--gray-light); }
.feature .icon { width: 36px; height: 36px; color: var(--primary); margin-bottom: .8rem; }

.cta-banner { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 2rem; background: var(--dark); color: #fff; border-radius: 12px; padding: 3rem; }
.cta-banner h2 { font-size: 2rem; }
.cta-banner p { color: #cfd4d8; }
.cta-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.cta-art div { aspect-ratio: 1; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--accent)); opacity: .85; }
.cta-art div:nth-child(2) { background: linear-gradient(135deg, #f7971e, #ffd200); }
.cta-art div:nth-child(3) { background: linear-gradient(135deg, #11998e, #38ef7d); }
.cta-art div:nth-child(4) { background: linear-gradient(135deg, #fc466b, #3f5efb); }
.cta-art div:nth-child(5) { background: linear-gradient(135deg, #00c6ff, #0072ff); }
.cta-art div:nth-child(6) { background: linear-gradient(135deg, #ee0979, #ff6a00); }

.testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.testimonial { background: #fff; border: 1px solid var(--gray-light); border-radius: 8px; padding: 1.5rem; }
.testimonial p { font-style: italic; color: #3e4143; }
.testimonial .flex { margin-top: 1rem; }

/* ---------- Catalog ---------- */
.catalog { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; }
.filters { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; }
.filter-group { border-top: 1px solid var(--gray-light); padding: 1rem 0; }
.filter-group h4 { margin-bottom: .6rem; }
.filter-group label { display: flex; align-items: center; gap: .5rem; font-weight: 400; font-size: .9rem; margin: .3rem 0; cursor: pointer; }
.filter-group label input { width: auto; }
.filter-group a { display: block; color: var(--dark); font-size: .9rem; padding: .2rem 0; }
.filter-group a.active { color: var(--primary); font-weight: 700; }
.course-row { display: grid; grid-template-columns: 260px 1fr auto; gap: 1.2rem; padding: 1.2rem 0; border-bottom: 1px solid var(--gray-light); color: inherit; }
.course-row:hover { color: inherit; }
.course-row .course-thumb { border-radius: var(--radius); }
.course-row h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.course-row .price { font-weight: 700; font-size: 1.05rem; text-align: right; white-space: nowrap; }
.course-row .price s { color: var(--gray); font-weight: 400; font-size: .9rem; display: block; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.catalog-toolbar select { width: auto; padding: .5rem 2rem .5rem .8rem; }
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; }
.page-link { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--gray-light); border-radius: 50%; color: var(--dark); font-weight: 600; }
.page-link.active, .page-link:hover { background: var(--dark); color: #fff; border-color: var(--dark); }
.empty { text-align: center; padding: 4rem 1rem; color: var(--gray); }
.empty .icon { width: 56px; height: 56px; color: var(--gray-light); margin: 0 auto 1rem; }

/* ---------- Course detail ---------- */
.course-hero { background: var(--dark); color: #fff; padding: 2.5rem 0; }
.course-hero-inner { max-width: 760px; }
.course-hero h1 { font-size: 2.1rem; }
.course-hero .lead { font-size: 1.15rem; color: #d1d7dc; }
.course-hero .meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .9rem; color: #d1d7dc; align-items: center; }
.course-hero .meta a { color: #cec0fc; text-decoration: underline; }
.course-hero .rating-number { color: #f3ca8c; }
.breadcrumb { font-size: .85rem; color: #cec0fc; margin-bottom: 1rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.breadcrumb a { color: #cec0fc; font-weight: 700; }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 3rem; align-items: start; }
.course-main { max-width: 760px; }
.course-main section { margin-bottom: 2.5rem; }
.course-main h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.buy-box { position: sticky; top: calc(var(--header-h) + 16px); background: #fff; box-shadow: var(--shadow-lg); border-radius: var(--radius); overflow: hidden; }
.buy-box-float { margin-top: -220px; }
.buy-box .course-thumb { border-radius: 0; border: 0; position: relative; }
.buy-box .preview-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; background: rgba(0,0,0,.3); font-weight: 700; gap: .5rem; }
.buy-box .preview-overlay .icon { width: 56px; height: 56px; }
.buy-box-body { padding: 1.5rem; }
.buy-price { display: flex; align-items: baseline; gap: .6rem; margin-bottom: 1rem; }
.buy-price strong { font-size: 2rem; }
.buy-price s { color: var(--gray); }
.buy-price .off { color: var(--gray); font-size: .9rem; }
.buy-note { text-align: center; font-size: .78rem; color: var(--gray); margin: .8rem 0 1.2rem; }
.includes li { display: flex; gap: .6rem; align-items: center; font-size: .9rem; margin: .4rem 0; }
.learn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1.5rem; border: 1px solid var(--gray-light); padding: 1.5rem; border-radius: var(--radius); }
.learn-grid li { display: flex; gap: .6rem; font-size: .9rem; }
.learn-grid .icon { flex-shrink: 0; color: var(--dark); }
.req-list li, .bullet-list li { list-style: disc; margin-left: 1.2rem; margin-bottom: .3rem; }
.curriculum { border: 1px solid var(--gray-light); border-radius: var(--radius); }
.curriculum-summary { font-size: .9rem; color: var(--gray); margin-bottom: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.acc-section + .acc-section { border-top: 1px solid var(--gray-light); }
.acc-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; background: var(--bg); cursor: pointer; font-weight: 700; user-select: none; }
.acc-head .icon { transition: transform .2s; }
.acc-section.open .acc-head .icon { transform: rotate(180deg); }
.acc-head .meta { margin-left: auto; font-weight: 400; font-size: .85rem; color: var(--gray); white-space: nowrap; }
.acc-body { display: none; }
.acc-section.open .acc-body { display: block; }
.lesson-row { display: flex; align-items: center; gap: .8rem; padding: .6rem 1rem .6rem 1.4rem; font-size: .9rem; border-top: 1px solid #eee; }
.lesson-row .icon { color: var(--gray); width: 16px; height: 16px; }
.lesson-row .lesson-dur { margin-left: auto; color: var(--gray); font-size: .85rem; }
.lesson-row .preview-link { color: var(--primary); text-decoration: underline; font-size: .85rem; }
.instructor-card { display: grid; grid-template-columns: 112px 1fr; gap: 1.5rem; }
.instructor-card .stats { font-size: .9rem; margin: .8rem 0; }
.instructor-card .stats li { display: flex; gap: .5rem; align-items: center; margin: .3rem 0; }
.rating-summary { display: grid; grid-template-columns: 140px 1fr; gap: 2rem; align-items: center; margin-bottom: 2rem; }
.rating-big { text-align: center; }
.rating-big strong { display: block; font-size: 4rem; color: #b4690e; line-height: 1; }
.rating-bars li { display: grid; grid-template-columns: 1fr 110px 40px; gap: .8rem; align-items: center; font-size: .85rem; margin: .3rem 0; }
.rating-bars .progress { margin: 0; height: 8px; }
.rating-bars .progress-bar { background: var(--gray); }
.review { display: grid; grid-template-columns: 48px 1fr; gap: 1rem; padding: 1.2rem 0; border-top: 1px solid var(--gray-light); }
.review-form { background: var(--bg); padding: 1.5rem; border-radius: var(--radius); margin-top: 1.5rem; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .2rem; }
.star-input input { display: none; }
.star-input label { font-size: 1.8rem; color: #dcdcdc; cursor: pointer; margin: 0; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }
.description-text p { color: #2d2f31; }
.tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--gray-light); margin-bottom: 1.5rem; overflow-x: auto; }
.tab { padding: .7rem 0; font-weight: 700; color: var(--gray); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--dark); border-bottom-color: var(--dark); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- Cart / checkout ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 3rem; align-items: start; }
.cart-item { display: grid; grid-template-columns: 140px 1fr auto; gap: 1.2rem; padding: 1.2rem 0; border-top: 1px solid var(--gray-light); align-items: start; }
.cart-item .course-thumb { border-radius: var(--radius); }
.cart-item h3 { font-size: 1rem; margin-bottom: .2rem; }
.cart-item .price { text-align: right; font-weight: 700; color: var(--primary); }
.cart-item .actions a { display: block; font-size: .85rem; margin-top: .2rem; }
.summary { position: sticky; top: calc(var(--header-h) + 16px); }
.summary .total { font-size: 2.2rem; font-weight: 800; }
.summary .row { display: flex; justify-content: space-between; margin: .3rem 0; font-size: .95rem; }
.demo-note { background: var(--yellow-light); border: 1px solid #f0d9a5; border-radius: var(--radius); padding: .8rem 1rem; font-size: .9rem; margin-bottom: 1.5rem; }
.payment-card { border: 1px solid var(--gray-light); border-radius: var(--radius); padding: 1.5rem; }
.pay-methods { display: flex; gap: .6rem; margin-bottom: 1.2rem; }
.pay-method { flex: 1; border: 2px solid var(--gray-light); border-radius: var(--radius); padding: .7rem; text-align: center; cursor: pointer; font-weight: 600; font-size: .9rem; }
.pay-method.active { border-color: var(--primary); background: var(--primary-light); }
.order-row { display: flex; gap: 1rem; padding: .6rem 0; border-top: 1px solid #eee; font-size: .9rem; }
.order-row span:last-child { margin-left: auto; font-weight: 700; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 440px; margin: 3rem auto; }
.auth-card { border: 1px solid var(--gray-light); border-radius: 8px; padding: 2rem; }
.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 1.5rem; }
.demo-accounts { margin-top: 1.5rem; background: var(--bg); padding: 1rem; border-radius: var(--radius); font-size: .85rem; }
.demo-accounts table { width: 100%; border-collapse: collapse; }
.demo-accounts td { padding: .3rem .2rem; border-top: 1px solid #e5e5e5; }
.demo-accounts button { font: inherit; color: var(--primary); background: none; border: 0; cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------- Dashboard (student / instructor / admin) ---------- */
.page-head { background: var(--dark); color: #fff; padding: 2.5rem 0; }
.page-head h1 { margin: 0; }
.page-head p { color: #d1d7dc; margin: .3rem 0 0; }
.dash-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; padding: 2rem 0; }
.dash-nav { position: sticky; top: calc(var(--header-h) + 16px); }
.dash-nav a { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: var(--radius); color: var(--dark); font-weight: 500; font-size: .95rem; }
.dash-nav a:hover { background: var(--bg); }
.dash-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border: 1px solid var(--gray-light); border-radius: 8px; padding: 1.3rem; display: flex; gap: 1rem; align-items: center; }
.stat-card .icon { width: 44px; height: 44px; padding: 10px; border-radius: 10px; background: var(--primary-light); color: var(--primary); }
.stat-card strong { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat-card span { font-size: .82rem; color: var(--gray); }
.card { background: #fff; border: 1px solid var(--gray-light); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-title h2, .card-title h3 { margin: 0; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; padding: .7rem .8rem; border-bottom: 2px solid var(--gray-light); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gray); }
.table td { padding: .7rem .8rem; border-bottom: 1px solid #eee; vertical-align: middle; }
.table tr:hover td { background: var(--bg); }
.table .thumb-sm { width: 80px; aspect-ratio: 16/9; border-radius: 4px; object-fit: cover; }
.table .actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.table select { padding: .3rem .5rem; font-size: .85rem; width: auto; }
.inline-form { display: inline; }

/* Curriculum builder */
.builder-section { border: 1px solid var(--gray-light); border-radius: var(--radius); margin-bottom: 1rem; background: #fff; }
.builder-section-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; background: var(--bg); border-bottom: 1px solid var(--gray-light); }
.builder-section-head h3 { margin: 0; font-size: 1rem; flex: 1; }
.builder-lesson { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; border-top: 1px solid #eee; font-size: .9rem; }
.builder-lesson:first-child { border-top: 0; }
.builder-lesson .grow { display: flex; align-items: center; gap: .5rem; }
.builder-lesson .type { font-size: .72rem; text-transform: uppercase; padding: .15rem .4rem; border-radius: 3px; background: var(--primary-light); color: var(--primary); font-weight: 700; }
.builder-add { padding: .8rem 1rem; border-top: 1px dashed var(--gray-light); }
.inline-add { display: flex; gap: .6rem; }
.inline-add input { flex: 1; }
.quiz-question { border: 1px solid var(--gray-light); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; background: var(--bg); }
.quiz-question .form-row { grid-template-columns: 1fr 1fr; }
.upload-preview { width: 240px; aspect-ratio: 16/9; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--gray-light); margin-bottom: .6rem; }

/* ---------- Learning player ---------- */
body.player-body { background: var(--dark); }
.player-header { background: var(--dark); color: #fff; height: 56px; display: flex; align-items: center; gap: 1rem; padding: 0 1.2rem; border-bottom: 1px solid #3e4143; position: sticky; top: 0; z-index: 100; }
.player-header .logo { font-size: 1.1rem; color: #fff; }
.player-header .course-name { flex: 1; font-weight: 600; font-size: .95rem; border-left: 1px solid #3e4143; padding-left: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-progress { display: flex; align-items: center; gap: .6rem; font-size: .85rem; white-space: nowrap; }
.player-progress .ring { width: 36px; height: 36px; border-radius: 50%; background: conic-gradient(var(--accent) var(--pct), #3e4143 0); display: grid; place-items: center; }
.player-progress .ring::after { content: ''; width: 28px; height: 28px; border-radius: 50%; background: var(--dark); }
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - 56px); }
.player-main { background: #fff; }
.video-wrap { background: #000; aspect-ratio: 16/9; max-height: 70vh; width: 100%; position: relative; }
.video-wrap iframe, .video-wrap video { width: 100%; height: 100%; border: 0; }
.no-video { display: flex; align-items: center; justify-content: center; height: 100%; color: #fff; flex-direction: column; gap: .5rem; }
.player-content { padding: 1.5rem 2.5rem 3rem; max-width: 900px; }
.player-content h1 { font-size: 1.6rem; }
.player-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin: 1.2rem 0; padding-bottom: 1.2rem; border-bottom: 1px solid var(--gray-light); }
.article-content { font-size: 1.02rem; line-height: 1.7; }
.article-content h2, .article-content h3 { margin-top: 1.5rem; }
.article-content pre { background: var(--dark); color: #eee; padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
.article-content code { background: var(--bg); padding: .1rem .3rem; border-radius: 3px; font-size: .9em; }
.article-content pre code { background: none; padding: 0; }
.player-sidebar { background: #fff; border-left: 1px solid var(--gray-light); height: calc(100vh - 56px); overflow-y: auto; position: sticky; top: 56px; }
.player-sidebar .sidebar-title { padding: 1rem; font-weight: 700; border-bottom: 1px solid var(--gray-light); display: flex; justify-content: space-between; align-items: center; }
.player-sidebar .acc-head { font-size: .9rem; }
.player-sidebar .acc-head small { display: block; font-weight: 400; color: var(--gray); font-size: .78rem; }
.player-lesson { display: flex; align-items: flex-start; gap: .7rem; padding: .7rem 1rem; font-size: .88rem; color: var(--dark); border-top: 1px solid #eee; }
.player-lesson:hover { background: var(--bg); color: var(--dark); }
.player-lesson.active { background: #d1d7dc55; }
.player-lesson .check { width: 18px; height: 18px; border: 1px solid var(--gray); border-radius: 3px; display: grid; place-items: center; flex-shrink: 0; margin-top: 2px; color: #fff; }
.player-lesson.done .check { background: var(--dark); border-color: var(--dark); }
.player-lesson .check .icon { width: 12px; height: 12px; }
.player-lesson .lesson-sub { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--gray); margin-top: .1rem; }
.player-lesson .lesson-sub .icon { width: 12px; height: 12px; }
.quiz-box { border: 1px solid var(--gray-light); border-radius: 8px; padding: 1.5rem; margin-top: 1rem; }
.quiz-q { margin-bottom: 1.5rem; }
.quiz-q h4 { margin-bottom: .6rem; }
.quiz-opt { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--gray-light); border-radius: var(--radius); margin: .4rem 0; cursor: pointer; font-weight: 400; }
.quiz-opt:hover { border-color: var(--primary); }
.quiz-opt input { width: auto; }
.quiz-opt.correct { border-color: var(--green); background: var(--green-light); }
.quiz-opt.wrong { border-color: var(--red); background: var(--red-light); }
.quiz-result { padding: 1rem 1.2rem; border-radius: var(--radius); font-weight: 600; margin-bottom: 1rem; }
.quiz-result.pass { background: var(--green-light); color: var(--green); }
.quiz-result.fail { background: var(--red-light); color: var(--red); }
.complete-banner { background: linear-gradient(120deg, var(--primary), var(--accent)); color: #fff; padding: 1.5rem; border-radius: 8px; display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.complete-banner .icon { width: 48px; height: 48px; }

/* ---------- Certificate ---------- */
.certificate { max-width: 1000px; margin: 2rem auto; background: #fff; border: 14px double var(--primary); padding: 4rem 3rem; text-align: center; position: relative; }
.certificate h1 { font-size: 2.8rem; text-transform: uppercase; letter-spacing: .15em; color: var(--primary); }
.certificate .name { font-size: 2.4rem; font-weight: 800; margin: 1rem 0; border-bottom: 2px solid var(--dark); display: inline-block; padding: 0 2rem .3rem; }
.certificate .course { font-size: 1.5rem; font-weight: 700; margin: .5rem 0 2rem; }
.certificate .sig { display: flex; justify-content: space-around; margin-top: 3rem; }
.certificate .sig div { border-top: 1px solid var(--dark); padding-top: .5rem; min-width: 220px; font-size: .9rem; }
.certificate .seal { width: 90px; height: 90px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; margin: 1rem auto 0; }
@media print { .site-header, .site-footer, .no-print, .toast-stack { display: none !important; } .certificate { margin: 0; border-width: 10px; } body { background: #fff; } }

/* ---------- Teach page ---------- */
.teach-hero { background: linear-gradient(120deg, #1c1d1f, #3d2c8d); color: #fff; padding: 4rem 0; }
.teach-hero h1 { font-size: 3rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.step { text-align: center; padding: 1.5rem; }
.step .num { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; margin: 0 auto 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #fff; padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid #3e4143; }
.footer-grid h4 { color: #fff; margin-bottom: .8rem; }
.footer-grid a { display: block; color: #cfd4d8; font-size: .9rem; margin: .35rem 0; }
.footer-grid a:hover { color: #fff; }
.footer-grid p { font-size: .9rem; margin-top: 1rem; max-width: 380px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 1.5rem; font-size: .85rem; color: #cfd4d8; }
.footer-lang { display: flex; align-items: center; gap: .4rem; border: 1px solid #cfd4d8; padding: .4rem .8rem; border-radius: 4px; }

/* ---------- Alerts ---------- */
.alert { padding: .9rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.2rem; font-size: .92rem; border: 1px solid transparent; }
.alert-error { background: var(--red-light); color: #7a1f1a; border-color: #f2c4c1; }
.alert-success { background: var(--green-light); color: var(--green); border-color: #b9dfd1; }
.alert-info { background: var(--blue-light); color: #1d4f8c; border-color: #bfd8f7; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .course-grid, .course-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .hide-lg { display: none !important; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .course-layout { grid-template-columns: 1fr; }
  .buy-box { position: static; margin-top: 0; }
  .buy-box-float { margin-top: 0; }
  .player-layout { grid-template-columns: 1fr; }
  .player-sidebar { position: static; height: auto; border-left: 0; border-top: 1px solid var(--gray-light); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .hide-md { display: none !important; }
  .menu-toggle { display: inline-flex; }
  .header-inner > .search-form { display: none; }
  .hero-inner { grid-template-columns: 1fr; min-height: 0; }
  .hero h1 { font-size: 2.2rem; }
  .hero-art { display: none; }
  .teach-hero-inner { grid-template-columns: 1fr; }
  .teach-photo { display: none; }
  .course-grid, .course-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-bar, .features, .testimonials, .steps { grid-template-columns: 1fr; }
  .cta-banner { grid-template-columns: 1fr; padding: 2rem; }
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; }
  .course-row { grid-template-columns: 1fr; }
  .course-row .price { text-align: left; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-nav { position: static; display: flex; overflow-x: auto; gap: .3rem; }
  .dash-nav a { white-space: nowrap; }
  .learn-grid { grid-template-columns: 1fr; }
  .rating-summary { grid-template-columns: 1fr; }
  .instructor-card { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .player-content { padding: 1.2rem; }
  .player-header .course-name { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .certificate { padding: 2rem 1rem; }
  .certificate h1 { font-size: 1.8rem; }
  .certificate .name { font-size: 1.6rem; }
  .certificate .sig { flex-direction: column; gap: 1.5rem; align-items: center; }
}
@media (max-width: 520px) {
  .course-grid, .course-grid-5 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .header-inner { gap: .4rem; }
  .logo span { display: none; }
  .header-right { gap: .2rem; }
  .header-right .btn { padding: 0 .6rem; }
  .hero h1 { font-size: 1.9rem; }
  .hero-search { padding: 4px; }
  .hero-search .btn { padding: 0 .9rem; height: 42px; }
  .cart-item { grid-template-columns: 1fr; }
  .player-header { padding: 0 .8rem; gap: .5rem; }
  .player-header .btn { padding: 0 .6rem; font-size: .78rem; }
}
