/* ============================================
   EduLearn Design System
   ============================================ */

:root {
  --bg:           #F8F8F5;
  --bg-alt:       #FFFFFF;
  --bg-muted:     #F0F0EC;
  --text:         #1A1A1A;
  --text-2:       #4A4A4A;
  --text-3:       #7A7A7A;
  --text-4:       #ABABAB;
  --accent:       #2D6BE4;
  --accent-hover: #2459C7;
  --accent-light: #EEF3FE;
  --accent-text:  #1E4BAB;
  --border:       #E4E4DF;
  --border-2:     #D0D0CB;
  --success:      #16A34A;
  --success-bg:   #DCFCE7;
  --error:        #DC2626;
  --error-bg:     #FEE2E2;
  --warning:      #D97706;
  --warning-bg:   #FEF3C7;
  --shadow-xs:    0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.06);
  --shadow-md:    0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 40px rgba(0,0,0,.12);
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-full:  9999px;
  --nav-h:        64px;
  --transition:   .2s cubic-bezier(.4,0,.2,1);
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
  --bg:           #111110;
  --bg-alt:       #1C1C1A;
  --bg-muted:     #242422;
  --text:         #F0F0EC;
  --text-2:       #C8C8C4;
  --text-3:       #8A8A86;
  --text-4:       #5A5A56;
  --accent:       #4A7FFF;
  --accent-hover: #6090FF;
  --accent-light: #1A2640;
  --accent-text:  #90AAFF;
  --border:       #2A2A28;
  --border-2:     #3A3A38;
  --shadow-xs:    0 1px 2px rgba(0,0,0,.2);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.3);
  --shadow-md:    0 4px 20px rgba(0,0,0,.4);
  --shadow-lg:    0 8px 40px rgba(0,0,0,.5);
}

/* ============================================ Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }

/* ============================================ Typography */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.3; letter-spacing: -.015em; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.1rem; font-weight: 600; }
h5 { font-size: .875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
p  { color: var(--text-2); line-height: 1.7; }

/* ============================================ Layout */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.container--wide { max-width: 1480px; margin: 0 auto; padding: 0 24px; }

/* ============================================ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-size: .9375rem; font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap; line-height: 1;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn--primary {
  background: var(--text); color: var(--bg);
}
.btn--primary:hover { background: var(--text-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--accent {
  background: var(--accent); color: #fff;
}
.btn--accent:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(45,107,228,.3); }
.btn--ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border-2);
}
.btn--ghost:hover { background: var(--bg-muted); border-color: var(--text-4); }
.btn--danger { background: var(--error); color: #fff; }
.btn--danger:hover { background: #B91C1C; }
.btn--sm { padding: 8px 16px; font-size: .875rem; }
.btn--lg { padding: 14px 30px; font-size: 1.0625rem; }
.btn--full { width: 100%; }
.btn--icon { padding: 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ============================================ Form Elements */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: .875rem; font-weight: 500; color: var(--text-2);
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px;
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9375rem; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.form-input::placeholder { color: var(--text-4); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-error { font-size: .8125rem; color: var(--error); margin-top: 4px; }
.form-hint  { font-size: .8125rem; color: var(--text-3); margin-top: 4px; }

.input-wrap { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.input-icon ~ .form-input { padding-left: 40px; }
.input-icon svg { width: 18px; height: 18px; }

.input-group { display: flex; gap: 10px; }
.input-group .form-input { flex: 1; }

/* ============================================ Navigation */
.nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav__inner {
  max-width: 1480px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 24px;
}
.nav__logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.0625rem; font-weight: 700; color: var(--text);
  flex-shrink: 0;
}
.nav__logo-icon { width: 32px; height: 32px; }
.nav__logo-img { height: 36px; width: auto; object-fit: contain; display: block; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__link {
  padding: 6px 12px; border-radius: var(--radius-xs);
  font-size: .9375rem; color: var(--text-2);
  transition: all var(--transition);
}
.nav__link:hover { background: var(--bg-muted); color: var(--text); }
.nav__search { flex: 1; max-width: 400px; }
.nav__search-form {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-muted); border: 1.5px solid transparent;
  border-radius: var(--radius-full); padding: 8px 14px;
  transition: all var(--transition);
}
.nav__search-form:focus-within {
  background: var(--bg-alt); border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.nav__search-icon { width: 16px; height: 16px; color: var(--text-4); flex-shrink: 0; }
.nav__search-input {
  border: none; background: transparent; outline: none;
  font-size: .875rem; color: var(--text); width: 100%;
}
.nav__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav__theme-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); transition: all var(--transition);
}
.nav__theme-btn:hover { background: var(--bg-muted); color: var(--text); }
.nav__theme-btn svg { width: 18px; height: 18px; }

/* Language switcher */
.lang-switch { position: relative; }
.lang-switch__btn {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--text-3); transition: all var(--transition);
  font-size: .8125rem; font-weight: 600;
}
.lang-switch__btn:hover { background: var(--bg-muted); color: var(--text); }
.lang-switch__btn svg { width: 17px; height: 17px; }
.lang-switch__menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 168px; background: var(--bg-alt);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; transform: translateY(-8px) scale(.97);
  pointer-events: none; transition: all var(--transition); z-index: 210;
}
.lang-switch.open .lang-switch__menu {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: all;
}
.lang-switch__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-xs);
  font-size: .875rem; color: var(--text-2); transition: all var(--transition);
}
.lang-switch__item:hover { background: var(--bg-muted); color: var(--text); }
.lang-switch__item.active { color: var(--text); font-weight: 600; }
.lang-switch__code {
  font-size: .7rem; font-weight: 700; color: var(--text-3);
  background: var(--bg-muted); border-radius: var(--radius-xs);
  padding: 2px 6px; min-width: 28px; text-align: center;
}
.lang-switch__item.active .lang-switch__code { background: var(--accent-light); color: var(--accent); }

