/* ═══════════════════════════════════════
   Learnify — Shared Styles
   ═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple:       #764ba2;
  --purple-light: #667eea;
  --purple-50:    #f5f3ff;
  --purple-100:   #ede9fe;
  --navy:         #1a1a2e;
  --navy-mid:     #16213e;
  --navy-deep:    #0f3460;
  --white:        #ffffff;
  --gray-50:      #f9fafb;
  --gray-100:     #f7f8fc;
  --gray-200:     #e5e7eb;
  --gray-300:     #d1d5db;
  --gray-400:     #9ca3af;
  --gray-500:     #6b7280;
  --gray-600:     #4b5563;
  --gray-700:     #374151;
  --gray-900:     #0f172a;
  --success:      #15803d;
  --error:        #dc2626;
  --warning:      #d97706;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --sh-xs: 0 1px 3px rgba(0,0,0,.07);
  --sh-sm: 0 2px 8px rgba(0,0,0,.08);
  --sh-md: 0 4px 18px rgba(0,0,0,.1);
  --sh-lg: 0 8px 32px rgba(0,0,0,.13);
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--gray-900);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────── NAVBAR ─────────────────── */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
  height: 64px;
  display: flex; align-items: center;
  padding: 0 40px; gap: 18px;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}

.nav-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.nav-logo .logo-icon svg { width: 20px; height: 20px; }

.nav-logo .logo-text {
  font-size: 20px; font-weight: 800;
  color: var(--gray-900); letter-spacing: -0.5px;
}

.nav-sep {
  width: 1px; height: 22px;
  background: var(--gray-200); flex-shrink: 0;
}

.nav-crumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--gray-500);
}
.nav-crumb a { color: var(--gray-500); text-decoration: none; transition: color .15s; }
.nav-crumb a:hover { color: var(--purple); }
.nav-crumb .sep { color: var(--gray-300); }
.nav-crumb .curr {
  color: var(--gray-900); font-weight: 600;
  max-width: 200px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.nav-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--r-sm);
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  color: var(--gray-500); transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-link svg { width: 15px; height: 15px; }
.nav-link:hover, .nav-link.active { background: var(--purple-50); color: var(--purple); }

/* ─────────────────── BADGE ─────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  color: white;
}

/* ─────────────────── BUTTONS ─────────────────── */
.btn {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer; border: none;
  text-decoration: none; line-height: 1;
  transition: opacity .15s, transform .12s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  color: white;
}
.btn-primary:hover {
  opacity: .88; transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(118,75,162,.36);
}

.btn-secondary {
  background: var(--white); color: var(--gray-700);
  border: 1.5px solid var(--gray-200) !important;
}
.btn-secondary:hover { background: var(--gray-50); }

.btn-ghost {
  background: none; color: var(--gray-500);
  border: 1.5px solid var(--gray-200) !important;
}
.btn-ghost:hover { background: var(--gray-50); color: var(--gray-700); }

.btn-danger { background: #fef2f2; color: var(--error); border: 1.5px solid #fecaca !important; }
.btn-danger:hover { background: #fee2e2; }

.btn-sm  { padding: 7px 12px; font-size: 13px; }
.btn-lg  { padding: 14px 28px; font-size: 15px; border-radius: var(--r-md); }
.btn-full { width: 100%; }

/* ─────────────────── FORM ─────────────────── */
.field { margin-bottom: 18px; }

.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--gray-700); margin-bottom: 7px;
}

.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--r-sm);
  font-size: 14px; color: var(--gray-900);
  font-family: 'Inter', sans-serif;
  background: var(--gray-50); outline: none;
  transition: border-color .2s, box-shadow .18s, background .18s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(118,75,162,.1);
  background: var(--white);
}
.field input[readonly] {
  background: var(--gray-100); color: var(--gray-400); cursor: not-allowed;
}
.field textarea { resize: vertical; min-height: 80px; }
.field-hint { font-size: 12px; color: var(--gray-400); margin-top: 5px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

/* ─────────────────── ALERTS ─────────────────── */
.alert {
  display: none; align-items: center; gap: 9px;
  padding: 11px 14px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; margin-bottom: 16px;
}
.alert.show { display: flex; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: var(--error); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.alert-warn    { background: #fffbeb; border: 1px solid #fde68a; color: var(--warning); }

/* ─────────────────── SPINNER ─────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%;
  animation: spin .65s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────── AVATAR ─────────────────── */
.avatar {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  color: white; font-weight: 700; flex-shrink: 0;
  text-decoration: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.av-sm { width: 32px; height: 32px; font-size: 13px; }
.av-md { width: 40px; height: 40px; font-size: 16px; }
.av-lg { width: 72px; height: 72px; font-size: 26px; }
.av-xl { width: 100px; height: 100px; font-size: 36px; border: 3px solid rgba(255,255,255,.3); }

/* ─────────────────── PANEL ─────────────────── */
.panel {
  background: var(--white); border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--sh-xs);
  margin-bottom: 20px; overflow: hidden;
}
.panel-header {
  padding: 16px 22px;
  font-size: 15px; font-weight: 700; color: var(--gray-900);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 9px;
}
.panel-header svg { width: 17px; height: 17px; color: var(--purple); flex-shrink: 0; }
.panel-body { padding: 22px; }

/* ─────────────────── SKELETON ─────────────────── */
.skel {
  background: linear-gradient(90deg, var(--gray-100) 25%, #eaecf3 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─────────────────── EMPTY STATE ─────────────────── */
.empty-state {
  padding: 60px 20px; text-align: center;
  grid-column: 1/-1;
}
.empty-state .empty-icon {
  width: 56px; height: 56px;
  background: var(--purple-50); border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--purple);
}
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-state p  { font-size: 14px; color: var(--gray-500); }

/* ─────────────────── UTILS ─────────────────── */
.text-muted  { color: var(--gray-400); }
.text-purple { color: var(--purple); }
.mt-0 { margin-top: 0 !important; }

@media (max-width: 768px) {
  .navbar { padding: 0 20px; gap: 10px; }
  .hide-sm { display: none !important; }
  .field-row { flex-direction: column; gap: 0; }
}
