/* =====================================================================
   EduNest LMS — minimal design layer on top of Bootstrap 5.3
   Flat surfaces, hairline borders, one accent. Themes via [data-bs-theme].
   ===================================================================== */

/* --------------------------------------------------------------- Font */
@font-face {
  font-family: 'InterVariable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../vendor/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
                 U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------- Tokens */
:root,
[data-bs-theme="light"] {
  --lms-primary: #111827;          /* ink — buttons and emphasis */
  --lms-primary-rgb: 17, 24, 39;
  --lms-primary-hover: #000000;
  --lms-accent: #4f46e5;           /* used sparingly: links, active states */
  --lms-accent-rgb: 79, 70, 229;
  --lms-accent-soft: rgba(79, 70, 229, .08);

  --lms-surface: #ffffff;
  --lms-surface-2: #fafafa;
  --lms-border: #e7e7e9;
  --lms-border-strong: #d4d4d8;
  --lms-text: #18181b;
  --lms-muted: #71717a;

  --lms-radius: .5rem;

  --bs-body-font-family: 'InterVariable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-bg: #ffffff;
  --bs-body-color: var(--lms-text);
  --bs-border-color: var(--lms-border);
  --bs-link-color: var(--lms-accent);
  --bs-link-hover-color: var(--lms-accent);
  --bs-primary: var(--lms-primary);
  --bs-primary-rgb: var(--lms-primary-rgb);
}

[data-bs-theme="dark"] {
  --lms-primary: #fafafa;
  --lms-primary-rgb: 250, 250, 250;
  --lms-primary-hover: #ffffff;
  --lms-accent: #a5b4fc;
  --lms-accent-rgb: 165, 180, 252;
  --lms-accent-soft: rgba(165, 180, 252, .12);

  --lms-surface: #111113;
  --lms-surface-2: #17171a;
  --lms-border: #26262a;
  --lms-border-strong: #34343a;
  --lms-text: #ededef;
  --lms-muted: #8f8f99;

  --bs-body-bg: #0b0b0d;
  --bs-body-color: var(--lms-text);
  --bs-secondary-color: var(--lms-muted);
  --bs-emphasis-color: #fff;
  --bs-tertiary-bg: var(--lms-surface-2);
}

/* --------------------------------------------------------------- Base */
body {
  font-family: var(--bs-body-font-family);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -.021em; font-weight: 600; }
.display-5 { letter-spacing: -.035em; font-weight: 600; }

.bg-body-tertiary { background-color: var(--lms-surface-2) !important; }
.bg-white { background-color: var(--lms-surface) !important; }
.text-secondary { color: var(--lms-muted) !important; }
.text-primary { color: var(--lms-text) !important; }
.link-primary, a { color: var(--lms-accent); }
a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--lms-accent); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--lms-accent-soft); }

/* Flat by default — the design carries structure with borders, not shadows. */
.shadow, .shadow-sm, .shadow-lg { box-shadow: none !important; }

/* ------------------------------------------------------------ Buttons */
.btn {
  --bs-btn-border-radius: .45rem;
  --bs-btn-font-weight: 500;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn-primary {
  --bs-btn-bg: var(--lms-primary);
  --bs-btn-border-color: var(--lms-primary);
  --bs-btn-hover-bg: var(--lms-primary-hover);
  --bs-btn-hover-border-color: var(--lms-primary-hover);
  --bs-btn-active-bg: var(--lms-primary-hover);
  --bs-btn-disabled-bg: var(--lms-primary);
  --bs-btn-disabled-border-color: var(--lms-primary);
  --bs-btn-color: var(--lms-surface);
  --bs-btn-hover-color: var(--lms-surface);
  --bs-btn-active-color: var(--lms-surface);
  --bs-btn-disabled-color: var(--lms-surface);
}
.btn-outline-primary,
.btn-outline-secondary {
  --bs-btn-color: var(--lms-text);
  --bs-btn-border-color: var(--lms-border-strong);
  --bs-btn-hover-bg: var(--lms-surface-2);
  --bs-btn-hover-border-color: var(--lms-border-strong);
  --bs-btn-hover-color: var(--lms-text);
  --bs-btn-active-bg: var(--lms-surface-2);
  --bs-btn-active-border-color: var(--lms-border-strong);
  --bs-btn-active-color: var(--lms-text);
}
.bg-primary { background-color: var(--lms-primary) !important; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--lms-border-strong); --bs-btn-color: #18181b; }

/* -------------------------------------------------------------- Cards */
.card {
  --bs-card-bg: var(--lms-surface);
  --bs-card-border-color: var(--lms-border);
  --bs-card-border-radius: var(--lms-radius);
  --bs-card-inner-border-radius: calc(var(--lms-radius) - 1px);
  border: 1px solid var(--lms-border);
}
.card.border-0 { border: 1px solid var(--lms-border) !important; }
.card-header { background: transparent; border-bottom-color: var(--lms-border); }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--lms-border); }
.list-group-item-action:hover { background: var(--lms-surface-2); }
.list-group-item.active {
  background: var(--lms-surface-2); border-color: var(--lms-border);
  color: var(--lms-text); font-weight: 500;
  box-shadow: inset 2px 0 0 var(--lms-text);
}