/* Mobile search toggle button (hidden on desktop) */
.nav__search-btn {
  display: none;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  color: var(--text-3); transition: all var(--transition);
}
.nav__search-btn:hover { background: var(--bg-muted); color: var(--text); }
.nav__search-btn svg { width: 18px; height: 18px; }
/* Account icon (guests) — desktop hidden, shown on mobile instead of the text buttons */
.nav__account-btn {
  display: none;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  color: var(--text-3); transition: all var(--transition);
}
.nav__account-btn:hover { background: var(--bg-muted); color: var(--text); }
.nav__account-btn svg { width: 19px; height: 19px; }
/* Mobile-only search bar shown below the header (homepage) — hidden on desktop */
.nav__mobilesearch { display: none; }
.icon--moon { display: none; }
[data-theme="dark"] .icon--sun  { display: none; }
[data-theme="dark"] .icon--moon { display: block; }

/* Notifications */
.nav__notif { position: relative; }
.nav__notif-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); transition: all var(--transition); position: relative;
}
.nav__notif-btn:hover { background: var(--bg-muted); color: var(--text); }
.nav__notif-btn svg { width: 19px; height: 19px; }
.nav__notif-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  background: var(--error); color: #fff;
  border-radius: var(--radius-full); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.nav__notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 340px; background: var(--bg-alt);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-8px) scale(.97);
  pointer-events: none; transition: all var(--transition);
}
.nav__notif-panel.open {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: all;
}
/* Keep the panel inside the viewport on smaller screens */
@media (max-width: 480px) {
  .nav__notif-panel {
    position: fixed;
    top: calc(var(--nav-h) + 8px);
    left: 8px; right: 8px;
    width: auto;
  }
  .notif-list { max-height: 60vh; }
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.notif-header h4 { font-size: .9375rem; }
.notif-read-all { font-size: .8125rem; color: var(--accent); }
.notif-read-all:hover { text-decoration: underline; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-start;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-muted); }
.notif-item.unread { background: var(--accent-light); }
.notif-item__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-top: 6px; flex-shrink: 0;
}
.notif-item__title { font-size: .875rem; font-weight: 500; line-height: 1.35; }
.notif-item__body  { font-size: .8125rem; color: var(--text-2); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item__time  { font-size: .75rem; color: var(--text-3); margin-top: 3px; }
.notif-item__icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--bg-muted); color: var(--text-3);
}
.notif-item__icon svg { width: 17px; height: 17px; }
.notif-item__icon--course      { background: var(--accent-light); color: var(--accent); }
.notif-item__icon--certificate { background: #FEF3C7; color: #D97706; }
.notif-item__icon--reply       { background: #EDE9FE; color: #7C3AED; }
.notif-item__icon--reminder    { background: var(--accent-light); color: var(--accent); }
.notif-item__icon--system      { background: var(--success-bg); color: var(--success); }
a.notif-item { color: inherit; text-decoration: none; }
.notif-item__dot { align-self: center; }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--text-3); font-size: .875rem; }

