/* ============================================================
   Intelligent Life Guide LMS — Master Stylesheet
   Brand: Professor Hanna | professorhanna.com
   Palette: Deep Navy + Antique Gold + Warm Ivory
   ============================================================ */

:root {
  /* Core brand colors */
  --navy-deepest: #0D1423;
  --navy-deep:    #0a1220;
  --navy-mid:     #162035;
  --navy-card:    #1E2E4A;
  --navy-hover:   #253550;
  --navy-border:  #1a2d47;

  /* Gold */
  --gold:         #C4973A;
  --gold-light:   #E8C87A;
  --gold-dark:    #8A6520;
  --gold-glow:    rgba(196,151,58,.25);
  --gold-faint:   rgba(196,151,58,.07);

  /* Text */
  --text-primary:   #F5F0E8;
  --text-secondary: #D4CAB5;
  --text-muted:     rgba(255,255,255,.54);
  --text-gold:      #C4973A;

  /* Semantic */
  --success:  #4CAF7D;
  --warning:  #E8C87A;
  --danger:   #E05C5C;
  --info:     #5B9BD5;

  /* Sizing */
  --sidebar-w: 260px;
  --header-h:  64px;
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,.35);
  --shadow-md: 0 4px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.5);
  --shadow-gold: 0 0 20px rgba(196,151,58,.2);

  /* Transitions */
  --t-fast: 150ms ease;
  --t-med:  250ms ease;
  --t-slow: 400ms ease;

  /* Typography */
  --font-serif: 'Garamond', 'Georgia', serif;
  --font-sans:  'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--navy-deepest);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--gold-light); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--gold); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  font-weight: normal;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }

ul, ol { padding-left: 1.5rem; }

hr {
  border: none;
  border-top: 1px solid rgba(196,151,58,.15);
  margin: 1.5rem 0;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy-deep); }
::-webkit-scrollbar-thumb { background: var(--navy-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy-deep);
  border-right: 1px solid rgba(196,151,58,.1);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--t-med);
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(196,151,58,.12);
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.sidebar-brand img {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-family: var(--font-serif);
  font-size: .95rem;
  color: var(--gold-light);
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: .7rem;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  padding: .75rem 1.25rem .35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: all var(--t-fast);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(196,151,58,.06);
  color: var(--text-primary);
  border-left-color: rgba(196,151,58,.3);
}

.nav-item.active {
  background: var(--gold-faint);
  color: var(--gold-light);
  border-left-color: var(--gold);
}

.nav-item .nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy-deepest);
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(196,151,58,.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--navy-card);
  border: 2px solid var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; overflow: hidden; }

.sidebar-user-name {
  font-size: .85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.sidebar-user-role {
  font-size: .7rem;
  color: var(--gold);
  text-transform: capitalize;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   TOP HEADER
   ============================================================ */
.top-header {
  height: var(--header-h);
  background: rgba(13,20,35,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(196,151,58,.1);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text-muted);
}

.header-breadcrumb span { color: var(--text-muted); }
.header-breadcrumb a { color: var(--text-secondary); }
.header-breadcrumb .current { color: var(--text-primary); }

.header-spacer { flex: 1; }

.header-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(196,151,58,.15);
  border-radius: 20px;
  padding: .35rem .9rem;
  gap: .5rem;
  transition: all var(--t-fast);
}

.header-search:focus-within {
  background: rgba(255,255,255,.07);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.header-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: .875rem;
  width: 200px;
}

.header-search input::placeholder { color: var(--text-muted); }

.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.btn-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(196,151,58,.12);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 1rem;
  position: relative;
}

.btn-icon:hover {
  background: var(--gold-faint);
  border-color: var(--gold);
  color: var(--gold);
}

.btn-icon .badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 14px; height: 14px;
  background: var(--danger);
  border-radius: 50%;
  font-size: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 2px solid var(--navy-deepest);
}

/* ============================================================
   PAGE BODY
   ============================================================ */
.page-body {
  padding: 2rem 1.75rem;
  flex: 1;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: .25rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: .9rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy-deepest);
}

.btn-primary:hover {
  background: var(--gold-light);
  color: var(--navy-deepest);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--navy-card);
  color: var(--text-primary);
  border: 1px solid rgba(196,151,58,.2);
}

.btn-secondary:hover {
  background: var(--navy-hover);
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn-outline:hover {
  background: var(--gold-faint);
  color: var(--gold-light);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover { background: #c94848; }

.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.1);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--t-med);
}

