/* ============================================================
   GRAFIX@MIRROR LMS — DESIGN SYSTEM
   ============================================================ */

:root {
  --brand:        #4f46e5;
  --brand-dark:   #3730a3;
  --brand-light:  #eef2ff;
  --accent:       #06b6d4;
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --dark:         #0f172a;
  --muted:        #64748b;
  --surface:      #f8fafc;
  --card-bg:      #ffffff;
  --border:       #e2e8f0;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:    0 8px 32px rgba(79,70,229,.12);
  --font:         'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--surface);
  color: var(--dark);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ── Typography ── */
.page-title   { font-size: 1.5rem; font-weight: 700; color: var(--dark); }
.section-title{ font-size: 1.1rem; font-weight: 600; color: var(--dark); margin-bottom: 1rem; }
.text-muted   { color: var(--muted) !important; }

/* ── Cards ── */
.lms-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.lms-card-sm { padding: 1rem; }

/* ── Stat Cards ── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: .78rem; color: var(--muted); margin-top: .2rem; }

.stat-icon.purple { background: #ede9fe; color: var(--brand); }
.stat-icon.cyan   { background: #cffafe; color: #0891b2; }
.stat-icon.green  { background: #d1fae5; color: var(--success); }
.stat-icon.amber  { background: #fef3c7; color: var(--warning); }
.stat-icon.red    { background: #fee2e2; color: var(--danger); }
.stat-icon.blue   { background: #dbeafe; color: #2563eb; }

/* ── Navbar ── */
.lms-nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
  position: sticky; top: 0; z-index: 1030;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.lms-nav .brand {
  font-weight: 800; font-size: 1.1rem;
  color: var(--brand); display: flex; align-items: center; gap: .5rem;
}
.lms-nav .brand span { color: var(--dark); }

/* Admin nav */
.lms-nav-admin  { background: var(--dark); border-bottom: none; }
.lms-nav-admin .brand, .lms-nav-admin a { color: #fff !important; }
.lms-nav-admin .nav-link:hover { color: #a5b4fc !important; }

/* Instructor nav */
.lms-nav-instructor { background: var(--brand); border-bottom: none; }
.lms-nav-instructor .brand, .lms-nav-instructor a { color: #fff !important; }

/* ── Sidebar Layout ── */
.lms-layout { display: flex; min-height: calc(100vh - 60px); }

.lms-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky; top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.lms-sidebar .nav-section {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase;
  padding: .75rem 1.25rem .25rem;
}
.lms-sidebar .nav-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1.25rem;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  border-radius: 0; transition: all .15s;
}
.lms-sidebar .nav-link:hover,
.lms-sidebar .nav-link.active {
  color: var(--brand);
  background: var(--brand-light);
}
.lms-sidebar .nav-link.active { font-weight: 600; }
.lms-sidebar .nav-link i { width: 18px; text-align: center; }

.lms-main { flex: 1; padding: 2rem; min-width: 0; }

/* ── Buttons ── */
.btn-brand {
  background: var(--brand); color: #fff; border: none;
  padding: .55rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: background .15s, transform .1s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-brand:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); }
.btn-brand:active { transform: translateY(0); }

.btn-outline-brand {
  background: transparent; color: var(--brand);
  border: 1.5px solid var(--brand);
  padding: .5rem 1.2rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--border);
  padding: .5rem 1.2rem; border-radius: var(--radius-sm);
  font-weight: 500; font-size: .9rem; cursor: pointer;
  transition: all .15s;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ── Forms ── */
.form-label { font-weight: 600; font-size: .85rem; color: var(--dark); margin-bottom: .35rem; }
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .9rem;
  font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
  outline: none;
}
.form-section-title {
  font-size: .8rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand);
  padding-bottom: .5rem; border-bottom: 2px solid var(--brand-light);
  margin-bottom: 1rem; margin-top: 1.5rem;
}

/* ── Auth Pages ── */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff 0%, #f0fdfa 100%);
  padding: 2rem 1rem;
}
.auth-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%; max-width: 460px;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; margin-bottom: 1.75rem;
}
.auth-logo .logo-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800;
}
.auth-logo .logo-text { font-size: 1.2rem; font-weight: 800; color: var(--dark); }
.auth-logo .logo-text span { color: var(--brand); }
.auth-title { font-size: 1.4rem; font-weight: 700; text-align: center; margin-bottom: .35rem; }
.auth-sub   { font-size: .88rem; color: var(--muted); text-align: center; margin-bottom: 1.75rem; }