/* User dropdown */
.nav__user { position: relative; }
.nav__avatar-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px; border-radius: var(--radius-full);
  transition: background var(--transition);
}
.nav__avatar-btn:hover { background: var(--bg-muted); }
.nav__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.nav__avatar--initials {
  background: var(--accent-light); color: var(--accent);
  font-size: .8125rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.nav__username { font-size: .875rem; font-weight: 500; color: var(--text); }
.nav__chevron { width: 14px; height: 14px; color: var(--text-3); transition: transform var(--transition); }
.nav__user.open .nav__chevron { transform: rotate(180deg); }
.nav__dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px; background: var(--bg-alt);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; transform: translateY(-8px) scale(.97);
  pointer-events: none; transition: all var(--transition);
}
.nav__user.open .nav__dropdown {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: all;
}
.dropdown__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-xs);
  font-size: .875rem; color: var(--text-2);
  transition: all var(--transition);
}
.dropdown__item:hover { background: var(--bg-muted); color: var(--text); }
.dropdown__item svg { width: 16px; height: 16px; flex-shrink: 0; }
.dropdown__item--danger { color: var(--error); }
.dropdown__item--danger:hover { background: var(--error-bg); }
.dropdown__item--admin { color: var(--accent); }
.dropdown__divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Hamburger */
.nav__hamburger {
  display: none; flex-direction: column; gap: 5px;
  width: 36px; height: 36px; padding: 8px;
  justify-content: center; border-radius: var(--radius-sm);
}
.nav__hamburger span {
  display: block; height: 2px; background: var(--text);
  border-radius: 2px; transition: all var(--transition);
}
.nav__mobile {
  display: none; flex-direction: column;
  padding: 8px 16px 16px; border-top: 1px solid var(--border);
  /* Paler shade so the menu stands out from the white page behind it */
  background: var(--bg-muted);
  box-shadow: inset 0 1px 0 var(--bg-alt), 0 12px 20px -8px rgba(0,0,0,.12);
}
.nav__mobile.open { display: flex; }
.nav__mobile-link {
  padding: 12px 8px; font-size: .9375rem; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.nav__mobile-link:last-child { border-bottom: none; }
.nav__mobile-lang {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 14px 8px 4px;
}
.nav__mobile-lang-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8125rem; font-weight: 600; color: var(--text-3);
}
.nav__mobile-lang-label svg { width: 16px; height: 16px; }
.nav__mobile-lang-options { display: flex; gap: 6px; flex-wrap: wrap; }
.nav__mobile-lang-item {
  min-width: 38px; text-align: center;
  padding: 6px 10px; border-radius: var(--radius-full);
  font-size: .75rem; font-weight: 700; letter-spacing: .03em;
  color: var(--text-2); background: var(--bg-alt);
  border: 1.5px solid var(--border); transition: all var(--transition);
}
.nav__mobile-lang-item:hover { border-color: var(--border-2); color: var(--text); }
.nav__mobile-lang-item.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Flash messages */
.flash {
  position: fixed; top: calc(var(--nav-h) + 12px); left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 500;
  animation: slideDown .3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
.flash--success { background: var(--success); color: #fff; }
.flash--error   { background: var(--error); color: #fff; }
.flash__close { color: inherit; opacity: .8; padding: 2px; }
.flash__close:hover { opacity: 1; }
.flash__close svg { width: 16px; height: 16px; }

/* ============================================ Cards */
.card {
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-2); }

.course-card { display: flex; flex-direction: column; }
.course-card__thumb {
  aspect-ratio: 16/9; overflow: hidden; position: relative; background: var(--bg-muted);
}
.course-card__thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.course-card:hover .course-card__thumb img { transform: scale(1.04); }
.course-card__badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--text); color: var(--bg);
  font-size: .75rem; font-weight: 600; padding: 3px 8px;
  border-radius: var(--radius-xs);
}
.course-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.course-card__cat {
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); margin-bottom: 6px;
}
.course-card__title {
  font-size: .9375rem; font-weight: 600; color: var(--text);
  line-height: 1.4; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-card__instructor { font-size: .8125rem; color: var(--text-3); margin-bottom: 10px; }
.course-card__meta {
  display: flex; align-items: center; gap: 10px;
  font-size: .8125rem; color: var(--text-3); margin-top: auto;
  flex-wrap: wrap;
}
.course-card__meta svg { width: 13px; height: 13px; }
.course-card__rating {
  display: flex; align-items: center; gap: 3px;
  font-weight: 600; color: var(--warning);
}
.course-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border);
  font-weight: 700; font-size: .9375rem;
}
.course-card__price-free { color: var(--success); }

/* ============================================ Stars */
.stars { display: flex; align-items: center; gap: 2px; }
.star { width: 14px; height: 14px; }
.star--full  { color: #F59E0B; }
.star--half  { color: #F59E0B; }
.star--empty { color: var(--border-2); }

/* ============================================ Progress */
.progress-bar-wrap { display: flex; align-items: center; gap: 10px; }
.progress-bar-track {
  flex: 1; height: 5px; background: var(--bg-muted);
  border-radius: var(--radius-full); overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--accent);
  border-radius: var(--radius-full);
  transition: width .6s ease;
}
.progress-bar-label { font-size: .75rem; font-weight: 600; color: var(--text-3); min-width: 30px; text-align: right; }

/* ============================================ Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius-full);
  font-size: .75rem; font-weight: 600;
}
.badge--blue    { background: var(--accent-light); color: var(--accent-text); }
.badge--green   { background: var(--success-bg); color: var(--success); }
.badge--red     { background: var(--error-bg); color: var(--error); }
.badge--muted   { background: var(--bg-muted); color: var(--text-3); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }

/* ============================================ Hero */
.hero {
  padding: 40px 0 48px;
  position: relative; overflow: hidden;
  /* Provided abstract pastel background image — shows entirely, no crop/distortion */
  background: var(--bg) url("../logo/herobackground.png") center center / contain no-repeat;
}
/* Tighten the gap between the hero and the first section that follows it */
.hero + .section { padding-top: 44px; }
/* (generated mesh / glass-shape layers removed — the background image is used instead) */
.hero__inner { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* 3D glass blocks floating behind the hero content */
.hero-deco { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; perspective: 1200px; }
.glass-card {
  position: absolute; border-radius: 30px;
  border: 1px solid rgba(255,255,255,.6);
  box-shadow:
    0 40px 70px -24px rgba(253,160,108,.40),
    0 10px 24px -12px rgba(253,160,108,.30),
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -18px 40px -20px rgba(255,255,255,.35);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  transform-style: preserve-3d;
}
/* subtle top-light streak for the glassy sheen */
.glass-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 42%);
  pointer-events: none;
}
.glass-card--1 {
  width: 320px; height: 320px; right: 6%; top: 10%;
  background: linear-gradient(135deg, rgba(253,160,108,.34), rgba(255,255,255,.16));
  transform: rotateX(18deg) rotateY(-24deg) rotateZ(8deg);
  box-shadow:
    0 40px 70px -24px rgba(253,160,108,.42),
    0 10px 24px -12px rgba(253,160,108,.30),
    inset 0 1px 0 rgba(255,255,255,.7),
    inset 0 -18px 40px -20px rgba(255,255,255,.30);
}
@media (max-width: 900px) {
  .glass-card--1 { width: 220px; height: 220px; right: 2%; top: 6%; }
}
@media (max-width: 600px) {
  /* Adapt the glass effect to mobile (keep it, just scale it down) */
  .glass-card--1 { width: 120px; height: 120px; right: 3%; top: 4%; border-radius: 20px; }
  .glass-orb { width: 46%; left: -10%; top: 82%; }
  .glass-orb__num   { font-size: clamp(.95rem, 5vw, 1.3rem); }
  .glass-orb__stars { font-size: clamp(.5rem, 2.4vw, .7rem); letter-spacing: 1px; }
}
@media (max-width: 400px) {
  .glass-card--1 { width: 90px; height: 90px; border-radius: 16px; }
}