.card:hover {
  border-color: rgba(196,151,58,.25);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(196,151,58,.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.card-body { padding: 1.25rem; }

.card-footer {
  padding: .9rem 1.25rem;
  border-top: 1px solid rgba(196,151,58,.08);
  background: rgba(0,0,0,.15);
}

/* Course card variant */
.course-card {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--t-med);
  cursor: pointer;
}

.course-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,.4), 0 0 30px rgba(196,151,58,.1);
}

.course-card-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--navy-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.course-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card-thumb-placeholder {
  font-size: 3rem;
  color: var(--gold-dark);
}

.course-card-body { padding: 1rem 1.1rem; }

.course-card-category {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold);
  margin-bottom: .4rem;
  font-weight: 600;
}

.course-card-title {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: .4rem;
  line-height: 1.3;
}

.course-card-instructor {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.course-card-meta {
  display: flex;
  gap: 1rem;
  font-size: .78rem;
  color: var(--text-muted);
}

.course-card-meta span { display: flex; align-items: center; gap: .3rem; }

.course-card-footer {
  padding: .75rem 1.1rem;
  border-top: 1px solid rgba(196,151,58,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar-wrap {
  background: rgba(255,255,255,.06);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  border-radius: 20px;
  transition: width .6s ease;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .4rem;
  font-size: .78rem;
  color: var(--text-muted);
}

.progress-label .pct { color: var(--gold); font-weight: 600; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: .825rem;
  color: var(--text-secondary);
  margin-bottom: .45rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(196,151,58,.18);
  border-radius: var(--radius-sm);
  padding: .6rem .9rem;
  color: var(--text-primary);
  font-size: .9rem;
  outline: none;
  transition: all var(--t-fast);
  font-family: var(--font-sans);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  border-color: var(--gold);
  background: rgba(196,151,58,.04);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

textarea.form-control { resize: vertical; min-height: 100px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23C4973A'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  padding-right: 2rem;
}

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .35rem;
}

.form-error {
  font-size: .75rem;
  color: var(--danger);
  margin-top: .35rem;
  display: none;
}

.form-error.show { display: block; }

.form-row {
  display: grid;
  gap: 1rem;
}

.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  cursor: pointer;
  margin-bottom: .5rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 17px; height: 17px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: .15rem;
}

.form-check-label {
  font-size: .875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid rgba(196,151,58,.15);
  gap: 0;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  padding: .7rem 1.2rem;
  font-size: .875rem;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
  font-weight: 500;
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-med);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--navy-mid);
  border: 1px solid rgba(196,151,58,.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--t-med);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(196,151,58,.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-family: var(--font-serif);
}

.modal-close {
  width: 30px; height: 30px;
  border: none;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--t-fast);
}

.modal-close:hover { background: rgba(224,92,92,.2); color: var(--danger); }

.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(196,151,58,.1);
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
}

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
.alert {
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: 1rem;
}