/* ------------------------------------------------------------ Navbars */
.navbar.bg-white {
  background: var(--lms-surface) !important;
  border-bottom: 1px solid var(--lms-border) !important;
}
.navbar .nav-link { font-weight: 450; color: var(--lms-muted); padding-inline: .7rem; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--lms-text); }
.navbar-brand { letter-spacing: -.03em; font-weight: 600; color: var(--lms-text) !important; }
.dropdown-menu { border-color: var(--lms-border); border-radius: var(--lms-radius); }

.theme-toggle {
  border: 1px solid var(--lms-border); background: transparent; color: inherit;
  width: 32px; height: 32px; border-radius: .45rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s ease;
}
.theme-toggle:hover { background: var(--lms-surface-2); }
html[data-bs-theme="light"] .theme-toggle .icon-dark,
html[data-bs-theme="dark"] .theme-toggle .icon-light { display: none; }

/* ------------------------------------------------------------ Avatars */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--lms-surface-2); border: 1px solid var(--lms-border);
  color: var(--lms-text); font-weight: 600; font-size: .8rem; flex: 0 0 auto;
}
.avatar-sm { width: 30px; height: 30px; font-size: .68rem; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.1rem; }
.avatar-xl { width: 88px; height: 88px; font-size: 1.6rem; }