/* Glass orb sitting ON the left side of the hero image (3D + glassmorphism) */
.hero__img-wrap { position: relative; display: inline-block; line-height: 0; }
.hero__img-wrap .hero__img { display: block; }
.glass-orb {
  position: absolute; left: -8%; top: 80%; z-index: 3; pointer-events: none;
  width: 38%; aspect-ratio: 1 / 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  /* perfect circle (no 3D rotation = no deformation); sphere look via radial highlight */
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.60), rgba(255,255,255,0) 44%),
    linear-gradient(135deg, rgba(253,160,108,.50), rgba(253,160,108,.30));
  border: 1px solid rgba(255,255,255,.65);
  box-shadow:
    0 24px 50px -16px rgba(253,160,108,.50),
    0 8px 18px -10px rgba(253,160,108,.35),
    inset 0 2px 0 rgba(255,255,255,.85),
    inset 0 -16px 36px -18px rgba(255,255,255,.40);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.glass-orb__num {
  font-size: clamp(1.3rem, 4.6vw, 1.95rem); font-weight: 800; color: #fff; line-height: 1;
  text-shadow: 0 1px 4px rgba(253,160,108,.55);
}
.glass-orb__stars {
  font-size: clamp(.6rem, 2.1vw, .85rem); letter-spacing: 1.5px; color: #fde047;
  text-shadow: 0 1px 2px rgba(253,160,108,.4);
}
/* Hero: text left, transparent PNG right (keeps the original hero background) */
/* Row: text left / image right — kept on mobile too (never column) */
.hero__inner--split {
  display: grid; grid-template-columns: 1.05fr .95fr;
  align-items: center; gap: 48px;
}
.hero__text { min-width: 0; }
.hero__media {
  min-width: 0;
  display: flex; justify-content: center; position: relative;
  animation: heroFadeIn .9s cubic-bezier(.2,.8,.2,1) both;
}
/* Soft glow behind the image */
.hero__media::before {
  content: ''; position: absolute; inset: 8% 8% 8% 8%;
  background: radial-gradient(circle at 50% 45%, var(--accent-light) 0%, transparent 65%);
  filter: blur(24px); z-index: -1; opacity: .9;
  animation: heroGlow 6s ease-in-out infinite;
}
.hero__img {
  width: 100%; max-width: 400px; height: auto; object-fit: contain;
  animation: heroFloat 5.5s ease-in-out infinite;
  will-change: transform;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
@keyframes heroGlow {
  0%, 100% { opacity: .65; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.06); }
}
@media (max-width: 900px) {
  /* Keep the desktop disposition on mobile: text left, image right */
  .hero__inner--split { gap: 18px; }
  .hero__img { max-width: 100%; }
}
@media (max-width: 560px) {
  .hero__inner--split { gap: 12px; }
  .hero h1 { font-size: 1.3rem; margin-bottom: 10px; }
  .hero__subtitle { font-size: .82rem; margin-bottom: 16px; }
  .hero__actions { gap: 8px; margin-bottom: 0; }
  .hero__actions .btn { padding: 9px 13px; font-size: .8rem; }
  .hero__actions .btn svg { width: 14px; height: 14px; }
}

/* ===== Premium MOBILE hero — "overlay" design (image bleeds right, text on top-left) ===== */
@media (max-width: 640px) {
  .hero { padding: 20px 0 6px; background-position: center top; }
  .hero + .section, .evt-ribbon + .section { padding-top: 14px; }
  /* The girl image is IN FLOW → it sets the hero height; the zone ends at her feet (no empty band) */
  .hero__inner--split { display: block; position: relative; min-height: 0; }

  .hero-deco, .glass-orb { display: none; }

  /* Girl image in flow, right-aligned, bleeding slightly off the right edge */
  .hero__media {
    position: relative; right: auto; top: auto; bottom: auto; left: auto;
    width: 62%; margin: 0 -8% 0 auto; z-index: 0; animation: heroFadeIn .9s both;
    -webkit-mask-image: linear-gradient(to left, #000 80%, transparent 100%);
            mask-image: linear-gradient(to left, #000 80%, transparent 100%);
  }
  .hero__media::before { display: none; }
  .hero__img-wrap { width: 100%; }
  .hero__img { width: 100%; max-width: 100%; display: block; animation: none; }

  /* Text overlays the image, on the left (with a left gap so it isn't glued to the edge) */
  .hero__text { position: absolute; top: 2px; left: 20px; z-index: 2; max-width: 72%; padding: 0; }
  .hero__text::before {
    content: ''; position: absolute; z-index: -1; inset: -14px -52px -14px -22px;
    background: radial-gradient(135% 120% at 0% 42%, var(--bg) 42%, rgba(255,255,255,0) 82%);
  }
  .hero h1 { font-size: 1.4rem; line-height: 1.18; margin-bottom: 10px; max-width: 100%; }
  /* Clamp to a constant height across languages so the buttons always fit (no clipping) */
  .hero__subtitle {
    font-size: .86rem; line-height: 1.45; max-width: 100%; margin-bottom: 14px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  /* Two buttons FIXED side by side on one line (close together) — language-proof */
  .hero__actions {
    width: auto; flex-direction: row; flex-wrap: nowrap; align-items: center;
    justify-content: flex-start; gap: 8px; margin-top: 14px; margin-bottom: 0;
  }
  .hero__actions .btn { flex-shrink: 0; padding: 9px 12px; font-size: .72rem; white-space: nowrap; }
  .hero__actions .btn svg { width: 13px; height: 13px; }
}
/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero__img, .hero__media, .hero__media::before, .hero::after { animation: none; }
}
.hero__label {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-muted); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: .8125rem; font-weight: 500; color: var(--text-2);
  margin-bottom: 24px;
}
.hero__label svg { width: 14px; height: 14px; color: var(--accent); }
.hero h1 { max-width: 680px; margin-bottom: 20px; overflow-wrap: anywhere; }
.hero__subtitle { font-size: 1.125rem; color: var(--text-2); max-width: 560px; margin-bottom: 36px; }
.hero__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 56px; }
.hero__stats {
  display: flex; gap: 40px; flex-wrap: wrap;
}
.hero__stat-num { font-size: 1.625rem; font-weight: 700; }
.hero__stat-lbl { font-size: .8125rem; color: var(--text-3); }