.alert-success { background: rgba(76,175,125,.12); border: 1px solid rgba(76,175,125,.3); color: #7dd9a8; }
.alert-warning { background: rgba(232,200,122,.1); border: 1px solid rgba(232,200,122,.3); color: var(--warning); }
.alert-danger  { background: rgba(224,92,92,.12);  border: 1px solid rgba(224,92,92,.3);  color: #e88888; }
.alert-info    { background: rgba(91,155,213,.12); border: 1px solid rgba(91,155,213,.3);  color: #8dbfe0; }

.toast-container {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.2);
  border-radius: var(--radius);
  padding: .8rem 1.1rem;
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .875rem;
  animation: slideInRight .3s ease;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-gold    { background: rgba(196,151,58,.15); color: var(--gold-light); border: 1px solid rgba(196,151,58,.25); }
.badge-success { background: rgba(76,175,125,.15); color: #7dd9a8; border: 1px solid rgba(76,175,125,.25); }
.badge-info    { background: rgba(91,155,213,.15); color: #8dbfe0; border: 1px solid rgba(91,155,213,.25); }
.badge-muted   { background: rgba(255,255,255,.06); color: var(--text-muted); border: 1px solid rgba(255,255,255,.1); }

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.1);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--t-fast);
}

.stat-card:hover {
  border-color: rgba(196,151,58,.25);
  background: var(--navy-hover);
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: .6rem;
}

.stat-value {
  font-size: 2rem;
  font-family: var(--font-serif);
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: .25rem;
}

.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ============================================================
   LESSON LIST (module accordion)
   ============================================================ */
.module-item {
  border: 1px solid rgba(196,151,58,.12);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: .75rem;
}

.module-header {
  padding: 1rem 1.25rem;
  background: var(--navy-card);
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  transition: background var(--t-fast);
  user-select: none;
}

.module-header:hover { background: var(--navy-hover); }

.module-chevron {
  font-size: .8rem;
  color: var(--gold);
  transition: transform var(--t-fast);
  margin-left: auto;
}

.module-item.open .module-chevron { transform: rotate(180deg); }

.module-body {
  display: none;
  background: rgba(0,0,0,.2);
  border-top: 1px solid rgba(196,151,58,.08);
}

.module-item.open .module-body { display: block; }

.lesson-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
  color: var(--text-secondary);
}

.lesson-item:hover {
  background: var(--gold-faint);
  color: var(--text-primary);
}

.lesson-item.active {
  background: rgba(196,151,58,.1);
  color: var(--gold-light);
}

.lesson-item.completed .lesson-icon { color: var(--success); }

.lesson-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.lesson-title { flex: 1; font-size: .875rem; }
.lesson-duration { font-size: .75rem; color: var(--text-muted); }
.lesson-check { font-size: .9rem; color: var(--success); }

/* ============================================================
   VIDEO / MEDIA PLAYER
   ============================================================ */
.media-player {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  aspect-ratio: 16/9;
  width: 100%;
  position: relative;
}

.media-player iframe,
.media-player video {
  width: 100%;
  height: 100%;
  border: none;
}

.media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--navy-mid);
  color: var(--text-muted);
  gap: 1rem;
}

.media-placeholder .play-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--gold-faint);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--gold);
  cursor: pointer;
  transition: all var(--t-fast);
}

.media-placeholder .play-icon:hover {
  background: var(--gold);
  color: var(--navy-deepest);
  transform: scale(1.1);
}

/* Audio player for podcasts */
.podcast-player {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.podcast-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.podcast-thumb {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--navy-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.podcast-title { font-size: 1rem; color: var(--text-primary); margin-bottom: .25rem; }
.podcast-subtitle { font-size: .8rem; color: var(--text-muted); }

/* ============================================================
   QUIZ STYLES
   ============================================================ */
.quiz-question {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.12);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.quiz-q-number {
  font-size: .75rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .5rem;
  font-weight: 600;
}

.quiz-q-text {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 1.1rem;
  line-height: 1.5;
}

.quiz-options { display: flex; flex-direction: column; gap: .5rem; }

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .7rem 1rem;
  border: 1px solid rgba(196,151,58,.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
}

.quiz-option:hover {
  background: var(--gold-faint);
  border-color: rgba(196,151,58,.35);
}

.quiz-option.selected {
  background: rgba(196,151,58,.12);
  border-color: var(--gold);
}

.quiz-option.correct {
  background: rgba(76,175,125,.12);
  border-color: var(--success);
}

.quiz-option.incorrect {
  background: rgba(224,92,92,.12);
  border-color: var(--danger);
}

.quiz-option input[type="radio"] {
  accent-color: var(--gold);
  width: 16px; height: 16px;
  margin-top: .1rem;
  flex-shrink: 0;
}

.quiz-option-label { font-size: .9rem; color: var(--text-secondary); cursor: pointer; }
.quiz-option:hover .quiz-option-label { color: var(--text-primary); }

.quiz-result-box {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.2);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
}

.quiz-score {
  font-size: 4rem;
  font-family: var(--font-serif);
  color: var(--gold-light);
  margin: 1rem 0;
}

.quiz-score-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  background: var(--gold-faint);
  box-shadow: var(--shadow-gold);
}

/* ============================================================
   DISCUSSION
   ============================================================ */
.discussion-post {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.1);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color var(--t-fast);
}

.discussion-post:hover { border-color: rgba(196,151,58,.22); }

.post-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.post-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--navy-mid);
  border: 2px solid var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.post-author { font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.post-date { font-size: .75rem; color: var(--text-muted); }

.post-body { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }

.post-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255,255,255,.05);
}

.post-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: color var(--t-fast);
  padding: 0;
}

.post-action-btn:hover { color: var(--gold); }

.post-replies {
  margin-top: 1rem;
  padding-left: 1.5rem;
  border-left: 2px solid rgba(196,151,58,.15);
}

