/* ================================================================
   ELWAT — Complete Design System
   Every Learning Way Tech | _shared.css
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* ================================================================
   CSS VARIABLES
   ================================================================ */
:root {
  --bg:           #07070F;
  --bg-1:         #0F0F1A;
  --bg-2:         #161625;
  --bg-3:         #1E1E32;
  --border:       rgba(255,255,255,0.06);
  --border-mid:   rgba(255,255,255,0.12);
  --teal:         #00E8C6;
  --teal-dim:     rgba(0,232,198,0.12);
  --teal-glow:    rgba(0,232,198,0.25);
  --coral:        #FF6B6B;
  --coral-dim:    rgba(255,107,107,0.12);
  --gold:         #FFD166;
  --gold-dim:     rgba(255,209,102,0.12);
  --text:         #F0F0FF;
  --text-2:       #9999BB;
  --text-3:       #5A5A7A;
  --nav-h:        56px;
  --bottom-nav-h: 64px;
  --sidebar-w:    240px;
  --radius:       12px;
  --radius-lg:    16px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-teal:  0 0 24px rgba(0,232,198,0.15);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: var(--bottom-nav-h);
}

img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ================================================================
   TYPOGRAPHY
   ================================================================ */
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; font-weight: 600; }

.display { font-family: 'Space Grotesk', sans-serif; font-weight: 700; }

/* ================================================================
   TOP NAVIGATION (Mobile-First)
   ================================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(7,7,15,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--teal);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav-spacer { flex: 1; }

.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--bg-3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-notif {
  position: relative;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 18px;
  padding: 8px;
  border-radius: var(--radius);
  transition: all 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.nav-notif:hover { background: var(--bg-3); color: var(--text); }

.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--coral);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.notif-badge:empty, .notif-badge[data-count="0"] { display: none; }

/* Desktop nav */
@media (min-width: 768px) {
  .nav {
    padding: 0 24px;
  }
  .nav-brand {
    font-size: 1.4rem;
  }
  .nav-links {
    display: flex;
  }
}

/* ================================================================
   LAYOUT
   ================================================================ */
.layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
  padding-top: var(--nav-h);
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 20px 16px;
  max-width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .main-content {
    padding: 32px 24px;
    max-width: 1200px;
  }
}

/* ================================================================
   BOTTOM NAVIGATION (Mobile-First)
   ================================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--bottom-nav-h);
  background: rgba(15,15,26,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.3);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 9px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  text-decoration: none;
  min-width: 48px;
  position: relative;
  flex: 1;
}

.bottom-nav-item i {
  font-size: 16px;
  transition: all 0.2s;
}

.bottom-nav-item:hover {
  color: var(--text-2);
}

.bottom-nav-item.active {
  color: var(--teal);
  background: var(--teal-dim);
}

.bottom-nav-item.active i {
  transform: scale(1.1);
}

.bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  background: var(--coral);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
  body {
    padding-bottom: 0;
  }
}

/* ================================================================
   SIDEBAR (Hidden on Mobile)
   ================================================================ */
.sidebar {
  display: none;
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
  }
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 12px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.sidebar-item:hover { background: var(--bg-3); color: var(--text); }
.sidebar-item.active {
  background: var(--teal-dim);
  color: var(--teal);
}
.sidebar-item .icon { font-size: 18px; flex-shrink: 0; }

.sidebar-spacer { flex: 1; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-hover {
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card-hover:hover {
  border-color: var(--border-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}

.btn-primary {
  background: var(--teal);
  color: #07070F;
}
.btn-primary:hover { background: #00CDB0; transform: translateY(-1px); box-shadow: var(--shadow-teal); }

.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border-mid);
}
.btn-secondary:hover { background: #252540; border-color: var(--text-3); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }

.btn-danger {
  background: var(--coral-dim);
  color: var(--coral);
  border: 1px solid rgba(255,107,107,0.2);
}
.btn-danger:hover { background: rgba(255,107,107,0.22); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: 8px; aspect-ratio: 1; }
.btn-full { width: 100%; }

.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-2); }

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-3);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-3);
}

.form-textarea { resize: vertical; min-height: 100px; }
.form-select option { background: var(--bg-2); }
.form-error { font-size: 12px; color: var(--coral); margin-top: 4px; }
.form-hint  { font-size: 12px; color: var(--text-3); margin-top: 4px; }

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

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.stat-card.teal  { border-color: rgba(0,232,198,0.2); }
.stat-card.coral { border-color: rgba(255,107,107,0.2); }
.stat-card.gold  { border-color: rgba(255,209,102,0.2); }

