@import url('https://fonts.googleapis.com/css2?family=Clash+Display:wght@400;500;600;700&family=Satoshi:wght@300;400;500;600;700&display=swap');

/* ───── CSS Variables ───── */
:root {
  --brand: #6C63FF;
  --brand-2: #FF6B6B;
  --brand-3: #43E97B;
  --accent: #FFD166;

  /* Light Mode */
  --bg: #F4F6FF;
  --bg-2: #FFFFFF;
  --bg-3: #EEF0FF;
  --surface: rgba(255,255,255,0.72);
  --surface-2: rgba(255,255,255,0.45);
  --border: rgba(108,99,255,0.14);
  --text: #1A1A2E;
  --text-2: #4A4A6A;
  --text-3: #8888AA;
  --shadow: 0 8px 40px rgba(108,99,255,0.12);
  --shadow-lg: 0 20px 60px rgba(108,99,255,0.18);
  --glass: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.5);
  --nav-bg: rgba(255,255,255,0.88);
  --card-bg: rgba(255,255,255,0.82);
  --input-bg: rgba(238,240,255,0.8);
  --sidebar-bg: rgba(255,255,255,0.95);
}

[data-theme="dark"] {
  --bg: #0D0D1A;
  --bg-2: #13132A;
  --bg-3: #1A1A33;
  --surface: rgba(20,20,45,0.85);
  --surface-2: rgba(30,30,60,0.55);
  --border: rgba(108,99,255,0.22);
  --text: #E8E8FF;
  --text-2: #AAAACC;
  --text-3: #6666AA;
  --shadow: 0 8px 40px rgba(108,99,255,0.22);
  --shadow-lg: 0 20px 60px rgba(108,99,255,0.3);
  --glass: rgba(20,20,50,0.75);
  --glass-border: rgba(108,99,255,0.2);
  --nav-bg: rgba(13,13,26,0.92);
  --card-bg: rgba(25,25,50,0.88);
  --input-bg: rgba(30,30,60,0.7);
  --sidebar-bg: rgba(15,15,30,0.97);
}

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

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

body {
  font-family: 'Satoshi', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ───── Typography ───── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Clash Display', 'Satoshi', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ───── Scrollbar ───── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--brand); border-radius: 3px; }

/* ───── Noise Texture Overlay ───── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ───── Animated BG Orbs ───── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orb-float 8s ease-in-out infinite;
}
.bg-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(108,99,255,0.15), transparent 70%);
  top: -100px; left: -100px;
}
.bg-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,107,107,0.1), transparent 70%);
  bottom: -80px; right: -80px;
  animation-delay: -4s;
}
.bg-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(67,233,123,0.08), transparent 70%);
  top: 50%; left: 50%;
  animation-delay: -2s;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 20px) scale(0.97); }
}

/* ───── Navbar ───── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 68px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  gap: 16px;
  transition: background 0.4s;
}

.navbar-brand {
  font-family: 'Clash Display', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.navbar-spacer { flex: 1; }

.navbar-actions { display: flex; align-items: center; gap: 12px; }

/* ───── Theme Toggle ───── */
.theme-toggle {
  width: 44px; height: 24px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand);
  top: 2px; left: 2px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="dark"] .theme-toggle::after { transform: translateX(20px); }

/* ───── Buttons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  font-family: 'Satoshi', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 0.1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), #9B59B6);
  color: white;
  box-shadow: 0 4px 20px rgba(108,99,255,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,99,255,0.45); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover { transform: translateY(-2px); border-color: var(--brand); }

.btn-danger {
  background: linear-gradient(135deg, #FF6B6B, #ee5a24);
  color: white;
  box-shadow: 0 4px 20px rgba(255,107,107,0.3);
}

.btn-success {
  background: linear-gradient(135deg, #43E97B, #38f9d7);
  color: #1A1A2E;
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; border-radius: 14px; }

.btn-google {
  background: white;
  color: #333;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }

/* ───── Glass Card ───── */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(108,99,255,0.3);
}

/* ───── Input Fields ───── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.input-group input, .input-group textarea, .input-group select {
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: 'Satoshi', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: all 0.25s;
  width: 100%;
}
.input-group input:focus, .input-group textarea:focus, .input-group select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}

/* ───── Main Layout ───── */
.app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 68px;
}

.sidebar {
  width: 260px;
  min-height: calc(100vh - 68px);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: fixed;
  top: 68px; left: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(20px);
  z-index: 90;
  transition: transform 0.3s ease;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  position: relative;
  z-index: 1;
}