/* ============================================ Section */
.section { padding: 72px 0; }
.section--alt { background: var(--bg-muted); }
.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 40px; gap: 16px; flex-wrap: wrap;
}
.section__title { margin-bottom: 8px; }
.section__sub { color: var(--text-2); font-size: 1.0625rem; }

/* ============================================ Grid */
.grid { display: grid; gap: 24px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ============================================ Category Pills */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.cat-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 28px 16px;
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); text-align: center;
  transition: all var(--transition);
}
.cat-card:hover {
  border-color: var(--accent); background: var(--accent-light);
  transform: translateY(-2px);
}
.cat-card__icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--bg-muted); display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.cat-card__icon svg { width: 22px; height: 22px; }
.cat-card__name { font-size: .9rem; font-weight: 600; color: var(--text); }
.cat-card__count { font-size: .775rem; color: var(--text-3); }

/* ============================================ Auth Pages */
.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  box-shadow: var(--shadow-md);
}
.auth-card__head { margin-bottom: 28px; }
.auth-card__head h1 { font-size: 1.625rem; margin-bottom: 6px; }
.auth-card__head p  { color: var(--text-3); font-size: .9375rem; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-4); font-size: .8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-footer { margin-top: 20px; text-align: center; font-size: .875rem; color: var(--text-3); }
.auth-footer a { color: var(--accent); font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* ============================================ Dashboard */
.dashboard {
  display: grid; grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--nav-h));
}
.sidebar {
  background: var(--bg-alt); border-right: 1.5px solid var(--border);
  padding: 32px 16px; position: sticky;
  top: var(--nav-h); height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.sidebar__user {
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px 24px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.sidebar__avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
}
.sidebar__avatar--init {
  background: var(--accent-light); color: var(--accent);
  font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sidebar__name { font-size: .9375rem; font-weight: 600; }
.sidebar__role { font-size: .75rem; color: var(--text-3); }
.sidebar__nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--text-2);
  transition: all var(--transition); margin-bottom: 2px;
}
.sidebar__nav a:hover, .sidebar__nav a.active {
  background: var(--bg-muted); color: var(--text);
}
.sidebar__nav a.active { font-weight: 500; }
.sidebar__nav svg { width: 18px; height: 18px; flex-shrink: 0; }