.stat-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-card.teal  .stat-icon { background: var(--teal-dim); }
.stat-card.coral .stat-icon { background: var(--coral-dim); }
.stat-card.gold  .stat-icon { background: var(--gold-dim); }

.stat-info { min-width: 0; }
.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card.teal  .stat-value { color: var(--teal); }
.stat-card.coral .stat-value { color: var(--coral); }
.stat-card.gold  .stat-value { color: var(--gold); }
.stat-label { font-size: 13px; color: var(--text-2); }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-teal  { background: var(--teal-dim);  color: var(--teal); }
.badge-coral { background: var(--coral-dim); color: var(--coral); }
.badge-gold  { background: var(--gold-dim);  color: var(--gold); }
.badge-muted { background: var(--bg-3);      color: var(--text-2); }

/* ================================================================
   TABLE
   ================================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ================================================================
   MODAL
   ================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s;
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--bg-3); color: var(--text); }

/* ================================================================
   TOAST
   ================================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  max-width: 360px;
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast--success { border-color: rgba(0,232,198,0.35); }
.toast--success::before { content: '✓'; color: var(--teal); font-weight: 700; }
.toast--error   { border-color: rgba(255,107,107,0.35); }
.toast--error::before   { content: '✕'; color: var(--coral); font-weight: 700; }
.toast--info    { border-color: rgba(255,209,102,0.35); }
.toast--info::before    { content: 'ℹ'; color: var(--gold); font-weight: 700; }

/* ================================================================
   LOADING & SPINNER
   ================================================================ */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

.loader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  flex-direction: column;
  gap: 12px;
  color: var(--text-2);
}

/* ================================================================
   AVATAR
   ================================================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
  flex-shrink: 0;
  font-size: 0;
  overflow: hidden;
}
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-md  { width: 44px;  height: 44px; }
.avatar-lg  { width: 64px;  height: 64px; }
.avatar-xl  { width: 96px;  height: 96px; }
.avatar-xxl { width: 128px; height: 128px; }

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border-radius: 50%;
  color: var(--teal);
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  flex-shrink: 0;
}

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress-bar {
  background: var(--bg-3);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
}
.progress-fill {
  background: var(--teal);
  height: 100%;
  border-radius: 100px;
  transition: width 0.4s ease;
}
.progress-fill.coral { background: var(--coral); }
.progress-fill.gold  { background: var(--gold); }

/* ================================================================
   TABS
   ================================================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  color: var(--text-2);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; max-width: 280px; }

/* ================================================================
   COURSE CARDS
   ================================================================ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.course-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.course-card:hover {
  border-color: var(--border-mid);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.course-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-3);
}

.course-info { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.course-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-creator { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.course-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-3);
  margin-top: auto;
}
.course-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--teal);
}
.course-price.free { color: var(--gold); }
.course-rating { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--gold); }

/* ================================================================
   PAGE HEADER
   ================================================================ */
.page-header { margin-bottom: 28px; }
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.page-sub { font-size: 14px; color: var(--text-2); }

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

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