/* ───── Sidebar Nav Items ───── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--brand);
  border-color: var(--border);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(108,99,255,0.05));
  color: var(--brand);
  border-color: rgba(108,99,255,0.2);
}
.nav-item .nav-icon { font-size: 1.2rem; width: 24px; text-align: center; }
.nav-item .nav-label { font-size: 0.95rem; }
.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: white;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
}

/* ───── Stats Grid ───── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--stat-color, var(--brand));
  opacity: 0.1;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-value {
  font-family: 'Clash Display', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--stat-color, var(--brand));
  line-height: 1;
}
.stat-label { font-size: 0.85rem; color: var(--text-2); margin-top: 6px; font-weight: 500; }
.stat-icon { font-size: 1.8rem; margin-bottom: 12px; }

/* ───── Course Cards ───── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.course-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(20px);
}
.course-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: rgba(108,99,255,0.3);
}
.course-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}
.course-thumbnail-img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.course-body { padding: 20px; }
.course-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}
.course-instructor { color: var(--text-3); font-size: 0.85rem; margin-bottom: 16px; }
.course-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.course-tag {
  background: rgba(108,99,255,0.1);
  color: var(--brand);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.course-enrolled-badge {
  background: linear-gradient(135deg, rgba(67,233,123,0.15), rgba(56,249,215,0.1));
  color: #43E97B;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid rgba(67,233,123,0.2);
}

/* ───── Tabs ───── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--input-bg);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab {
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-2);
  transition: all 0.25s;
  white-space: nowrap;
}
.tab.active {
  background: var(--brand);
  color: white;
  box-shadow: 0 4px 14px rgba(108,99,255,0.3);
}
.tab:not(.active):hover { background: var(--surface-2); color: var(--text); }

/* ───── Avatar ───── */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  cursor: pointer;
  border: 2px solid var(--glass-border);
  flex-shrink: 0;
}

/* ───── Modal ───── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--input-bg);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--brand); color: white; }
.modal-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 24px;
  padding-right: 40px;
}

/* ───── Toast Notifications ───── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 340px;
  backdrop-filter: blur(20px);
}
.toast.success { border-left: 4px solid #43E97B; }
.toast.error { border-left: 4px solid #FF6B6B; }
.toast.info { border-left: 4px solid var(--brand); }
@keyframes toast-in {
  from { transform: translateX(100%) scale(0.8); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ───── Progress Bar ───── */
.progress-bar {
  background: var(--input-bg);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ───── Loader ───── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}
.loader-dots {
  display: flex;
  gap: 8px;
}
.loader-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand);
  animation: dot-bounce 1.4s ease-in-out infinite;
}
.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ───── Streak & Gamification ───── */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255,166,0,0.15), rgba(255,107,107,0.1));
  border: 1px solid rgba(255,166,0,0.2);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #FFD166;
}
.streak-flame { font-size: 1.2rem; animation: flame 1s ease-in-out infinite; }
@keyframes flame {
  0%, 100% { transform: scale(1) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(5deg); }
}

/* ───── Leaderboard ───── */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: all 0.2s;
}
.leaderboard-item:hover { transform: translateX(4px); border-color: var(--brand); }
.leaderboard-rank {
  font-family: 'Clash Display', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  width: 28px;
  text-align: center;
}
.rank-1 { color: #FFD700; }
.rank-2 { color: #C0C0C0; }
.rank-3 { color: #CD7F32; }

/* ───── Hidden Admin Star ───── */
.admin-star {
  position: fixed;
  bottom: 16px; right: 16px;
  width: 28px; height: 28px;
  opacity: 0.15;
  cursor: pointer;
  z-index: 999;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s, transform 0.3s;
}
.admin-star:hover { opacity: 0.9; transform: rotate(72deg) scale(1.2); }

/* ───── Section Header ───── */
.section-header {
  margin-bottom: 24px;
}
.section-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
}
.section-subtitle { color: var(--text-2); font-size: 0.95rem; margin-top: 4px; }

/* ───── Announcement Banner ───── */
.announcement {
  background: linear-gradient(135deg, rgba(108,99,255,0.12), rgba(255,107,107,0.08));
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slide-down 0.4s ease;
}
@keyframes slide-down {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ───── Video Embed ───── */
.video-container {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
}
.video-container iframe {
  width: 100%; height: 100%; border: none;
}

/* ───── Lecture Item ───── */
.lecture-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.25s;
}
.lecture-item:hover { background: var(--surface-2); border-color: var(--brand); }
.lecture-item.active { background: rgba(108,99,255,0.1); border-color: var(--brand); }
.lecture-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}
.lecture-item.active .lecture-num {
  background: var(--brand);
  color: white;
}
.lecture-info { flex: 1; }
.lecture-title { font-weight: 600; font-size: 0.95rem; }
.lecture-duration { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }
.lecture-done { color: #43E97B; font-size: 0.9rem; }

/* ───── PDF Item ───── */
.pdf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: all 0.25s;
}
.pdf-item:hover { border-color: var(--brand-2); transform: translateX(4px); }

/* ───── Doubt Card ───── */
.doubt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
  transition: all 0.25s;
}
.doubt-card:hover { border-color: var(--brand); }
.doubt-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.doubt-student { font-weight: 600; }
.doubt-email { font-size: 0.8rem; color: var(--text-3); }
.doubt-time { font-size: 0.78rem; color: var(--text-3); }
.doubt-message { color: var(--text-2); font-size: 0.93rem; line-height: 1.6; }