.dash-main { padding: 36px 40px; overflow: hidden; }
.dash-main > h2 { margin-bottom: 4px; }
.dash-main > .dash-subtitle { color: var(--text-3); margin-bottom: 32px; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.stat-card--link { cursor: pointer; transition: transform .12s, box-shadow .15s; text-decoration: none; color: inherit; }
.stat-card--link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.stat-card__more { opacity: .55; font-weight: 800; }
.stat-card {
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 22px;
  display: flex; align-items: flex-start; gap: 14px;
}
.stat-card__icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-card__icon svg { width: 22px; height: 22px; }
.stat-card__num { font-size: 1.75rem; font-weight: 700; line-height: 1; margin-bottom: 2px; }
.stat-card__lbl { font-size: .8125rem; color: var(--text-3); }
.stat-card--blue   .stat-card__icon { background: var(--accent-light); color: var(--accent); }
.stat-card--green  .stat-card__icon { background: var(--success-bg); color: var(--success); }
.stat-card--orange .stat-card__icon { background: var(--warning-bg); color: var(--warning); }
.stat-card--purple .stat-card__icon { background: #EDE9FE; color: #7C3AED; }

/* ============================================ Course Player */
.player-layout {
  display: grid; grid-template-columns: 1fr 360px;
  min-height: calc(100vh - var(--nav-h));
}
.player-main { display: flex; flex-direction: column; overflow: hidden; }
.player-video-wrap {
  position: relative; background: #000;
  aspect-ratio: 16/9;
}
.player-video-wrap video,
.player-video-wrap iframe {
  width: 100%; height: 100%;
}
.player-controls {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.player-title { font-size: 1.0625rem; font-weight: 600; flex: 1; }
.player-nav { display: flex; gap: 8px; margin-left: auto; }
.player-content-tabs {
  display: flex; border-bottom: 1.5px solid var(--border);
  background: var(--bg-alt); padding: 0 20px;
}
.player-tab {
  padding: 14px 16px; font-size: .875rem; font-weight: 500;
  color: var(--text-3); border-bottom: 2px solid transparent;
  margin-bottom: -1.5px; transition: all var(--transition);
}
.player-tab.active { color: var(--text); border-bottom-color: var(--text); }
.player-tab-panel { display: none; padding: 24px; }
.player-tab-panel.active { display: block; }

.player-sidebar {
  background: var(--bg-alt); border-left: 1.5px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h));
}
.player-sidebar__head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.player-sidebar__title { font-size: .9rem; font-weight: 600; }
.player-sidebar__progress { font-size: .8125rem; color: var(--text-3); }
.player-sidebar__body { flex: 1; overflow-y: auto; }
.player-module { border-bottom: 1px solid var(--border); }
.player-module__head {
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; transition: background var(--transition);
}
.player-module__head:hover { background: var(--bg-muted); }
.player-module__name { font-size: .875rem; font-weight: 600; }
.player-module__count { font-size: .75rem; color: var(--text-3); }
.player-module__chevron { width: 16px; height: 16px; color: var(--text-4); transition: transform var(--transition); }
.player-module.open .player-module__chevron { transform: rotate(180deg); }
.player-lessons { display: none; }
.player-module.open .player-lessons { display: block; }
.player-lesson {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px 10px 28px;
  font-size: .8375rem; color: var(--text-2);
  transition: background var(--transition); cursor: pointer;
}
.player-lesson:hover { background: var(--bg-muted); }
.player-lesson.active { background: var(--accent-light); color: var(--accent-text); font-weight: 500; }
.player-lesson.completed .lesson-check { opacity: 1; }
.lesson-check { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--border-2); display: flex; align-items: center; justify-content: center; opacity: .4; transition: all var(--transition); }
.lesson-check.done { background: var(--success); border-color: var(--success); opacity: 1; }
.lesson-check svg { width: 10px; height: 10px; color: #fff; }
.lesson-duration { margin-left: auto; font-size: .75rem; color: var(--text-4); }

/* Notes */
.note-item {
  background: var(--bg-muted); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 10px; position: relative;
}
.note-time { font-size: .75rem; font-weight: 600; color: var(--accent); margin-bottom: 4px; cursor: pointer; }
.note-time:hover { text-decoration: underline; }
.note-text { font-size: .875rem; color: var(--text-2); }

/* Comments */
.comment-item { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-avatar--init { background: var(--bg-muted); color: var(--text-3); font-size: .8125rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.comment-body {}
.comment-name { font-size: .875rem; font-weight: 600; display: inline-block; margin-right: 6px; }
.comment-date { font-size: .75rem; color: var(--text-4); }
.comment-text { font-size: .875rem; color: var(--text-2); margin-top: 4px; }

/* ============================================ Course Detail */
.course-hero {
  /* Fixed dark background so the light hero text stays readable in BOTH light & dark modes */
  background: #17171a; color: #F8F8F5; padding: 48px 0;
}
.course-hero__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start;
}
/* Main body layout (left content + right description) */
.course-body { display: grid; grid-template-columns: 1fr 380px; gap: 56px; align-items: start; }
.outcomes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* "About this course": sidebar on desktop, inline (after Requirements) on mobile */
.course-about--inline { display: none; }
.course-about--side   { display: block; }

/* Tab switch (Programme du cours / Ce que vous apprendrez) — applies on desktop & mobile */
.course-main { display: flex; flex-direction: column; }
.course-main > * { order: 5; }                 /* keep DOM order for the rest */
.course-tabs { order: 0; }
.panel-curriculum, .panel-outcomes { order: 1; }
.course-tabs {
  display: flex; gap: 4px; margin-bottom: 22px;
  border-bottom: 1.5px solid var(--border);
}
.course-tab {
  padding: 12px 22px; border: none; background: transparent; cursor: pointer;
  font-size: .95rem; font-weight: 700; color: var(--text-3);
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
  transition: color var(--transition), border-color var(--transition);
}
.course-tab:hover { color: var(--text); }
/* Active tab: just an underline bar, no background */
.course-main.tab-curriculum .ctab-curriculum,
.course-main.tab-outcomes   .ctab-outcomes {
  color: var(--accent); border-bottom-color: var(--accent);
}
/* Show only the selected panel */
.course-main.tab-curriculum .panel-outcomes   { display: none; }
.course-main.tab-outcomes   .panel-curriculum { display: none; }
.course-hero__cat {
  font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: #90AAFF; margin-bottom: 12px;
}
.course-hero h1 { color: #F8F8F5; margin-bottom: 14px; }
.course-hero__sub { color: #C8C8C4; font-size: 1.0625rem; margin-bottom: 20px; }
.course-hero__meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .875rem; color: #A8A8A4; }
.course-hero__meta .stars .star--empty { color: #5A5A56; }
.course-card-sticky {
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; color: var(--text);
  box-shadow: var(--shadow-lg); position: sticky; top: calc(var(--nav-h) + 16px);
}
.course-card-sticky__thumb { aspect-ratio: 16/9; overflow: hidden; }
.course-card-sticky__thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card-sticky__body { padding: 20px; }
.course-card-sticky__price { font-size: 1.75rem; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.course-card-sticky__price .original { font-size: 1rem; font-weight: 400; color: var(--text-4); text-decoration: line-through; margin-left: 6px; }

/* Curriculum accordion */
.curriculum { margin-top: 40px; }
.curriculum__module {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; overflow: hidden;
}
.curriculum__module-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer; background: var(--bg-muted);
  transition: background var(--transition); user-select: none;
}
.curriculum__module-head:hover { background: var(--bg-alt); }
.curriculum__module-title { font-size: .9375rem; font-weight: 600; }
.curriculum__module-meta { font-size: .8125rem; color: var(--text-3); }
.curriculum__lessons { display: none; }
.curriculum__module.open .curriculum__lessons { display: block; }
.curriculum__lesson {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--border);
  font-size: .875rem; color: var(--text-2);
  transition: background var(--transition);
}
.curriculum__lesson:hover { background: var(--bg-muted); }
.curriculum__lesson-icon { width: 18px; height: 18px; color: var(--text-4); flex-shrink: 0; }
.curriculum__lesson-duration { margin-left: auto; font-size: .75rem; color: var(--text-3); }
.curriculum__lesson-preview {
  margin-left: 6px; font-size: .75rem; color: var(--accent); font-weight: 500;
}

/* Reviews */
.reviews-summary {
  display: flex; align-items: center; gap: 40px;
  padding: 28px; background: var(--bg-muted);
  border-radius: var(--radius-md); margin-bottom: 32px;
}
.reviews-big-rating { text-align: center; }
.reviews-big-num { font-size: 3rem; font-weight: 700; line-height: 1; }
.reviews-dist { flex: 1; }
.reviews-dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.reviews-dist-row .progress-bar-track { height: 6px; }
.reviews-dist-lbl { font-size: .8125rem; color: var(--text-3); min-width: 30px; text-align: right; }

/* ============================================ Admin */
.admin-layout {
  display: grid; grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--nav-h));
}
/* Admin sidebar keeps a fixed dark palette in both light & dark themes */
.admin-sidebar {
  background: #1A1A1A; color: #F8F8F5;
  padding: 32px 12px; position: sticky;
  top: var(--nav-h); height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.admin-sidebar__logo {
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 24px; margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: .9rem; font-weight: 700; color: #F8F8F5;
}
.admin-sidebar__logo svg { width: 18px; height: 18px; }
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .875rem; color: rgba(248,248,245,.65);
  transition: all var(--transition); margin-bottom: 2px;
}
.admin-sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-sidebar a.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 500; }
/* Night mode: full black sidebar */
[data-theme="dark"] .admin-sidebar { background: #000; }
.admin-sidebar svg { width: 17px; height: 17px; flex-shrink: 0; }
.admin-sidebar__section {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: rgba(255,255,255,.3); padding: 16px 12px 6px; margin-top: 8px;
}

.admin-main { padding: 36px 40px; background: var(--bg); }
.admin-page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-page-head h2 { margin: 0; }

/* Data table */
.data-table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1.5px solid var(--border); }
.data-table {
  width: 100%; border-collapse: collapse; background: var(--bg-alt);
}
.data-table th {
  padding: 12px 16px; text-align: left; font-size: .75rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); background: var(--bg-muted);
  border-bottom: 1.5px solid var(--border);
}
.data-table td {
  padding: 14px 16px; font-size: .875rem; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-muted); }