/* ---------------------------------------------------- Hero / page head */
.hero {
  background: var(--lms-surface);
  border-bottom: 1px solid var(--lms-border);
  color: var(--lms-text);
}
.hero .text-secondary, .hero .lead { color: var(--lms-muted) !important; }
.hero .breadcrumb-item a, .hero .link-light { color: var(--lms-muted) !important; }
.hero .text-light { color: var(--lms-text) !important; }
.hero .stat-value { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.hero-badge {
  display: inline-block;
  border: 1px solid var(--lms-border); color: var(--lms-muted);
  border-radius: 999px; padding: .25rem .7rem; font-size: .78rem; font-weight: 450;
}
.hero .btn-light { --bs-btn-bg: var(--lms-primary); --bs-btn-color: var(--lms-surface); --bs-btn-border-color: var(--lms-primary); }
.hero .btn-outline-light {
  --bs-btn-color: var(--lms-text); --bs-btn-border-color: var(--lms-border-strong);
  --bs-btn-hover-bg: var(--lms-surface-2); --bs-btn-hover-color: var(--lms-text);
  --bs-btn-hover-border-color: var(--lms-border-strong);
}

.page-head { background: var(--lms-surface); border-bottom: 1px solid var(--lms-border); }

@media (max-width: 575.98px) {
  .hero .lead { font-size: 1rem; }
  .hero .display-5 { font-size: 1.9rem; }
  .hero .stat-value { font-size: 1.3rem; }
}

/* -------------------------------------------------------- Course cards */
.course-card { transition: border-color .15s ease; }
.course-card:hover { border-color: var(--lms-border-strong) !important; }
.course-thumb {
  position: relative;
  height: 116px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: var(--thumb-bg, var(--lms-surface-2));
  color: var(--thumb-fg, var(--lms-muted));
  border-bottom: 1px solid var(--lms-border);
}
.thumb-0 { --thumb-bg: #f4f4f5; --thumb-fg: #52525b; }
.thumb-1 { --thumb-bg: #f1f5f9; --thumb-fg: #475569; }
.thumb-2 { --thumb-bg: #faf5ff; --thumb-fg: #6b21a8; }
.thumb-3 { --thumb-bg: #f0fdf4; --thumb-fg: #15803d; }
.thumb-4 { --thumb-bg: #fff7ed; --thumb-fg: #9a3412; }
[data-bs-theme="dark"] .thumb-0 { --thumb-bg: #17171a; --thumb-fg: #a1a1aa; }
[data-bs-theme="dark"] .thumb-1 { --thumb-bg: #14181f; --thumb-fg: #94a3b8; }
[data-bs-theme="dark"] .thumb-2 { --thumb-bg: #1a1620; --thumb-fg: #c4b5fd; }
[data-bs-theme="dark"] .thumb-3 { --thumb-bg: #121a16; --thumb-fg: #86efac; }
[data-bs-theme="dark"] .thumb-4 { --thumb-bg: #1d1712; --thumb-fg: #fdba74; }
.bundle-thumb { height: 96px; }
.course-thumb.has-image { padding: 0; background: var(--lms-surface-2); }
.course-thumb.has-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.discount-note { font-size: .78rem; color: var(--lms-muted); }
.price-now { font-size: 1.05rem; font-weight: 600; letter-spacing: -.02em; }
.price-was { font-size: .82rem; }

/* ---------------------------------------------------------- Admin shell */
.admin-body { background: var(--bs-body-bg); }
.admin-topbar { background: var(--lms-surface); border-bottom: 1px solid var(--lms-border); }
.admin-topbar .navbar-brand,
.admin-topbar .dropdown-toggle { color: var(--lms-text) !important; }
.admin-topbar .text-white-50 { color: var(--lms-muted) !important; }
.admin-shell { display: flex; align-items: stretch; min-height: calc(100vh - 56px); }
.admin-sidebar {
  background: var(--lms-surface);
  border-right: 1px solid var(--lms-border);
  width: 232px; flex: 0 0 232px; color: var(--lms-text);
}
.admin-sidebar .offcanvas-body { display: flex; }
.admin-sidebar .nav-link {
  color: var(--lms-muted); border-radius: .4rem;
  padding: .48rem .7rem; margin-bottom: .05rem;
  display: flex; align-items: center; gap: .65rem; font-size: .9rem; font-weight: 450;
  transition: background .12s ease, color .12s ease;
}
.admin-sidebar .nav-link:hover { background: var(--lms-surface-2); color: var(--lms-text); }
.admin-sidebar .nav-link.active { background: var(--lms-surface-2); color: var(--lms-text); font-weight: 550; }
.admin-sidebar .nav-link i { width: 1.05rem; text-align: center; }
.admin-sidebar .nav-section {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--lms-muted); padding: .85rem .7rem .25rem; font-weight: 600;
}
.admin-content { flex: 1 1 auto; padding: 1.5rem; min-width: 0; }

@media (min-width: 992px) {
  .admin-sidebar.offcanvas-lg {
    position: sticky; top: 56px; height: calc(100vh - 56px);
    background: var(--lms-surface) !important;
  }
}
@media (max-width: 991.98px) {
  .admin-sidebar { width: 250px; }
  .admin-content { padding: 1rem; }
}

/* ------------------------------------------------------------ KPI cards */
.kpi-card {
  border: 1px solid var(--lms-border);
  border-radius: var(--lms-radius);
  background: var(--lms-surface);
}
.min-w-0 { min-width: 0; }
.kpi-card .kpi-icon {
  width: 34px; height: 34px; border-radius: .4rem;
  display: inline-flex; align-items: center; justify-content: center; font-size: .95rem;
  background: var(--lms-surface-2) !important;
  color: var(--lms-muted) !important;
  border: 1px solid var(--lms-border);
}
.kpi-value {
  font-size: 1.5rem; font-weight: 600;
  letter-spacing: -.035em; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  font-weight: 600; color: var(--lms-muted);
}
.trend-up { color: #15803d; font-weight: 500; }
.trend-down { color: #b91c1c; font-weight: 500; }
[data-bs-theme="dark"] .trend-up { color: #4ade80; }
[data-bs-theme="dark"] .trend-down { color: #f87171; }

@media (max-width: 575.98px) {
  .kpi-value { font-size: 1.05rem; white-space: nowrap; }
  .kpi-card .kpi-icon { width: 26px; height: 26px; font-size: .72rem; }
  .kpi-card .card-body { padding: .8rem; }
  .kpi-label { font-size: .66rem; }
}

.chart-box { position: relative; height: 300px; }
.chart-box-sm { position: relative; height: 220px; }

/* ------------------------------------------------------------- Tables */
.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--lms-border);
  --bs-table-hover-bg: var(--lms-surface-2);
}
.table > thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; color: var(--lms-muted);
  background: transparent;
  border-bottom: 1px solid var(--lms-border);
  white-space: nowrap;
}
.table-light, .table > tfoot.table-light { --bs-table-bg: var(--lms-surface-2); }
.table-sticky thead th { position: sticky; top: 0; z-index: 1; background: var(--lms-surface); }
.font-monospace { font-size: .85em; }

/* --------------------------------------------------------------- Forms */
.form-control, .form-select {
  border-radius: .45rem;
  border-color: var(--lms-border-strong);
  background-color: var(--lms-surface);
  color: var(--bs-body-color);
}
.form-control:focus, .form-select:focus {
  border-color: var(--lms-text);
  box-shadow: none;
}
.form-label { font-weight: 500; }
.input-group-text { background: var(--lms-surface-2); border-color: var(--lms-border-strong); color: var(--lms-muted); }
.form-check-input:checked { background-color: var(--lms-text); border-color: var(--lms-text); }
.form-check-input:focus { box-shadow: none; border-color: var(--lms-text); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--lms-primary); --bs-nav-pills-link-active-color: var(--lms-surface); }
.nav-pills .nav-link { color: var(--lms-muted); }

/* -------------------------------------------------------- Course learn */
.lesson-list .list-group-item { border-left: 0; border-right: 0; }
.lesson-list .list-group-item.active-lesson {
  background: var(--lms-surface-2);
  box-shadow: inset 2px 0 0 var(--lms-text);
  font-weight: 500;
}
.learn-sidebar { max-height: calc(100vh - 100px); overflow-y: auto; }
.learn-sidebar::-webkit-scrollbar { width: 6px; }
.learn-sidebar::-webkit-scrollbar-thumb { background: var(--lms-border-strong); border-radius: 6px; }
.video-frame {
  aspect-ratio: 16 / 9;
  background: var(--lms-surface-2);
  border-bottom: 1px solid var(--lms-border);
  color: var(--lms-muted);
}
.lesson-content { line-height: 1.75; }
.lesson-content ul { padding-left: 1.1rem; }

/* --------------------------------------------------------- Certificates */
.certificate {
  background: #fff;
  border: 1px solid #d4d4d8;
  padding: 4rem 3rem;
  position: relative;
  color: #18181b;
}
.certificate .cert-title {
  font-size: 1.5rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 500;
}
.certificate .cert-name {
  font-size: 2.5rem; font-weight: 600; letter-spacing: -.03em;
  display: inline-block; padding: .5rem 0;
}
.certificate .cert-course { font-size: 1.15rem; font-weight: 500; }
.certificate .cert-rule { width: 56px; height: 2px; background: #18181b; margin: 1.25rem auto; }
.certificate .cert-seal {
  width: 68px; height: 68px; border-radius: 50%;
  border: 1px solid #d4d4d8; color: #71717a;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 600; text-align: center; line-height: 1.2;
  letter-spacing: .06em;
}
.cert-sign-line { border-top: 1px solid #d4d4d8; padding-top: .4rem; min-width: 170px; display: inline-block; }

@media (max-width: 575.98px) {
  .certificate { padding: 2rem 1.25rem; }
  .certificate .cert-title { font-size: 1rem; letter-spacing: .16em; }
  .certificate .cert-name { font-size: 1.6rem; }
  .certificate .cert-course { font-size: 1rem; }
}

@media print {
  body * { visibility: hidden; }
  .certificate, .certificate * { visibility: visible; }
  .certificate { position: absolute; inset: 0; margin: 0; border: 1px solid #d4d4d8; }
  .invoice-sheet, .invoice-sheet * { visibility: visible; }
  .invoice-sheet { position: absolute; inset: 0; margin: 0; box-shadow: none !important; }
  .no-print { display: none !important; }
}

/* ------------------------------------------------- Reviews and WhatsApp */
.rating-input { display: flex; flex-wrap: wrap; gap: .4rem; }

.whatsapp-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 1030;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem .9rem; border-radius: 999px;
  background: #25d366; color: #fff; font-weight: 600; font-size: .875rem;
  text-decoration: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.whatsapp-fab:hover { color: #fff; filter: brightness(.95); }
.whatsapp-fab i { font-size: 1.15rem; }
/* Keep the floating button from sitting on top of the footer links. */
body:has(.whatsapp-fab) .site-footer { padding-bottom: 5.5rem !important; }

/* -------------------------------------------------------- Legal copy */
.legal-copy { line-height: 1.75; }
.legal-copy h2 {
  font-size: 1.05rem; font-weight: 600;
  margin: 2rem 0 .6rem; padding-top: 1.25rem;
  border-top: 1px solid var(--lms-border);
}
.legal-copy h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-copy h3 { font-size: .95rem; font-weight: 600; margin: 1.25rem 0 .4rem; }
.legal-copy p, .legal-copy li { color: var(--lms-muted); }
.legal-copy ul, .legal-copy ol { padding-left: 1.15rem; }
.legal-copy li { margin-bottom: .35rem; }
.legal-copy code {
  background: var(--lms-surface-2); border: 1px solid var(--lms-border);
  border-radius: .25rem; padding: .05rem .3rem; color: var(--lms-text);
}

/* ---------------------------------------------------------- Leaderboard */
.rank-badge {
  width: 34px; height: 34px; border-radius: .4rem; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 600; font-size: .85rem;
  background: var(--lms-surface-2); color: var(--lms-muted);
  border: 1px solid var(--lms-border);
  font-variant-numeric: tabular-nums;
}
.rank-1, .rank-2, .rank-3 { background: var(--lms-text); color: var(--lms-surface); border-color: var(--lms-text); }
.podium-card { border-radius: var(--lms-radius); }
.podium-card.podium-1 { border-color: var(--lms-text) !important; }
.leaderboard-me { background: var(--lms-surface-2) !important; }

/* ----------------------------------------------------------------- Misc */
.progress { background: var(--lms-surface-2); border-radius: 999px; }
.progress-thin { height: 4px; }
.progress-bar { background-color: var(--lms-text); border-radius: 999px; }
.badge { font-weight: 500; letter-spacing: .01em; border-radius: .35rem; }
.badge[class*="-subtle"] {
  background: var(--lms-surface-2) !important;
  color: var(--lms-muted) !important;
  border: 1px solid var(--lms-border);
}
.badge.bg-success-subtle { color: #15803d !important; }
.badge.bg-danger-subtle  { color: #b91c1c !important; }
.badge.bg-warning-subtle { color: #b45309 !important; }
[data-bs-theme="dark"] .badge.bg-success-subtle { color: #4ade80 !important; }
[data-bs-theme="dark"] .badge.bg-danger-subtle  { color: #f87171 !important; }
[data-bs-theme="dark"] .badge.bg-warning-subtle { color: #fbbf24 !important; }
.alert {
  border: 1px solid var(--lms-border);
  border-radius: var(--lms-radius);
  background: var(--lms-surface-2) !important;
  color: var(--bs-body-color) !important;
}
.alert-success { box-shadow: inset 2px 0 0 #15803d; }
.alert-danger  { box-shadow: inset 2px 0 0 #b91c1c; }
.alert-warning { box-shadow: inset 2px 0 0 #b45309; }
.alert-info    { box-shadow: inset 2px 0 0 var(--lms-accent); }
.stat-pill { font-size: .75rem; padding: .2rem .55rem; border-radius: 999px; }
.copy-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--lms-muted); }
.empty-state i { font-size: 2rem; opacity: .3; display: block; margin-bottom: .75rem; }
hr { border-color: var(--lms-border); opacity: 1; }
.accordion { --bs-accordion-border-color: var(--lms-border); --bs-accordion-btn-focus-box-shadow: none; }
.accordion-button:not(.collapsed) { background: var(--lms-surface-2); color: var(--lms-text); }

/* Footer follows the page instead of a heavy dark block. */
footer.site-footer {
  background: var(--lms-surface) !important;
  border-top: 1px solid var(--lms-border);
  color: var(--lms-text) !important;
}
footer.site-footer .text-secondary { color: var(--lms-muted) !important; }
footer.site-footer a, footer.site-footer .link-light { color: var(--lms-muted) !important; }
footer.site-footer a:hover { color: var(--lms-text) !important; }
footer.site-footer hr { border-color: var(--lms-border); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Live preview of the one-per-line outcome and requirement fields. */
.bullet-preview { list-style: none; padding-left: 0; margin-bottom: 0; }
.bullet-preview li { color: var(--lms-muted); padding: .1rem 0; }
.bullet-preview:empty { display: none; }