/* ── Badges ── */
.badge-success { background: #d1fae5; color: #065f46; padding: .25rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-warning { background: #fef3c7; color: #92400e; padding: .25rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-danger  { background: #fee2e2; color: #991b1b; padding: .25rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-info    { background: #cffafe; color: #155e75; padding: .25rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-muted   { background: #f1f5f9; color: var(--muted); padding: .25rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-brand   { background: var(--brand-light); color: var(--brand); padding: .25rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }

/* ── Tables ── */
.lms-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.lms-table th {
  background: var(--surface); color: var(--muted);
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border); text-align: left;
}
.lms-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.lms-table tr:last-child td { border-bottom: none; }
.lms-table tr:hover td { background: var(--surface); }

/* ── Alerts ── */
.lms-alert {
  padding: .85rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 500; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .6rem;
}
.lms-alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.lms-alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.lms-alert-info    { background: #cffafe; color: #155e75; border: 1px solid #a5f3fc; }
.lms-alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ── Course Cards ── */
.course-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.course-card .course-thumb {
  height: 140px; background: linear-gradient(135deg, var(--brand-light), #e0f2fe);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--brand);
}
.course-card .course-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.course-card .course-title { font-weight: 700; font-size: .95rem; margin-bottom: .35rem; }
.course-card .course-price { font-size: .85rem; color: var(--muted); }
.course-card .course-footer { padding: .75rem 1rem; border-top: 1px solid var(--border); }

/* ── Hero (Landing) ── */
.lms-hero {
  background: linear-gradient(135deg, var(--dark) 0%, #1e1b4b 60%, #0c4a6e 100%);
  color: #fff; padding: 5rem 0 4rem;
  position: relative; overflow: hidden;
}
.lms-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.lms-hero .hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #a5b4fc; padding: .35rem .9rem; border-radius: 99px;
  font-size: .8rem; font-weight: 600; margin-bottom: 1.25rem;
}
.lms-hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; line-height: 1.15; }
.lms-hero h1 span { color: #a5b4fc; }
.lms-hero p.lead { color: #cbd5e1; font-size: 1.1rem; max-width: 560px; }

/* ── Password Strength ── */
.pwd-bar { height: 4px; border-radius: 2px; margin-top: .4rem; transition: all .3s; background: var(--border); }
.pwd-bar.weak   { background: var(--danger); width: 33%; }
.pwd-bar.medium { background: var(--warning); width: 66%; }
.pwd-bar.strong { background: var(--success); width: 100%; }
.pwd-label { font-size: .75rem; margin-top: .2rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .lms-sidebar { display: none; }
  .lms-sidebar.open { display: block; position: fixed; top: 60px; left: 0; bottom: 0; z-index: 1020; width: 260px; box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  .lms-main { padding: 1rem; }
  .auth-box { padding: 1.75rem 1.25rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
}

/* ── Sidebar Courses Accordion ── */
.sidebar-courses {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
}
.sidebar-courses.open { max-height: 600px; }
.sidebar-acc-btn {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; padding: .55rem 1.25rem;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  text-align: left; transition: color .15s, background .15s;
}
.sidebar-acc-btn:hover, .sidebar-acc-btn.active { color: var(--brand); background: var(--brand-light); }
.sidebar-acc-btn i.icon { width: 18px; text-align: center; }
.sidebar-acc-btn .chev { margin-left: auto; font-size: .7rem; transition: transform .25s; }
.sidebar-acc-btn.open .chev { transform: rotate(180deg); }
.sidebar-course-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem 1.25rem .4rem 2.2rem;
  font-size: .82rem; color: var(--muted); font-weight: 500;
  transition: color .15s; text-decoration: none;
}
.sidebar-course-item:hover { color: var(--brand); }
.sidebar-course-item i { width: 14px; font-size: .45rem; }

/* ── Video ratio ── */
.ratio-16x9 { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.ratio-16x9 iframe, .ratio-16x9 video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