/* ============================================ Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 40px; flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  font-size: .875rem; border: 1.5px solid var(--border);
  color: var(--text-2); transition: all var(--transition);
}
.pagination a:hover { background: var(--bg-muted); border-color: var(--border-2); }
.pagination .active { background: var(--text); color: var(--bg); border-color: var(--text); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ============================================ Tabs */
.tabs { display: flex; border-bottom: 1.5px solid var(--border); margin-bottom: 28px; }
.tab-btn {
  padding: 12px 18px; font-size: .9rem; font-weight: 500; color: var(--text-3);
  border-bottom: 2px solid transparent; margin-bottom: -1.5px;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--text); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================ Empty States */
.empty-state {
  text-align: center; padding: 64px 24px;
  color: var(--text-3);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .4; }
.empty-state h3 { color: var(--text-2); margin-bottom: 6px; }

/* ============================================ Profile */
.profile-layout { display: grid; grid-template-columns: 300px 1fr; gap: 32px; padding: 40px 0; max-width: 1100px; margin: 0 auto; }
.profile-card {
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 28px; text-align: center;
  position: sticky; top: calc(var(--nav-h) + 20px);
}
.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 16px; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border);
}
.profile-avatar-edit {
  position: absolute; bottom: 2px; right: 2px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform var(--transition);
}
.profile-avatar-edit:hover { transform: scale(1.1); }
.profile-avatar-edit svg { width: 13px; height: 13px; }
.profile-name { font-size: 1.125rem; font-weight: 700; margin-bottom: 4px; }
.profile-bio  { font-size: .875rem; color: var(--text-3); margin-bottom: 16px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; margin-top: 20px; }
.profile-stat { padding: 12px; background: var(--bg-muted); border-radius: var(--radius-sm); }
.profile-stat__num { font-size: 1.25rem; font-weight: 700; }
.profile-stat__lbl { font-size: .75rem; color: var(--text-3); }