/* ───── Chat ───── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 68px - 64px);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.93rem;
  line-height: 1.5;
  position: relative;
}
.chat-bubble.sent {
  background: linear-gradient(135deg, var(--brand), #9B59B6);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.received {
  background: var(--surface);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
}
.chat-input {
  flex: 1;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: 'Satoshi', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.25s;
}
.chat-input:focus { border-color: var(--brand); }

/* ───── Profile ───── */
.profile-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  color: white;
}
.profile-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
}

/* ───── Certificate Placeholder ───── */
.certificate {
  border: 3px solid var(--accent);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,209,102,0.08), rgba(255,166,0,0.04));
  position: relative;
  overflow: hidden;
}
.certificate::before, .certificate::after {
  content: '★';
  position: absolute;
  font-size: 6rem;
  color: rgba(255,209,102,0.06);
}
.certificate::before { top: -20px; left: -20px; }
.certificate::after { bottom: -20px; right: -20px; }

/* ───── Admin Panel ───── */
.admin-header {
  background: linear-gradient(135deg, #1A1A2E, #16213E);
  color: white;
  padding: 24px;
  border-radius: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-badge {
  background: linear-gradient(135deg, #FF6B6B, #ee5a24);
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ───── Animations ───── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scale-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to { background-position: 200% 0; }
}

.animate-up { animation: fade-up 0.5s ease forwards; }
.animate-up-delay-1 { animation: fade-up 0.5s 0.1s ease both; }
.animate-up-delay-2 { animation: fade-up 0.5s 0.2s ease both; }
.animate-up-delay-3 { animation: fade-up 0.5s 0.3s ease both; }
.animate-fade { animation: fade-in 0.4s ease; }
.animate-scale { animation: scale-in 0.4s cubic-bezier(0.34,1.56,0.64,1); }

.skeleton {
  background: linear-gradient(90deg, var(--input-bg) 25%, var(--surface-2) 50%, var(--input-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ───── Landing Page Specific ───── */
.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(108,99,255,0.05));
  border: 1px solid rgba(108,99,255,0.25);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 24px;
  animation: fade-up 0.5s ease;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fade-up 0.5s 0.1s ease both;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--brand), var(--brand-2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
  animation: fade-up 0.5s 0.2s ease both;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fade-up 0.5s 0.3s ease both;
}
.hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 60px;
  animation: fade-up 0.5s 0.4s ease both;
}
.hero-stat { text-align: center; }
.hero-stat-value {
  font-family: 'Clash Display', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-stat-label { font-size: 0.85rem; color: var(--text-2); margin-top: 2px; }

/* ───── Responsive ───── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 80vw;
    max-width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .courses-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 20px; }
  .hero h1 { font-size: 2.2rem; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 10px 0;
    z-index: 100;
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    color: var(--text-3);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 0;
    transition: color 0.2s;
  }
  .bottom-nav-item.active { color: var(--brand); }
  .bottom-nav-item .nav-icon { font-size: 1.3rem; }
  .main-content { padding-bottom: 80px; }
}
@media (min-width: 769px) { .bottom-nav { display: none; } }

/* ───── Hamburger ───── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}
@media (max-width: 768px) { .hamburger { display: flex; } }

/* ───── Overlay for mobile sidebar ───── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 89;
}
.sidebar-overlay.show { display: block; }

/* ───── Utility ───── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-2); }
.text-brand { color: var(--brand); }
.fw-600 { font-weight: 600; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.hidden { display: none !important; }
