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

:root {
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --accent: #f59e0b;
  --dark: #0d0d1a;
  --dark2: #13131f;
  --sidebar-bg: #111120;
  --card-bg: #1a1a2e;
  --card-border: rgba(255,255,255,0.07);
  --text: #e2e8f0;
  --muted: #64748b;
  --white: #ffffff;
  --gradient: linear-gradient(135deg, #7c3aed, #2563eb);
  --radius: 14px;
  --sidebar-width: 260px;
  --topbar-height: 96px;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--dark); color: var(--text); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--dark2);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 200;
}

.topbar-left { display: flex; align-items: center; gap: 24px; }

.logo { font-size: 1.4rem; font-weight: 800; color: var(--white); white-space: nowrap; display: flex; align-items: center; }
.logo img { display: block; width: auto; }

/* Logo image */
.logo-img {
  height: 90px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: invert(1) hue-rotate(180deg) brightness(1.2) contrast(1.1);
  mix-blend-mode: screen;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px 16px;
  width: 340px;
}
.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.88rem;
  width: 100%;
}
.search-bar input::placeholder { color: var(--muted); }
.search-icon { font-size: 0.9rem; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0 14px;
  height: 38px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.topbar-button:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(124,58,237,0.35);
}

.icon-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-layout {
  display: flex;
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--card-border);
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  z-index: 100;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-nav { flex: 1; padding: 0 10px; }

/* ── Section labels ── */
.nav-section-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.25);
  padding: 20px 10px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

/* ── Nav items ── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.18s;
  margin-bottom: 1px;
  position: relative;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
.nav-item:hover .nav-icon { transform: scale(1.1); }

/* Active state — gradient pill */
.nav-item.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.28), rgba(37,99,235,0.18));
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(124,58,237,0.35);
}
/* Left accent bar on active */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: linear-gradient(180deg, #7c3aed, #2563eb);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.18s;
}

.badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
}
.live-badge { background: #ef4444; color: white; animation: pulse 1.5s infinite; }
.new-badge { background: rgba(124,58,237,0.3); color: var(--primary-light); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Sidebar CTA — B2B Collaborations */
.sidebar-cta {
  margin: 14px 10px 16px;
  background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(14,165,233,0.08));
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.b2b-cta-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.b2b-icon {
  font-size: 1.4rem;
}
.b2b-cta-top strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-cta p {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
  margin: 0 0 12px;
}

.btn-upgrade {
  display: block;
  background: linear-gradient(135deg, #10b981, #0ea5e9);
  color: white;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}
.btn-upgrade:hover { opacity: 0.88; transform: translateY(-1px); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px;
  min-height: 100%;
}

/* ===== CONTENT SECTIONS ===== */
.content-section { display: none; }
.content-section.active { display: block; }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--white); }

.section-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 0;
}

/* ===== FILTER TABS ===== */
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.filter-btn.active { background: rgba(124,58,237,0.2); border-color: rgba(124,58,237,0.5); color: var(--primary-light); font-weight: 600; }

/* ===== WELCOME BANNER ===== */
.welcome-banner {
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(37,99,235,0.15));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 18px;
  padding: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.welcome-label { font-size: 0.88rem; color: var(--muted); margin-bottom: 6px; }
.welcome-banner h1 { font-size: 2rem; font-weight: 800; color: var(--white); margin-bottom: 8px; }
.welcome-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 20px; }

.gradient-text {
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-primary {
  display: inline-block;
  background: var(--gradient);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.welcome-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 24px;
  text-align: center;
  min-width: 100px;
}
.stat-box strong { display: block; font-size: 1.6rem; font-weight: 800; color: var(--white); }
.stat-box span { font-size: 0.75rem; color: var(--muted); }

/* ===== CARDS ROW ===== */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.course-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.course-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,0.4); }

.card-thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: transform 0.3s;
}
.master-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb img { transition: transform 0.3s; }