/* ============================================ Certificate */
.cert-card {
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 24px;
  display: flex; align-items: center; gap: 20px;
  transition: all var(--transition);
}
.cert-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.cert-icon { width: 52px; height: 52px; border-radius: var(--radius-sm); background: #FEF3C7; color: #D97706; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cert-icon svg { width: 28px; height: 28px; }
.cert-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.cert-meta  { font-size: .8125rem; color: var(--text-3); }
.cert-actions { margin-left: auto; display: flex; gap: 8px; }

/* ============================================ Footer */
.footer {
  background: var(--bg-alt); border-top: 1.5px solid var(--border);
  margin-top: auto;
}
.footer__inner {
  max-width: 1240px; margin: 0 auto; padding: 56px 24px 40px;
  display: grid; grid-template-columns: 1fr 2fr; gap: 64px;
}
.footer__tagline { font-size: .9rem; color: var(--text-3); margin-top: 12px; }
.footer__links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer__col h5 { margin-bottom: 14px; }
.footer__col a { display: block; font-size: .875rem; color: var(--text-3); margin-bottom: 8px; transition: color var(--transition); }
.footer__col a:hover { color: var(--text); }
.footer__bottom {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  max-width: 1240px; margin: 0 auto;
  display: flex; justify-content: space-between;
  font-size: .8125rem; color: var(--text-4);
  flex-wrap: wrap; gap: 8px;
}

/* ============================================ Error Page */
.error-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--nav-h)); text-align: center;
}
.error-page__code { font-size: 7rem; font-weight: 800; color: var(--bg-muted); line-height: 1; margin-bottom: 16px; }
.error-page__actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

/* ============================================ Utilities */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================ Skeleton Loader */
.skeleton { background: linear-gradient(90deg, var(--bg-muted) 25%, var(--border) 50%, var(--bg-muted) 75%); background-size: 200% 100%; animation: skeleton-shine 1.5s infinite; border-radius: var(--radius-xs); }
@keyframes skeleton-shine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================ Responsive */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .course-hero__inner { grid-template-columns: 1fr; }
  .course-body { grid-template-columns: 1fr; gap: 36px; }
  .course-card-sticky { position: static; }
  /* Swap the About block into the main flow (after Requirements) */
  .course-about--inline { display: block; }
  .course-about--side   { display: none; }

  /* On mobile the two tabs share the full width */
  .course-tab { flex: 1; padding: 12px 12px; font-size: .9rem; text-align: center; }
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .player-layout { grid-template-columns: 1fr; }
  .player-sidebar { position: static; height: auto; }
}
@media (max-width: 768px) {
  .nav__links, .nav__search { display: none; }
  .nav__hamburger { display: flex; }
  .nav__username { display: none; }
  /* Course detail: stack the titled sections one under another, full width */
  .outcomes-grid { grid-template-columns: 1fr; }
  .course-hero { padding: 32px 0; }
  .course-hero__inner { padding: 0 20px; gap: 24px; }
  .course-body { gap: 28px; }
  /* Hide manual theme toggle on mobile (follows system preference) */
  .nav__theme-btn { display: none; }
  /* Language switcher moves into the hamburger menu to save header space */
  .lang-switch { display: none; }
  /* Replace the text Sign in / Sign up buttons with a compact Account icon */
  .nav__actions > .btn { display: none; }
  .nav__account-btn { display: flex; }
  /* Keep the header from overflowing on small screens */
  .nav__inner { gap: 12px; padding: 0 16px; }
  .nav__actions { gap: 4px; }
  /* Prevent iOS Safari auto-zoom on focus: inputs must be >= 16px */
  .nav__search-input, .form-input, .form-select, .form-textarea,
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="url"], input[type="number"], textarea, select { font-size: 16px; }
  /* More breathing room for the hamburger menu items */
  .nav__mobile { padding: 10px 20px 18px; }
  .nav__mobile-link { padding: 13px 6px; }
  /* Some pages set an inline "padding: N 0 M" on .container which zeroes the
     horizontal padding — force it back on mobile so content isn't flush to the edge. */
  .container, .container--narrow, .container--wide {
    padding-left: 20px !important; padding-right: 20px !important;
  }
  /* Show mobile search button */
  .nav__search-btn { display: flex; }
  /* Reveal search bar as a dropdown when toggled */
  .nav__search.mobile-active {
    display: block; position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    max-width: none; padding: 12px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md); z-index: 150;
  }
  .nav__search.mobile-active .nav__search-form { background: var(--bg-muted); }
  /* Homepage: full-width search bar shown BELOW the header on mobile */
  .nav__mobilesearch {
    display: block; padding: 12px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    position: sticky; top: var(--nav-h); z-index: 190;
  }
  .nav__mobilesearch .nav__search-form { width: 100%; }
  .nav__mobilesearch .nav__search-input { font-size: 16px; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--2 { grid-template-columns: 1fr; }
  .hero { padding: 24px 0 32px; }
  .hero + .section { padding-top: 28px; }
  .section { padding: 40px 0; }
  .footer__inner { grid-template-columns: 1fr; gap: 32px; }
  .footer__links { grid-template-columns: repeat(2, 1fr); }
  .dash-main { padding: 20px 16px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 270px; max-width: 84vw;
    z-index: 1200; transform: translateX(-100%); transition: transform .25s ease;
    padding-top: 18px; overflow-y: auto;
  }
  .admin-sidebar.open { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,.45); }
  .admin-mtop { display: flex !important; }
  .admin-main { padding: 16px; }
  .admin-page-head { flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
  .profile-layout { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .container, .container--narrow, .container--wide { padding-left: 18px !important; padding-right: 18px !important; }
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cards { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .hero__stats { gap: 24px; }
}