/* ============================================================
   ANNOUNCEMENT BANNER
   ============================================================ */
.announcement {
  background: linear-gradient(135deg, rgba(196,151,58,.08), rgba(196,151,58,.04));
  border: 1px solid rgba(196,151,58,.2);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}

.announcement-title { font-size: .9rem; font-weight: 600; color: var(--gold-light); margin-bottom: .25rem; }
.announcement-body  { font-size: .825rem; color: var(--text-secondary); margin: 0; }
.announcement-date  { font-size: .72rem; color: var(--text-muted); margin-top: .3rem; }

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

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.table th {
  padding: .7rem 1rem;
  background: rgba(0,0,0,.25);
  color: var(--text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  border-bottom: 1px solid rgba(196,151,58,.12);
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.table tr:hover td {
  background: var(--gold-faint);
  color: var(--text-primary);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-title { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: .5rem; }
.empty-body { font-size: .875rem; max-width: 320px; margin: 0 auto 1.5rem; }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(196,151,58,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   DIVIDER WITH TEXT
   ============================================================ */
.divider-text {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: .8rem;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(196,151,58,.15);
}

/* ============================================================
   GOLD DECORATIVE LINE
   ============================================================ */
.gold-line {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: .75rem 0;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-gold   { color: var(--gold); }
.text-muted  { color: var(--text-muted); }
.text-primary{ color: var(--text-primary); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.text-sm     { font-size: .825rem; }
.text-xs     { font-size: .75rem; }
.fw-bold     { font-weight: 700; }
.serif       { font-family: var(--font-serif); }

.mt-1 { margin-top: .5rem;  }
.mt-2 { margin-top: 1rem;   }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem;   }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem;  }
.mb-2 { margin-bottom: 1rem;   }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem;   }

.p-0 { padding: 0; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-1 { gap: .5rem; }
.flex-gap-2 { gap: 1rem; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.d-none { display: none !important; }
.d-block { display: block !important; }

/* ============================================================
   LOGIN / LANDING PAGE
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--navy-deepest);
}

.auth-left {
  flex: 1;
  background: var(--navy-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(196,151,58,.08) 0%, transparent 70%);
}

.auth-hero-badge {
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: 0 0 40px rgba(196,151,58,.3);
  margin-bottom: 1.5rem;
  object-fit: cover;
}

.auth-hero-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
  margin-bottom: .5rem;
}

.auth-hero-sub {
  font-size: .9rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 380px;
  line-height: 1.7;
}

.auth-features {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  max-width: 340px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .875rem;
  color: var(--text-secondary);
}

.auth-feature-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-faint);
  border: 1px solid rgba(196,151,58,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.auth-right {
  width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: var(--navy-deepest);
}

.auth-form-wrap {
  width: 100%;
  max-width: 360px;
}

.auth-form-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: .25rem;
}

.auth-form-sub {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content { margin-left: 0; }

  .auth-left { display: none; }
  .auth-right { width: 100%; }

  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-body { padding: 1.25rem 1rem; }
  .course-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   SIDEBAR TOGGLE (mobile)
   ============================================================ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  display: none;
}

.sidebar-overlay.show { display: block; }

/* ============================================================
   ADMIN PANEL SPECIFICS
   ============================================================ */
.admin-tool-card {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.12);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: center;
}

.admin-tool-card:hover {
  border-color: var(--gold);
  background: var(--navy-hover);
  transform: translateY(-2px);
}

.admin-tool-icon { font-size: 2rem; margin-bottom: .6rem; }
.admin-tool-label { font-size: .875rem; color: var(--text-secondary); }

/* ============================================================
   COURSE HEADER HERO
   ============================================================ */
.course-hero {
  background: var(--navy-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
}

.course-hero-banner {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--navy-mid);
}

.course-hero-body { padding: 1.5rem; }

.course-hero-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: .4rem;
}

.course-hero-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .75rem;
}

.course-hero-meta span { display: flex; align-items: center; gap: .35rem; }

/* ============================================================
   NOTE-TAKING PANEL
   ============================================================ */
.notes-panel {
  background: var(--navy-card);
  border: 1px solid rgba(196,151,58,.12);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.notes-panel textarea {
  width: 100%;
  min-height: 150px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(196,151,58,.15);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: .875rem;
  padding: .75rem;
  resize: vertical;
  outline: none;
  transition: border-color var(--t-fast);
  font-family: var(--font-sans);
}

.notes-panel textarea:focus { border-color: var(--gold); }