.card-body { padding: 16px; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-light);
  background: rgba(124,58,237,0.15);
  padding: 3px 9px;
  border-radius: 50px;
  margin-bottom: 8px;
}

.free-tag {
  color: #10b981;
  background: rgba(16,185,129,0.15);
}

.upcoming-tag {
  color: #f59e0b;
  background: rgba(245,158,11,0.15);
}

.card-body h3 { font-size: 0.95rem; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.card-body p { font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }

.progress-bar {
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 50px;
  margin-bottom: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 50px;
}
.progress-label { font-size: 0.75rem; color: var(--muted); }

/* ===== LIVE CLASSES ===== */
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.live-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.live-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,0.4); }
.live-card.featured { border-color: rgba(124,58,237,0.4); }

.live-thumb {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.live-emoji { font-size: 3rem; }

.live-pill {
  position: absolute;
  top: 12px; left: 12px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  animation: pulse 1.5s infinite;
}
.upcoming-pill { background: rgba(0,0,0,0.5); animation: none; }

.live-body { padding: 18px; }
.live-body h3 { font-size: 1rem; font-weight: 700; color: var(--white); margin: 8px 0 6px; }
.live-body p { font-size: 0.83rem; color: var(--muted); margin-bottom: 12px; }

.live-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); margin-bottom: 14px; }

.live-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

.btn-join {
  display: inline-block;
  background: #ef4444;
  color: white;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: opacity 0.2s;
}
.btn-join:hover { opacity: 0.85; }

.btn-remind {
  display: inline-block;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-remind:hover { background: rgba(255,255,255,0.12); }

/* ===== MASTERCLASSES ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.master-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.master-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,0.4); }

.card-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); margin-bottom: 14px; }

.btn-enroll {
  display: inline-block;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: #10b981;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 0.2s;
}
.btn-enroll:hover { background: rgba(16,185,129,0.25); }

/* ===== SUCCESS STORIES ===== */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.story-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  transition: transform 0.25s;
}
.story-card:hover { transform: translateY(-4px); }
.story-card.featured-story { border-color: rgba(124,58,237,0.35); grid-column: span 2; }

.story-quote {
  font-size: 4rem;
  line-height: 1;
  color: rgba(124,58,237,0.3);
  font-family: Georgia, serif;
  margin-bottom: -10px;
}

.story-card p { font-size: 0.92rem; color: var(--text); line-height: 1.75; margin-bottom: 20px; font-style: italic; }