@keyframes shimmer {
  0%   { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

.fade-in { animation: fadeInUp 0.5s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.40s; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, rgba(255,255,255,0.05) 50%, var(--bg-3) 75%);
  background-size: 936px 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 6px;
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.min-w-0      { min-width: 0; }

.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.text-teal   { color: var(--teal); }
.text-coral  { color: var(--coral); }
.text-gold   { color: var(--gold); }
.text-muted  { color: var(--text-2); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 11px; }
.text-lg     { font-size: 17px; }
.font-bold   { font-weight: 700; }
.font-display { font-family: 'Space Grotesk', sans-serif; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.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; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mt-32  { margin-top: 32px; }
.p-16   { padding: 16px; }
.p-24   { padding: 24px; }
.w-full { width: 100%; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ================================================================
   SECTION HEADER
   ================================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 700; }

/* ================================================================
   ACCORDION
   ================================================================ */
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.accordion-header {
  padding: 14px 16px;
  background: var(--bg-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
  user-select: none;
}
.accordion-header:hover { background: var(--bg-3); }
.accordion-toggle { transition: transform 0.25s; font-size: 12px; color: var(--text-3); }
.accordion-item.open .accordion-toggle { transform: rotate(180deg); }
.accordion-body { display: none; padding: 0; }
.accordion-item.open .accordion-body { display: block; }

/* ================================================================
   DROPDOWN
   ================================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 160px;
  box-shadow: var(--shadow);
  z-index: 200;
  display: none;
}
.dropdown-menu.open { display: block; animation: fadeIn 0.15s ease; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.dropdown-item:hover { background: var(--bg-3); color: var(--text); }
.dropdown-item.danger { color: var(--coral); }
.dropdown-item.danger:hover { background: var(--coral-dim); }

/* ================================================================
   STAR RATING
   ================================================================ */
.stars { color: var(--gold); letter-spacing: 2px; }
.star-input { display: flex; gap: 4px; }
.star-input span { font-size: 24px; cursor: pointer; color: var(--bg-3); transition: color 0.15s; }
.star-input span.active, .star-input span:hover, .star-input span.hover { color: var(--gold); }

/* ================================================================
   DRAG HANDLE
   ================================================================ */
.drag-handle { cursor: grab; color: var(--text-3); padding: 4px; }
.drag-handle:active { cursor: grabbing; }
.dragging { opacity: 0.5; border: 2px dashed var(--teal) !important; }

/* ================================================================
   UPLOAD ZONE
   ================================================================ */
.upload-zone {
  border: 2px dashed var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-3);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--teal);
  background: var(--teal-dim);
}
.upload-zone p { font-size: 13px; color: var(--text-2); margin-top: 8px; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 767px) {
  .main-content { padding: 16px 12px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .course-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px; max-width: calc(100vw - 32px); }
  .nav { padding: 0 12px; }
  .page-header { margin-bottom: 20px; }
  .page-title { font-size: 1.5rem; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ================================================================
   PRINT STYLES (for certificate.html)
   ================================================================ */
@media print {
  .nav, .sidebar, .btn, .no-print { display: none !important; }
  body { background: white !important; color: black !important; }
  .card { border: 1px solid #ccc !important; }
}

/* ================================================================
   AI ASSISTANT STYLES
   ================================================================ */

.ai-assistant-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--gold));
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 232, 198, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 999;
  animation: pulse 2s infinite;
}

.ai-assistant-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 232, 198, 0.4);
}

.ai-assistant-btn.active {
  background: var(--coral);
  animation: none;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(0, 232, 198, 0.3); }
  50% { box-shadow: 0 4px 20px rgba(0, 232, 198, 0.6); }
}

.ai-assistant-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 500px;
  max-height: calc(100vh - 140px);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 998;
}

.ai-assistant-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.ai-assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  border-radius: 16px 16px 0 0;
}

.ai-assistant-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  font-size: 32px;
  line-height: 1;
}

.ai-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.ai-status {
  font-size: 12px;
  color: var(--text-2);
}

.ai-close-btn {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.ai-close-btn:hover {
  background: var(--bg-1);
  color: var(--text);
}

.ai-chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-message {
  display: flex;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message-user {
  justify-content: flex-end;
}

.ai-message-assistant {
  justify-content: flex-start;
}

.ai-message-content {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.ai-message-user .ai-message-content {
  background: linear-gradient(135deg, var(--teal), var(--gold));
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-message-assistant .ai-message-content {
  background: var(--bg-3);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.ai-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
  border-radius: 0 0 16px 16px;
}

.ai-voice-btn {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-voice-btn:hover {
  background: var(--bg-2);
  color: var(--teal);
  border-color: var(--teal);
}

.ai-voice-btn.listening {
  background: var(--coral);
  color: white;
  border-color: var(--coral);
  animation: pulse-voice 1s infinite;
}

@keyframes pulse-voice {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.ai-input {
  flex: 1;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.ai-input:focus {
  border-color: var(--teal);
  background: var(--bg-2);
}

.ai-send-btn {
  background: linear-gradient(135deg, var(--teal), var(--gold));
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 232, 198, 0.3);
}

.ai-send-btn:active {
  transform: scale(0.95);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .ai-assistant-btn {
    bottom: 80px;
    right: 16px;
    width: 52px;
    height: 52px;
  }

  .ai-assistant-panel {
    bottom: 145px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}