.story-author {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.story-author div { display: flex; flex-direction: column; }
.story-author strong { font-size: 0.9rem; color: var(--white); }
.story-author span { font-size: 0.78rem; color: var(--muted); }

.story-badge {
  margin-left: auto;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--primary-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 50px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .nav-item span:not(.nav-icon), .nav-section-label, .badge, .sidebar-cta { display: none; }
  .main-content { margin-left: 64px; }
  .search-bar { width: 200px; }
  .story-card.featured-story { grid-column: span 1; }
}

@media (max-width: 600px) {
  .main-content { padding: 16px; }
  .welcome-banner { flex-direction: column; }
  .welcome-stats { justify-content: center; }
}

/* ===== SUBSECTION HEADER ===== */
.subsection-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 36px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.subsection-icon { font-size: 1.2rem; }
.subsection-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

/* ===== ENTERPRISE CARDS ===== */
.enterprise-card {
  border-color: rgba(37,99,235,0.35) !important;
  background: linear-gradient(160deg, #0f1e3d, #1a1a2e) !important;
}
.enterprise-tag {
  color: #60a5fa !important;
  background: rgba(37,99,235,0.15) !important;
}

/* Subsection header inside grid */
.cards-grid .subsection-header {
  grid-column: 1 / -1;
  margin: 24px 0 8px;
}

/* ===== PROFESSIONAL PROGRAM CARDS ===== */
.pro-card { position: relative; }

.pro-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 50px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
}
.developer-badge  { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.advanced-badge   { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.business-badge   { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.workflow-badge   { background: linear-gradient(135deg, #06b6d4, #6366f1); }
.futuristic-badge { background: linear-gradient(135deg, #0f172a, #7c3aed); border: 1px solid #7c3aed; }
.ops-badge        { background: linear-gradient(135deg, #059669, #0ea5e9); }

.enterprise-badge { background: linear-gradient(135deg, #1e3a5f, #2563eb); }

/* ===== PRICE TAG ===== */
.price-tag {
  color: #facc15;
  font-weight: 700;
  font-size: 0.82rem;
  background: rgba(250,204,21,0.1);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(250,204,21,0.25);
}

/* ===== ENROLL MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: #1a1a2e;
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 18px;
  padding: 36px;
  width: 100%;
  max-width: 460px;
  position: relative;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity:0; } to { transform: translateY(0); opacity:1; } }

.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none; border: none;
  color: var(--muted); font-size: 1.5rem;
  cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--white); }

.modal-header { text-align: center; margin-bottom: 24px; }
.modal-icon { font-size: 2.5rem; margin-bottom: 10px; }
.modal-header h2 { font-size: 1.3rem; font-weight: 800; color: var(--white); margin-bottom: 6px; }
.modal-header p { font-size: 0.85rem; color: var(--muted); }

.modal-tabs { display: flex; gap: 8px; margin-bottom: 24px; background: rgba(255,255,255,0.05); border-radius: 10px; padding: 4px; }
.modal-tab {
  flex: 1; padding: 9px; border: none; border-radius: 8px;
  background: none; color: var(--muted); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.modal-tab.active { background: var(--gradient); color: white; }

.modal-form { display: none; flex-direction: column; gap: 14px; }
.modal-form.active { display: flex; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.form-group input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--white);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--primary-light); }

.btn-submit {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.2s;
}
.btn-submit:hover { opacity: 0.88; }

.form-note { font-size: 0.75rem; color: var(--muted); text-align: center; }

.modal-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 20px 0;
}
.success-icon { font-size: 3rem; }
.modal-success h3 { font-size: 1.2rem; font-weight: 800; color: var(--white); }
.modal-success p { font-size: 0.88rem; color: var(--muted); }

/* Admin link */
.admin-link {
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 8px;
  padding-top: 12px !important;
  color: rgba(239,68,68,0.7) !important;
}
.admin-link:hover { color: #f87171 !important; background: rgba(239,68,68,0.08) !important; }
.btn-back {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-back:hover { background: rgba(255,255,255,0.12); }

/* ===== MY COURSES DASHBOARD ===== */
.btn-manage-courses {
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--primary-light);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-manage-courses:hover { background: rgba(124,58,237,0.25); }

.my-courses-empty {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background: var(--card-bg);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius);
}
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.my-courses-empty h3 { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.my-courses-empty p { font-size: 0.88rem; color: var(--muted); margin-bottom: 20px; }

.dashboard-course-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.btn-edit-course {
  display: inline-block;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-edit-course:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ===== UPCOMING COURSES divider inside Live Classes ===== */
.upcoming-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0 22px;
}
.upcoming-divider::before,
.upcoming-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.upcoming-divider span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  white-space: nowrap;
}
.upcoming-courses-grid {
  margin-top: 0;
}

/* ===== MY PROGRESS subsection ===== */
.progress-subsection { margin-bottom: 36px; }
.subsection-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* =====================================================
   TRENDING TOPICS — YouTube Section
   ===================================================== */

/* Search bar */
.yt-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 20px;
}
.yt-search-icon { font-size: 1rem; color: var(--muted); flex-shrink: 0; }
.yt-search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 0.9rem;
  font-family: inherit;
}
.yt-search-bar input::placeholder { color: var(--muted); }
.btn-yt-search {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.btn-yt-search:hover { opacity: 0.88; }

/* Topic chips */
.yt-topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.yt-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.yt-chip:hover { background: rgba(255,255,255,0.09); color: var(--text); }
.yt-chip.active {
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.45);
  color: #f87171;
  font-weight: 700;
}

/* Active label row */
.yt-active-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
#ytTopicTitle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
}
.yt-open-all {
  font-size: 0.78rem;
  color: #f87171;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.yt-open-all:hover { opacity: 0.75; }

/* Video grid */
.yt-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

/* Video card */
.yt-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.yt-card:hover { transform: translateY(-3px); border-color: rgba(239,68,68,0.35); }
.yt-card.playing { border-color: rgba(239,68,68,0.6); }

/* Thumbnail */
.yt-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}
.yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.yt-thumb-wrap:hover .yt-thumb { transform: scale(1.04); }

.yt-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  color: white;
  font-size: 2rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.yt-thumb-wrap:hover .yt-play-btn { opacity: 1; }

.yt-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Iframe */
.yt-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Card body */
.yt-card-body { padding: 14px 16px; }
.yt-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yt-card-channel {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.yt-card-actions { display: flex; gap: 8px; }
.btn-yt-play {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-yt-play:hover { background: rgba(239,68,68,0.28); }
.btn-yt-open {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-yt-open:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* Loading */
.yt-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}
.yt-spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(239,68,68,0.2);
  border-top-color: #ef4444;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Empty */
.yt-empty {
  grid-column: 1/-1;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.yt-empty a { color: #f87171; }

/* =====================================================
   AUTH — Login button, modal, access control
   ===================================================== */

/* Login button in topbar */
.btn-login {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--gradient);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-login:hover { opacity: 0.88; }

/* Logout button */
.btn-logout {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-logout:hover { background: rgba(239,68,68,0.22); }

/* Avatar variants */
.user-avatar { cursor: default; }
.avatar-admin {
  background: linear-gradient(135deg, #ef4444, #f97316) !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.4);
}
.avatar-user {
  background: linear-gradient(135deg, #7c3aed, #2563eb) !important;
}

/* Auth input */
.auth-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  padding: 10px 14px;
  color: var(--white);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.auth-input:focus { border-color: var(--primary-light); }

/* Role selector */
.auth-role-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.auth-role-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  color: var(--muted);
  padding: 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.auth-role-btn:hover { background: rgba(255,255,255,0.09); color: var(--text); }
.auth-role-btn.active {
  background: rgba(124,58,237,0.2);
  border-color: rgba(124,58,237,0.5);
  color: var(--white);
  font-weight: 700;
}
#roleAdmin.active {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  color: #f87171;
}

/* Error */
.auth-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 14px;
}

/* Submit button */
.btn-auth-submit {
  width: 100%;
  background: var(--gradient);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-bottom: 14px;
}
.btn-auth-submit:hover { opacity: 0.88; }

/* Hint */
.auth-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin: 0;
}
.auth-hint strong { color: var(--text); }

/* ===== Social icon buttons in topbar ===== */
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  text-decoration: none;
  transition: all 0.2s;
}
.social-btn:hover { background: rgba(255,255,255,0.12); color: var(--white); transform: translateY(-1px); }
.yt-btn:hover { color: #ef4444; background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); }
.social-btn svg { display: block; }

/* ===== Live thumb image styles ===== */
.live-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.live-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
  z-index: 1;
}

/* ===== Job Ready banner on course cards ===== */
.job-ready-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(14,165,233,0.07));
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 10px;
  padding: 9px 12px;
  margin: 10px 0 12px;
}
.job-ready-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.job-ready-banner strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 1px;
}
.job-ready-banner span {
  font-size: 0.7rem;
  color: var(--muted);
}

/* 4-col → 2-col on smaller screens */
@media (max-width: 1200px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* ===== Dynamic Masterclass Cards ===== */
.mc-thumb {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  height: 160px;
}
.mc-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.65) 100%);
  z-index: 0;
}
.mc-live-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: #ef4444;
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 50px;
  z-index: 2;
  animation: pulse 1.5s infinite;
}
.mc-upcoming-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  z-index: 2;
}
.mc-countdown-wrap {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
}
.mc-countdown {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  font-variant-numeric: tabular-nums;
}
.mc-live-text {
  background: rgba(239,68,68,0.8);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
}
.mc-thumb-title {
  position: relative;
  z-index: 2;
  font-size: 0.82rem;
  font-weight: 700;
  color: white;
  line-height: 1.3;
}
.mc-schedule-row {
  display: flex;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--muted);
  margin: 6px 0 10px;
  flex-wrap: wrap;
}
.mc-join-btn {
  background: linear-gradient(135deg, #ef4444, #f97316) !important;
  animation: pulse 1.5s infinite;
}

/* Live classes empty state */
.lc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.lc-empty-state .empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.4; }
.lc-empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.lc-empty-state p { font-size: 0.88rem; color: var(--muted); }

/* Masterclass registration modal — select + label */
.auth-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.auth-select option {
  background: #1a1a2e;
  color: #fff;
}
.mc-reg-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

/* Our Website button in topbar */
.btn-website {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
  letter-spacing: 0.01em;
}
.btn-website:hover { opacity: 0.88; transform: translateY(-1px); }

/* ============================================================
   MOBILE RESPONSIVE — Full Coverage
   Breakpoints: 1024px | 768px | 640px | 480px | 375px
   ============================================================ */

/* ── 1024px — iPad landscape ─────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; padding: 24px; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .search-bar { width: 240px; }
}

/* ── 768px — iPad portrait ───────────────────────────────── */
@media (max-width: 768px) {
  /* Topbar */
  .topbar { padding: 0 16px; }
  .search-bar { display: none; }
  .topbar-right .social-btn { display: none; }

  /* Sidebar — hidden off-canvas, toggled by hamburger */
  .sidebar {
    position: fixed;
    left: -280px;
    width: 260px;
    top: 64px; bottom: 0;
    z-index: 300;
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  .sidebar.mobile-open { left: 0; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 299;
    top: 64px;
  }
  .sidebar-overlay.active { display: block; }

  /* Show all sidebar labels again (they were hidden at 900px) */
  .nav-item span:not(.nav-icon),
  .nav-section-label,
  .badge,
  .sidebar-cta { display: flex !important; }
  .nav-section-label { display: block !important; }
  .badge { display: inline-flex !important; }
  .sidebar-cta { display: block !important; }

  /* Hamburger button */
  .hamburger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text);
    margin-right: 8px;
  }

  /* Main content full width */
  .main-content { margin-left: 0; padding: 20px 16px; }

  /* Cards */
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .live-grid  { grid-template-columns: 1fr; }

  /* Welcome banner */
  .welcome-banner { flex-direction: column; gap: 20px; }
  .welcome-stats  { flex-wrap: wrap; gap: 12px; }
  .stat-box       { flex: 1; min-width: 80px; }

  /* Modals */
  .modal-box {
    max-width: calc(100vw - 32px) !important;
    margin: 16px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .ai-modules-box,
  .ai-prompt-box { max-width: calc(100vw - 32px) !important; }
}

/* ── 640px — Large phones ────────────────────────────────── */
@media (max-width: 640px) {
  /* Topbar */
  .logo { font-size: 1.1rem; }
  .topbar-right { gap: 8px; }
  .btn-login, .btn-logout { font-size: 0.78rem; padding: 6px 10px; }

  /* Cards single column */
  .cards-grid { grid-template-columns: 1fr; gap: 12px; }
  .yt-video-grid { grid-template-columns: 1fr; }

  /* Section header */
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .filter-tabs { flex-wrap: wrap; gap: 6px; }
  .filter-btn { font-size: 0.75rem; padding: 5px 10px; }

  /* Welcome */
  .welcome-text h1 { font-size: 1.5rem; }
  .welcome-label   { font-size: 0.85rem; }
  .welcome-sub     { font-size: 0.82rem; }

  /* YouTube chips */
  .yt-topic-chips { gap: 6px; }
  .yt-chip { font-size: 0.75rem; padding: 5px 10px; }
  .yt-search-bar { flex-wrap: wrap; gap: 8px; }
  .btn-yt-search { width: 100%; }

  /* Main content */
  .main-content { padding: 16px 12px; }

  /* Subsection header */
  .subsection-header h3 { font-size: 0.95rem; }
}

/* ── 480px — Standard phones ─────────────────────────────── */
@media (max-width: 480px) {
  :root { --topbar-height: 56px; }

  .topbar { height: 56px; padding: 0 12px; }
  .logo   { font-size: 1rem; }

  /* Hide avatar initials text on very small screens */
  .user-avatar { width: 32px; height: 32px; font-size: 0.7rem; }

  /* Cards */
  .master-card .card-thumb { height: 120px; font-size: 2rem; }
  .card-body { padding: 14px; }
  .card-body h3 { font-size: 0.9rem; }
  .card-body p  { font-size: 0.78rem; }
  .card-meta    { font-size: 0.72rem; flex-wrap: wrap; gap: 6px; }

  /* Live card */
  .live-card .live-thumb { height: 160px; }
  .live-body h3 { font-size: 0.95rem; }

  /* Stat boxes */
  .stat-box strong { font-size: 1.4rem; }
  .stat-box span   { font-size: 0.72rem; }

  /* Buttons */
  .btn-enroll, .btn-primary { font-size: 0.82rem; padding: 9px 16px; }

  /* Modal */
  .modal-box { padding: 20px 16px !important; }
  .modal-header h2 { font-size: 1.1rem; }

  /* Section title */
  .section-header h2 { font-size: 1.1rem; }
}

/* ── 375px — Small phones (iPhone SE etc.) ───────────────── */
@media (max-width: 375px) {
  .topbar-right .yt-btn { display: none; }
  .cards-grid { gap: 10px; }
  .main-content { padding: 12px 10px; }
  .welcome-text h1 { font-size: 1.3rem; }
  .card-body { padding: 12px; }
}

/* ── Hamburger button — hidden on desktop ────────────────── */
.hamburger-btn { display: none; }


/* =====================================================
   INTERACTIVE ANIMATIONS — Cards & UI
   ===================================================== */

/* ── Entrance animation: cards fade + slide up on load ── */
@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.master-card, .course-card, .live-card, .story-card {
  animation: cardEntrance 0.45s ease both;
}

/* Stagger each card in a grid */
.cards-grid .master-card:nth-child(1)  { animation-delay: 0.05s; }
.cards-grid .master-card:nth-child(2)  { animation-delay: 0.10s; }
.cards-grid .master-card:nth-child(3)  { animation-delay: 0.15s; }
.cards-grid .master-card:nth-child(4)  { animation-delay: 0.20s; }
.cards-grid .master-card:nth-child(5)  { animation-delay: 0.25s; }
.cards-grid .master-card:nth-child(6)  { animation-delay: 0.30s; }
.cards-grid .master-card:nth-child(7)  { animation-delay: 0.35s; }
.cards-grid .master-card:nth-child(8)  { animation-delay: 0.40s; }
.cards-grid .master-card:nth-child(9)  { animation-delay: 0.45s; }

/* ── Richer hover: lift + glow border ── */
.master-card {
  transition: transform 0.28s cubic-bezier(.22,.68,0,1.2), box-shadow 0.28s ease, border-color 0.28s ease;
  will-change: transform;
}
.master-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 48px rgba(124,58,237,0.25), 0 4px 16px rgba(0,0,0,0.5);
  border-color: rgba(124,58,237,0.45);
}

/* ── Thumb zoom + shimmer on hover ── */
.card-thumb {
  transition: transform 0.35s ease;
  overflow: hidden;
  position: relative;
}
.master-card:hover .card-thumb {
  transform: scale(1.06);
}

/* Shimmer sweep */
.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0s;
}
.master-card:hover .card-thumb::after {
  transform: translateX(100%);
  transition: transform 0.55s ease;
}

/* ── Enroll button pulse on card hover ── */
.master-card .btn-enroll {
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.master-card:hover .btn-enroll {
  background: rgba(16,185,129,0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}

/* ── Price tag pop ── */
.master-card:hover .price-tag {
  background: rgba(250,204,21,0.18);
  border-color: rgba(250,204,21,0.5);
  transform: scale(1.05);
  transition: all 0.2s;
}

/* ── Section fade-in when switching nav ── */
@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.content-section.active {
  animation: sectionFadeIn 0.35s ease both;
}

/* ── Filter button active bounce ── */
.filter-btn {
  transition: all 0.18s cubic-bezier(.22,.68,0,1.4);
}
.filter-btn:active {
  transform: scale(0.93);
}
.filter-btn.active {
  transform: scale(1.04);
}

/* ── Nav item smooth slide indicator ── */
.nav-item {
  transition: background 0.18s, color 0.18s, padding-left 0.18s;
}
.nav-item:hover {
  padding-left: 16px;
}
.nav-item.active {
  padding-left: 16px;
}

/* ── Topbar search focus glow ── */
.search-bar {
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

/* ── Live card pulse border ── */
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.live-card.featured {
  animation: cardEntrance 0.45s ease both, livePulse 2.5s ease-in-out infinite;
}

/* ── Story card hover glow ── */
.story-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.story-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(124,58,237,0.2);
  border-color: rgba(124,58,237,0.3);
}

/* ── Stat box count-up shimmer ── */
.stat-box {
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(124,58,237,0.2);
}

/* =====================================================
   MOBILE OPTIMIZATION — Full responsive overhaul
   ===================================================== */

/* ── Hamburger button ── */
.hamburger-btn {
  display: none;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: background 0.2s;
  z-index: 300;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.12); }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── 768px — Tablets & large phones ── */
@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger-btn { display: flex; }

  /* Sidebar slides in from left */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    z-index: 200;
    width: var(--sidebar-width) !important;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  /* Show all nav labels when open */
  .sidebar.mobile-open .nav-item span:not(.nav-icon),
  .sidebar.mobile-open .nav-section-label,
  .sidebar.mobile-open .badge,
  .sidebar.mobile-open .sidebar-cta { display: flex; }
  .sidebar.mobile-open .nav-section-label { display: flex; }
  .sidebar.mobile-open .sidebar-cta { display: block; }

  /* Main content full width */
  .main-content { margin-left: 0 !important; padding: 16px; }

  /* Topbar */
  .topbar { padding: 0 12px; gap: 8px; }
  .search-bar { width: 160px; }
  .search-bar input { font-size: 0.82rem; }

  /* Hide website button on mobile */
  .btn-website { display: none; }

  /* Logo size */
  .logo-img { height: 52px !important; }

  /* Cards 2 col on tablet */
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Welcome banner */
  .welcome-banner { padding: 20px; flex-direction: column; }
  .welcome-text h1 { font-size: 1.6rem; }
  .welcome-stats { gap: 10px; }
  .stat-box { padding: 12px 16px; min-width: 80px; }
  .stat-box strong { font-size: 1.3rem; }

  /* Section header */
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .filter-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-tabs::-webkit-scrollbar { height: 3px; }
  .filter-btn { white-space: nowrap; flex-shrink: 0; }

  /* Live grid */
  .live-grid { grid-template-columns: 1fr; }

  /* Stories */
  .stories-grid { grid-template-columns: 1fr; }
  .story-card.featured-story { grid-column: span 1; }

  /* Cards row */
  .cards-row { grid-template-columns: 1fr; }

  /* Topbar right — compact */
  .topbar-right { gap: 6px; }
  .social-btn { display: none; }
}

/* ── 480px — Phones ── */
@media (max-width: 480px) {
  /* Topbar */
  :root { --topbar-height: 60px; }
  .topbar { height: 60px; }
  .logo-img { height: 44px !important; }
  .search-bar { display: none; } /* hide search on small phones, use section search */

  /* Cards single column */
  .cards-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Card body */
  .card-thumb { height: 130px; font-size: 2.2rem; }
  .card-body { padding: 12px; }
  .card-body h3 { font-size: 0.92rem; }
  .card-body p { font-size: 0.8rem; margin-bottom: 10px; }
  .card-meta { font-size: 0.72rem; gap: 6px; }
  .btn-enroll { font-size: 0.8rem; padding: 8px 14px; }

  /* Welcome */
  .welcome-banner { padding: 16px; border-radius: 12px; }
  .welcome-text h1 { font-size: 1.35rem; }
  .welcome-sub { font-size: 0.8rem; }
  .welcome-stats { justify-content: space-between; }
  .stat-box { flex: 1; min-width: 0; padding: 10px 8px; text-align: center; }
  .stat-box strong { font-size: 1.2rem; }
  .stat-box span { font-size: 0.68rem; }

  /* Section header */
  .section-header h2 { font-size: 1.1rem; }

  /* Modal */
  .modal-box { padding: 18px 14px !important; border-radius: 14px; }
  .modal-header h2 { font-size: 1.05rem; }
  .modal-tabs { gap: 4px; }
  .modal-tab { font-size: 0.82rem; padding: 8px; }

  /* Auth inputs */
  .auth-input { font-size: 0.85rem; padding: 9px 12px; }
  .btn-auth-submit { font-size: 0.88rem; padding: 11px; }

  /* Signup country select */
  #signup_country { width: 110px !important; font-size: 0.78rem; }

  /* Live card */
  .live-card .live-thumb { height: 140px; }
  .live-body { padding: 14px; }
  .live-body h3 { font-size: 0.92rem; }
  .live-actions { flex-direction: column; }
  .btn-join, .btn-remind { width: 100%; text-align: center; }

  /* Price tag */
  .price-tag { font-size: 0.78rem; }

  /* Subsection header */
  .subsection-header h3 { font-size: 0.9rem; }

  /* B2B CTA sidebar — hide on mobile */
  .sidebar-cta { display: none !important; }

  /* Topbar right */
  .btn-logout { font-size: 0.75rem; padding: 6px 10px; }
  .user-avatar { width: 32px; height: 32px; font-size: 0.68rem; }
}

/* ── 375px — Small phones ── */
@media (max-width: 375px) {
  .cards-grid { gap: 8px; }
  .main-content { padding: 10px 8px; }
  .welcome-text h1 { font-size: 1.2rem; }
  .card-body h3 { font-size: 0.88rem; }
  .section-header h2 { font-size: 1rem; }
  .filter-btn { font-size: 0.72rem; padding: 5px 8px; }
}

/* ── Touch improvements ── */
@media (hover: none) {
  /* Remove hover animations on touch devices */
  .master-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--card-border);
  }
  .master-card:active {
    transform: scale(0.98);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  }
  .nav-item:hover { padding-left: 12px; }
  .btn-enroll:hover { background: rgba(16,185,129,0.15); transform: none; }
}

/* ── Bottom nav for mobile (optional sticky nav) ── */
@media (max-width: 480px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--card-border);
    z-index: 150;
    padding: 8px 0 env(safe-area-inset-bottom, 8px);
  }
  .mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.62rem;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.15s;
  }
  .mobile-bottom-nav a.active { color: var(--primary-light); }
  .mobile-bottom-nav a span:first-child { font-size: 1.2rem; }
  /* Push main content up to avoid overlap */
  .main-content { padding-bottom: 70px; }
}
