/* ==========================================================================
   CS REVOLT - COMPONENTS STYLESHEET
   Catalog, Video Player, Udemy-style Sidebar, Discussion Forum, Modals
   ========================================================================== */

/* ================= HERO SECTION ================= */
.hero-section {
  padding: 44px 0 28px 0;
  position: relative;
}

.hero-card {
  background: linear-gradient(135deg, rgba(14, 25, 48, 0.85), rgba(7, 13, 30, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

body[data-theme="light"] .hero-card {
  background: linear-gradient(135deg, #ffffff, #f0f5ff);
  border: 1px solid rgba(31, 181, 245, 0.25);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(31, 181, 245, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 20%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(247, 147, 30, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.hero-title .gradient-cyan {
  background: linear-gradient(135deg, var(--brand-cyan), #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title .gradient-orange {
  background: linear-gradient(135deg, var(--brand-orange), #ffb703);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.hero-stats-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-pill strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.hero-logo-showcase {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-logo-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: contain;
  aspect-ratio: 1 / 1;
  display: block;
  background: transparent;
  border: 3px solid var(--brand-cyan);
  box-shadow: 0 0 35px rgba(31, 181, 245, 0.4), 0 0 50px rgba(247, 147, 30, 0.2);
  animation: float-logo 6s ease-in-out infinite;
}

@keyframes float-logo {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

/* ================= PAPER TABS (GATE CSE & GATE DA) ================= */
.tabs-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 28px 0;
  flex-wrap: wrap;
}

.paper-tabs-group {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px;
  box-shadow: var(--shadow-sm);
  gap: 6px;
}

.paper-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
}

.paper-tab .tab-icon {
  font-size: 1.2rem;
}

.paper-tab .count-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
}

.paper-tab.active.tab-cse {
  background: linear-gradient(135deg, rgba(31, 181, 245, 0.2), rgba(0, 119, 255, 0.25));
  border: 1px solid var(--brand-cyan);
  color: var(--brand-cyan);
  box-shadow: 0 0 20px rgba(31, 181, 245, 0.25);
}

.paper-tab.active.tab-da {
  background: linear-gradient(135deg, rgba(247, 147, 30, 0.2), rgba(255, 77, 0, 0.25));
  border: 1px solid var(--brand-orange);
  color: var(--brand-orange);
  box-shadow: 0 0 20px rgba(247, 147, 30, 0.25);
}

.paper-tab:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* Search and Filters */
.catalog-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  width: 260px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--brand-cyan);
  box-shadow: 0 0 15px rgba(31, 181, 245, 0.25);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ================= COURSE SUBJECT CARDS GRID ================= */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 24px;
  margin-bottom: 50px;
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.subject-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand-cyan);
  box-shadow: var(--shadow-md), 0 0 25px rgba(31, 181, 245, 0.18);
}

.subject-card.accent-orange:hover {
  border-color: var(--brand-orange);
  box-shadow: var(--shadow-md), 0 0 25px rgba(247, 147, 30, 0.2);
}

/* Card Header & Dynamic Thumbnail */
.card-thumbnail-header {
  height: 140px;
  position: relative;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.card-thumbnail-header.cyan-gradient {
  background: linear-gradient(135deg, #071936, #0e305e);
  border-bottom: 2px solid var(--brand-cyan);
}

.card-thumbnail-header.orange-gradient {
  background: linear-gradient(135deg, #271408, #5e280c);
  border-bottom: 2px solid var(--brand-orange);
}

/* Ambient Circuit lines in thumbnail */
.card-thumbnail-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(31, 181, 245, 0.25), transparent 60%);
  pointer-events: none;
}

.card-thumbnail-header.orange-gradient::before {
  background: radial-gradient(circle at top right, rgba(247, 147, 30, 0.3), transparent 60%);
}

.card-icon-bubble {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(6, 11, 24, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.subject-code-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(6, 11, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  z-index: 2;
}

/* Card Body */
.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-badge-row {
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Metrics */
.card-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-metric-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-metric-item strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Progress bar inside card */
.card-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-orange));
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Admin Card Actions Overlay */
.admin-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  bottom: 16px;
  right: 16px;
  opacity: 0;
  transition: var(--transition);
  z-index: 10;
}

.subject-card:hover .admin-card-actions {
  opacity: 1;
}

/* Add New Subject Card (for Admin) */
.add-subject-card {
  border: 2px dashed var(--border-strong);
  background: rgba(14, 25, 48, 0.3);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  text-align: center;
  padding: 30px;
  cursor: pointer;
  transition: var(--transition);
}
.add-subject-card:hover {
  border-color: var(--brand-cyan);
  background: rgba(31, 181, 245, 0.06);
  transform: translateY(-4px);
}

.add-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(31, 181, 245, 0.1);
  border: 1px solid var(--brand-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--brand-cyan);
  margin-bottom: 12px;
  transition: var(--transition);
}
.add-subject-card:hover .add-icon-circle {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(31, 181, 245, 0.4);
}

/* ================= COURSE PLAYER & LEARNING VIEW ================= */
.player-view-container {
  display: none; /* toggled active via JS */
  padding-top: 20px;
  padding-bottom: 60px;
}

.player-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb-link {
  color: var(--brand-cyan);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(31, 181, 245, 0.05);
  border: 1px solid rgba(31, 181, 245, 0.15);
  transition: var(--transition);
}
.breadcrumb-link:hover {
  text-decoration: none;
  color: #ffffff;
  background: rgba(31, 181, 245, 0.18);
  border-color: var(--brand-cyan);
  box-shadow: 0 0 12px rgba(31, 181, 245, 0.35);
  transform: translateY(-1px);
}

.breadcrumb-current-topic {
  color: #ffffff;
  font-weight: 700;
  background: rgba(247, 147, 30, 0.12);
  border-color: rgba(247, 147, 30, 0.3);
  color: var(--brand-orange);
}
.breadcrumb-current-topic:hover {
  background: rgba(247, 147, 30, 0.22);
  border-color: var(--brand-orange);
  box-shadow: 0 0 12px rgba(247, 147, 30, 0.4);
  color: #ffffff;
}

.breadcrumb-sep {
  opacity: 0.5;
  color: var(--text-muted);
}

/* Subject Card Highlight Glow when navigating via breadcrumbs or search */
@keyframes subjectCardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 181, 245, 0.8), 0 12px 28px rgba(0, 0, 0, 0.4);
    border-color: var(--brand-cyan);
    transform: scale(1.03);
  }
  50% {
    box-shadow: 0 0 28px 6px rgba(31, 181, 245, 0.5), 0 12px 28px rgba(0, 0, 0, 0.4);
    border-color: var(--brand-cyan);
    transform: scale(1.03);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 181, 245, 0), 0 12px 28px rgba(0, 0, 0, 0.4);
    border-color: var(--border-subtle);
    transform: scale(1);
  }
}
.subject-card-highlighted {
  animation: subjectCardPulse 2.5s ease-out;
  border-color: var(--brand-cyan) !important;
}

/* Video Player Focus Pulse */
@keyframes videoFocusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 181, 245, 0.8);
    border-color: var(--brand-cyan);
  }
  50% {
    box-shadow: 0 0 35px 8px rgba(31, 181, 245, 0.6);
    border-color: var(--brand-cyan);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 181, 245, 0);
  }
}
.video-player-container.focus-pulse {
  animation: videoFocusPulse 1.8s ease-out;
}

/* ================= AUTH LOCKED BLUR SHIELD ================= */
body.auth-locked #catalogView,
body.auth-locked #playerView,
body.auth-locked .app-footer,
body.auth-locked .app-header,
body.auth-locked #adminFloatingBar {
  filter: blur(16px) brightness(0.8);
  pointer-events: none;
  user-select: none;
  transition: filter 0.35s ease;
}

/* ================= ADMIN FLOATING BAR ================= */
.admin-floating-bar {
  background: linear-gradient(90deg, #18223c, #1f1105);
  border-bottom: 1px solid var(--border-orange);
  padding: 10px 0;
  transition: var(--transition);
}

.admin-floating-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-floating-bar .admin-bar-desc {
  font-size: 0.8rem;
  color: #94a3b8;
}

.admin-floating-bar .btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 600;
}

.admin-floating-bar .btn-outline:hover {
  background: rgba(31, 181, 245, 0.2);
  color: var(--brand-cyan);
  border-color: var(--brand-cyan);
}

/* Admin Floating Bar - LIGHT THEME (Fix for Backup/Restore JSON text visibility) */
body[data-theme="light"] .admin-floating-bar {
  background: linear-gradient(90deg, #e8f2fe, #fff5eb);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

body[data-theme="light"] .admin-floating-bar .admin-bar-desc {
  color: #334155;
  font-weight: 500;
}

body[data-theme="light"] .admin-floating-bar .btn-outline {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  font-weight: 700 !important;
}

body[data-theme="light"] .admin-floating-bar .btn-outline:hover {
  background: #f0f9ff !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
}

/* ================= POSTING IDENTITY BADGE ================= */
.posting-identity-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
}

/* While signed out, the sign-in screen IS the page: it sits in the normal flow so the browser
   scrolls the document itself (which keeps pull-to-refresh working on phones). Everything else
   is lifted out of the flow and hidden, so there is nothing behind it to scroll to. */
body.auth-locked > :not(#loginModalOverlay):not(#toastNotice):not(script) {
  position: fixed !important;
  inset: 0;
  visibility: hidden !important;
  pointer-events: none;
  overflow: hidden;
}

body.auth-locked #loginModalOverlay {
  overscroll-behavior: auto; /* lets a pull-down at the top reach the browser: pull-to-refresh */
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.player-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

/* Main Video Section (Left) */
.video-main-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.video-frame-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(31, 181, 245, 0.15);
  border: 1px solid var(--border-subtle);
}

.video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Holds the lecture iframe; fills the 16:9 frame, or floats as the mini player (js/player.js) */
.video-stage {
  position: absolute;
  inset: 0;
}
.video-stage[hidden] {
  display: none;
}
.mini-player-bar {
  display: none;
}

/* ================= MINI PLAYER ================= */
/* The lecture keeps playing in the corner while the student browses other pages, a PDF or a quiz.
   The iframe never moves in the DOM (that would reload it); its box is just pinned to the screen. */
.video-stage.is-mini {
  position: fixed;
  inset: auto auto 16px 16px;
  z-index: 9000;
  width: clamp(260px, 30vw, 400px);
  display: flex;
  flex-direction: column;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 40px rgba(6, 11, 24, 0.45);
  visibility: visible;
  animation: miniPlayerIn 0.25s ease-out;
}
@keyframes miniPlayerIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .video-stage.is-mini { animation: none; }
}
.video-stage.is-mini .mini-player-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 12px;
  background: #0b1426;
  color: #e8f1ff;
}
.mini-player-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
}
.mini-player-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.mini-player-btn:hover,
.mini-player-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}
.video-stage.is-mini .video-iframe {
  position: static;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}
/* Lesson page left behind while its lecture plays in the mini player: kept mounted so the iframe
   keeps playing, but takes no space and shows nothing except the mini player */
#playerView.is-away {
  display: block !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  padding: 0;
  overflow: visible;
  visibility: hidden;
}
body.auth-locked .video-stage.is-mini {
  visibility: hidden;
}
@media (max-width: 640px) {
  .video-stage.is-mini {
    inset: auto auto 12px 12px;
    width: min(260px, calc(100vw - 88px));
  }
}

/* Topic Header & Video Controls */
.video-info-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.video-info-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.topic-title-main {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
}

.topic-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-complete {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  transition: var(--transition);
}
.btn-complete:hover {
  border-color: #10b981;
  color: #10b981;
}

.btn-complete.is-completed {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

/* Navigation between previous and next topic (Udemy-style) */
.topic-nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
  gap: 12px;
}

.nav-topic-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  max-width: 45%;
}
.nav-topic-btn:hover:not(:disabled) {
  border-color: var(--brand-cyan);
  background: rgba(31, 181, 245, 0.08);
  color: var(--brand-cyan);
  transform: translateY(-1px);
}
.nav-topic-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-topic-btn .nav-btn-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
}
.nav-topic-btn.next-btn .nav-btn-meta {
  text-align: right;
}

.nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.nav-title-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  max-width: 190px;
}

/* Video Description Collapsible Area */
.video-description-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
}

.section-subhead {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.desc-content {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.desc-content h3 {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 14px 0 6px 0;
}

.desc-content ul {
  padding-left: 20px;
  margin: 8px 0;
}

.desc-content li {
  margin-bottom: 6px;
}

.desc-content strong {
  color: var(--text-primary);
}

.desc-content code {
  background: rgba(31, 181, 245, 0.1);
  color: var(--brand-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ================= PLAYER MOBILE NAV TABS ================= */
.player-mobile-nav {
  display: none;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
  margin: 14px 0 12px 0;
  box-shadow: var(--shadow-sm);
}

.player-tab-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  min-height: 40px;
}

.player-tab-pill:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.player-tab-pill.active {
  background: linear-gradient(135deg, rgba(31, 181, 245, 0.2), rgba(0, 119, 255, 0.25));
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
  box-shadow: 0 0 14px rgba(31, 181, 245, 0.25);
}

.player-tab-pill .pill-badge {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

.player-tab-pill.active .pill-badge {
  background: var(--brand-cyan);
  color: #040914;
  font-weight: 700;
}

/* ================= UDEMY-STYLE SIDEBAR SYLLABUS ================= */
.syllabus-sidebar {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--header-height) + 16px);
  max-height: calc(100vh - var(--header-height) - 32px);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.sidebar-course-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.sidebar-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-orange));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Chapters & Topics Accordion */
.sidebar-content-scroll {
  overflow-y: auto;
  flex: 1;
}

.syllabus-chapter {
  border-bottom: 1px solid var(--border-subtle);
}

.chapter-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
  user-select: none;
}
.chapter-header:hover {
  background: rgba(31, 181, 245, 0.05);
}

.chapter-title-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}

.chapter-meta-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.chapter-toggle-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.syllabus-chapter.collapsed .chapter-topics-list {
  display: none;
}

.syllabus-chapter.collapsed .chapter-toggle-icon {
  transform: rotate(-90deg);
}

/* Topic item inside sidebar */
.chapter-topics-list {
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-topic-item {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: var(--transition);
}

.sidebar-topic-item:hover {
  background: rgba(31, 181, 245, 0.08);
}

.sidebar-topic-item.active {
  background: rgba(31, 181, 245, 0.12);
  border-left-color: var(--brand-cyan);
}

.sidebar-topic-item.active .topic-item-title {
  color: var(--brand-cyan);
  font-weight: 600;
}

.topic-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.topic-status-check {
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.topic-status-check.completed {
  color: #10b981;
}

.topic-item-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-item-duration {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ================= DISCUSSION FORUM ================= */
.discussion-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-top: 24px;
}

.discussion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.discussion-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Post New Question Card */
.post-question-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 28px;
}

.question-input-title {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.question-input-title:focus {
  outline: none;
  border-color: var(--brand-cyan);
}

.question-textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  resize: vertical;
  line-height: 1.5;
  margin-bottom: 12px;
}
.question-textarea:focus {
  outline: none;
  border-color: var(--brand-cyan);
}

.question-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Question List */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.question-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}
.question-item:hover {
  border-color: rgba(31, 181, 245, 0.25);
}

.question-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.user-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-bubble {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(31, 181, 245, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 1px solid var(--brand-cyan);
}

.author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.post-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.question-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.question-footer-bar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upvote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: var(--transition);
}
.upvote-btn:hover {
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}

.reply-toggle-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.reply-toggle-btn:hover {
  color: var(--brand-cyan);
}

/* Nested Replies List */
.replies-container {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  padding-left: 20px;
  border-left: 2px solid rgba(31, 181, 245, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reply-item {
  background: rgba(255, 255, 255, 0.015);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.reply-content {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.reply-input-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.reply-input-text {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
}
.reply-input-text:focus {
  outline: none;
  border-color: var(--brand-cyan);
}

/* ================= "BUY ME A COFFEE" MODAL ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-orange);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  margin: auto;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(247, 147, 30, 0.25);
  overflow: hidden;
  position: relative;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card .modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
}

@keyframes slideUp {
  from { transform: translateY(20px) scale(0.96); }
  to { transform: translateY(0) scale(1); }
}

.modal-header-coffee {
  background: linear-gradient(135deg, #2b1805, #5a300a);
  padding: 14px 20px;
  text-align: center;
  border-bottom: 2px solid #d97706;
  position: relative;
  flex-shrink: 0;
}

.coffee-cup-icon {
  font-size: 2.2rem;
  margin-bottom: 2px;
  animation: wiggle 2s infinite ease-in-out;
  display: inline-block;
  line-height: 1;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg); }
  75% { transform: rotate(6deg); }
}

.modal-title-coffee {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.modal-sub-coffee {
  font-size: 0.76rem;
  color: #fcd34d;
  margin-top: 2px;
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close-btn:hover {
  background: #ff4d4d;
}

.modal-body {
  padding: 16px 20px;
}

/* Coffee Tiers */
.coffee-tiers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 440px) {
  .coffee-tiers-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tier-choice-btn {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-input);
}
.tier-choice-btn:hover {
  border-color: var(--brand-orange);
  background: rgba(247, 147, 30, 0.08);
}
.tier-choice-btn.selected {
  border-color: var(--brand-orange);
  background: rgba(247, 147, 30, 0.15);
  box-shadow: 0 0 14px rgba(247, 147, 30, 0.3);
}

.tier-price {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-orange);
}

.tier-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
}

/* UPI Copy Card */
.upi-copy-container {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.upi-id-code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-cyan);
}

/* QR Code Display */
.qr-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  background: #ffffff;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.qr-preview-img {
  width: 140px;
  height: 140px;
  display: block;
  margin-top: 4px;
}
.qr-preview-img svg {
  width: 100%;
  height: 100%;
  display: block;
}
.qr-preview-fallback {
  height: auto;
  object-fit: contain;
}

.qr-caption {
  font-size: 0.7rem;
  font-weight: 700;
  color: #060b18;
  margin-top: 3px;
}

.qr-verify-note {
  font-size: 0.66rem;
  color: #374151;
  text-align: center;
  margin-top: 2px;
  line-height: 1.3;
}
.qr-verify-note strong {
  white-space: nowrap;
}

/* Contributor Wall / Message */
.coffee-cheer-message {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
}

/* ================= ADMIN CMS MODALS ================= */
.admin-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: auto;
}

.admin-modal-card .modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
  flex: 1;
}

.admin-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(31, 181, 245, 0.04);
  flex-shrink: 0;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--brand-cyan);
  box-shadow: 0 0 10px rgba(31, 181, 245, 0.2);
}

textarea.form-control {
  min-height: 110px;
  line-height: 1.5;
}

.form-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Narrow screens: stack the buttons full-width so none gets clipped (e.g. MFA Cancel) */
@media (max-width: 520px) {
  .form-actions-row {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .form-actions-row .btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }
}

/* ================= TOAST NOTIFICATION ================= */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--brand-cyan);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(31, 181, 245, 0.3);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* ================= USER PROFILE NAV & DROPDOWN ================= */
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.user-profile-widget:hover {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 12px rgba(31, 181, 245, 0.2);
}

.user-avatar-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(31, 181, 245, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.user-name-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 1000;
  display: none;
  animation: fadeIn 0.18s ease;
}
.profile-dropdown-menu.active {
  display: block;
}

.dropdown-header {
  padding: 8px 10px;
}
.dropdown-user-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.dropdown-user-email {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.dropdown-user-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-cyan);
  text-transform: uppercase;
  margin-top: 4px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

.dropdown-item-btn {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.dropdown-item-btn:hover {
  background: rgba(31, 181, 245, 0.08);
  color: var(--brand-cyan);
}
.dropdown-item-btn.logout-btn:hover {
  background: rgba(255, 77, 77, 0.1);
  color: #ff4d4d;
}

/* ================= AUTH / LOGIN MODAL ================= */
.auth-modal-card {
  max-width: 440px;
  width: calc(100% - 24px);
  margin: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 25px rgba(31, 181, 245, 0.2);
}

.modal-header-auth {
  padding: 24px 24px 16px 24px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-modal-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: contain;
  aspect-ratio: 1 / 1;
  display: block;
  background: transparent;
  margin: 0 auto 12px auto;
  border: 2px solid var(--brand-cyan);
  box-shadow: 0 0 20px rgba(31, 181, 245, 0.4);
}

.auth-modal-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.auth-modal-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-tabs-row {
  display: none !important;
}

.auth-tab-btn {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}
.auth-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
#authTabStudent.active {
  color: var(--brand-cyan);
  border: 1px solid rgba(31, 181, 245, 0.3);
}
#authTabAdmin.active {
  color: var(--brand-orange);
  border: 1px solid rgba(247, 147, 30, 0.3);
}

.demo-auth-box {
  margin-top: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
}

/* ================= SITE FOOTER ================= */
.app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  position: relative;
  margin-top: 60px;
  overflow: hidden;
}

.footer-top-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-orange), var(--brand-gold));
  width: 100%;
}

.footer-main-content {
  padding: 56px 24px 40px 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-brand-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 360px;
}

.footer-social-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 7px 14px;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  position: relative;
  display: inline-block;
}

.footer-col-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 28px;
  height: 2px;
  background: var(--brand-cyan);
  border-radius: 1px;
}

.footer-links-col:nth-child(3) .footer-col-title::after {
  background: var(--brand-orange);
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav-list a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-nav-list a:hover {
  color: var(--brand-cyan);
  transform: translateX(3px);
}

.footer-bottom-bar {
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
  padding: 18px 0;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-copy-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-tagline-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ================= MODAL VIDEO LIVE PREVIEW ================= */
.modal-video-preview {
  margin-top: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(31, 181, 245, 0.3);
}
.modal-video-box {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
}
.modal-video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.modal-video-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(31, 181, 245, 0.1);
  font-size: 0.75rem;
  color: var(--brand-cyan);
  font-weight: 600;
}

/* ================= ADMIN TOPIC HOVER ACTIONS ================= */
.sidebar-topic-item {
  position: relative;
}
.sidebar-topic-admin-actions {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding-left: 6px;
}
.sidebar-topic-item:hover .sidebar-topic-admin-actions {
  display: flex;
}
.sidebar-topic-admin-actions .btn-icon {
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  padding: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= QUERIES & DOUBTS RESOLUTION HUB ================= */
.queries-view-container {
  padding-top: 20px;
  padding-bottom: 60px;
}
.queries-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.filter-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.filter-pill:hover {
  border-color: var(--brand-cyan);
  color: var(--text-primary);
}
.filter-pill.active {
  background: rgba(31, 181, 245, 0.18);
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
  box-shadow: 0 0 10px rgba(31, 181, 245, 0.25);
}

.queries-feed-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.queries-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.queries-empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 6px;
}

.query-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid #10b981;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.query-card.is-unanswered {
  border-left-color: #f59e0b;
}
.query-card.is-open {
  box-shadow: var(--shadow-md);
}

/* Collapsed row: question, who asked it, where */
.query-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.query-summary-main {
  flex: 1 1 auto;
  min-width: 0;
}
.query-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.query-meta .badge {
  margin-right: 4px;
}
.query-author {
  font-weight: 700;
  color: var(--text-primary);
}
.query-meta-sep {
  opacity: 0.5;
}
.query-question-text {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.55;
  margin: 0 0 10px;
  white-space: pre-line;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.query-card.is-open .query-question-text {
  display: block;
  overflow: visible;
}
.query-context-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.query-paper-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
  margin-right: 4px;
}
.query-paper-tag.cse {
  color: var(--brand-cyan);
}
.query-paper-tag.da {
  color: var(--brand-orange);
}
.query-topic-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--brand-cyan);
  cursor: pointer;
  text-align: left;
}
.query-topic-link:hover {
  text-decoration: underline;
}
.query-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.query-actions .btn-toggle-query {
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.query-actions .btn-delete-hub-query {
  padding: 0;
  color: #ef4444;
  width: 34px;
  height: 34px;
  opacity: 0.6;
}
.query-actions .btn-delete-hub-query:hover {
  opacity: 1;
}

/* Expanded: student details, thread, reply box */
.query-details {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.query-card.is-open .query-details {
  display: block;
}
.query-details-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.query-muted {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Thread tree: question at the root, replies and the answer box as branches */
.query-tree {
  --tree-line: var(--border-strong);
}
.tree-root {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.tree-avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(31, 181, 245, 0.12);
  border: 2px solid var(--tree-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  overflow: hidden;
}
.tree-root-text a {
  font-size: 0.8rem;
  color: var(--brand-cyan);
  text-decoration: underline;
  overflow-wrap: anywhere;
}
.tree-children {
  list-style: none;
  margin: 0 0 0 13px;
  padding: 0;
}
.tree-node {
  position: relative;
  padding: 12px 0 0 30px;
}
/* Trunk running down from the question */
.tree-node::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 2px solid var(--tree-line);
}
/* Branch from the trunk to this reply */
.tree-node::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 32px;
  border-bottom: 2px solid var(--tree-line);
}
.tree-node:last-child::before {
  display: none;
}
.tree-node:last-child::after {
  border-left: 2px solid var(--tree-line);
  border-bottom-left-radius: 10px;
}
.tree-node.is-admin::after {
  border-bottom-color: var(--brand-orange);
}
.tree-node-empty {
  padding-top: 22px;
}
.tree-step {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
}
.chain-reply-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.chain-reply-item.is-admin {
  background: rgba(247, 147, 30, 0.08);
  border-color: rgba(247, 147, 30, 0.3);
}
.chain-reply-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.82rem;
  color: var(--text-primary);
}
.chain-reply-header .badge {
  font-size: 0.65rem;
  padding: 2px 6px;
}
.chain-reply-time {
  margin-left: auto;
  font-size: 0.74rem;
  color: var(--text-secondary);
}
.chain-reply-body {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.instructor-reply-box {
  background: var(--bg-card);
  border: 1px dashed var(--border-orange);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.instructor-reply-textarea {
  width: 100%;
  min-height: 96px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}
.instructor-reply-textarea:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 10px rgba(247, 147, 30, 0.25);
}
.instructor-reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.instructor-reply-actions .btn {
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .query-card {
    padding: 14px;
  }
  .query-summary {
    flex-direction: column;
    gap: 12px;
  }
  .query-actions {
    width: 100%;
  }
  .query-actions .btn-toggle-query {
    flex: 1 1 auto;
  }
  .instructor-reply-actions .btn {
    width: 100%;
  }
}

/* ================= COMPREHENSIVE RESPONSIVE MEDIA QUERIES ================= */

/* TABLETS & SMALL LAPTOPS (<= 1024px) */
@media (max-width: 1024px) {
  .player-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Show mobile tab switcher */
  .player-mobile-nav {
    display: flex;
  }

  /* Tabbed visibility in player view for smooth mobile learning */
  .player-layout:not([data-active-tab="notes"]):not([data-active-tab="doubts"]) .syllabus-sidebar {
    display: flex;
    order: 1;
    position: static;
    max-height: 520px;
    margin-bottom: 20px;
  }
  .player-layout:not([data-active-tab="notes"]):not([data-active-tab="doubts"]) #playerNotesBox,
  .player-layout:not([data-active-tab="notes"]):not([data-active-tab="doubts"]) .supportive-coffee-banner,
  .player-layout:not([data-active-tab="notes"]):not([data-active-tab="doubts"]) #discussionsContainer {
    display: none;
  }

  /* Notes tab active */
  .player-layout[data-active-tab="notes"] .syllabus-sidebar {
    display: none;
  }
  .player-layout[data-active-tab="notes"] #playerNotesBox,
  .player-layout[data-active-tab="notes"] .supportive-coffee-banner {
    display: block;
  }
  .player-layout[data-active-tab="notes"] #discussionsContainer {
    display: none;
  }

  /* Doubts tab active */
  .player-layout[data-active-tab="doubts"] .syllabus-sidebar {
    display: none;
  }
  .player-layout[data-active-tab="doubts"] #playerNotesBox,
  .player-layout[data-active-tab="doubts"] .supportive-coffee-banner {
    display: none;
  }
  .player-layout[data-active-tab="doubts"] #discussionsContainer {
    display: block;
  }

  /* Footer 2-columns on tablets */
  .footer-main-content {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 20px 32px;
  }
}

/* SMARTPHONES & TABLETS IN PORTRAIT (<= 768px) */
@media (max-width: 768px) {
  /* Header adjustments */
  .header-actions .yt-link-badge span {
    display: none;
  }
  .user-profile-widget .user-name-text,
  .user-profile-widget #userRoleBadgeDisplay {
    display: none;
  }
  .user-profile-widget {
    padding: 3px 6px;
    gap: 4px;
  }
  .profile-dropdown-menu {
    right: 0;
    max-width: calc(100vw - 24px);
    width: 230px;
  }

  /* Admin floating bar */
  .admin-floating-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .admin-bar-desc {
    display: none;
  }
  .admin-floating-bar-inner > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .admin-floating-bar-inner .btn {
    flex: 1 1 auto;
    font-size: 0.74rem;
    padding: 6px 10px;
  }

  /* Hero section */
  .hero-card {
    padding: 24px 20px;
  }
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .hero-logo-showcase {
    order: -1;
  }
  .hero-logo-img {
    width: 90px;
    height: 90px;
  }
  .hero-title {
    font-size: 1.8rem;
    line-height: 1.25;
  }
  .hero-desc {
    font-size: 0.92rem;
    text-align: center;
    margin: 0 auto 16px;
  }
  .hero-badge-row,
  .hero-stats-row {
    justify-content: center;
  }

  /* Tabs & search controls */
  .tabs-control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 8px 0 20px;
  }
  .paper-tabs-group {
    width: 100%;
    display: flex;
    justify-content: stretch;
    padding: 4px;
    gap: 4px;
    box-sizing: border-box;
  }
  .paper-tab {
    flex: 1;
    justify-content: center;
    padding: 9px 12px;
    font-size: 0.88rem;
    text-align: center;
  }
  .catalog-tools {
    width: 100%;
  }
  .search-box {
    width: 100%;
  }

  /* Course cards grid */
  .subjects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 36px;
  }

  /* Breadcrumbs */
  .player-breadcrumb-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }
  .breadcrumb-list {
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.5;
  }
  .breadcrumb-link {
    font-size: 0.78rem;
    padding: 2px 7px;
  }
  #adminTopicActions {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }
  #adminTopicActions .btn {
    flex: 1 1 auto;
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  /* Topic video info & navigation */
  .video-info-box {
    padding: 18px 16px;
  }
  .topic-title-main {
    font-size: 1.3rem;
  }
  .nav-title-preview {
    display: none;
  }
  .topic-nav-controls {
    gap: 8px;
  }
  .nav-topic-btn {
    flex: 1;
    max-width: 50%;
    min-height: 44px;
    padding: 8px 12px;
    justify-content: center;
  }

  /* Discussion forum */
  .discussion-section {
    padding: 18px 14px;
  }
  .post-question-card {
    padding: 16px 12px;
    margin-bottom: 20px;
  }
  .question-item {
    padding: 16px 12px;
  }
  .replies-container {
    padding-left: 12px;
    border-left-width: 2px;
    margin-top: 12px;
  }
  .reply-input-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .reply-input-row .btn {
    width: 100%;
  }

  /* Admin doubts resolution hub */
  .queries-header-card {
    padding: 18px 16px;
  }
  .queries-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .queries-filter-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .filter-pill {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* MOBILE PHONES (<= 600px) */
@media (max-width: 600px) {
  /* Subjects cards grid full width single column */
  .subjects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Footer single column collapse */
  .footer-main-content {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 16px 24px;
  }
  .footer-brand-desc {
    max-width: 100%;
  }
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .footer-tagline-badges {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* COMPACT SMARTPHONES (<= 480px) */
@media (max-width: 480px) {
  /* Hero typography & spacing */
  .hero-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }
  .hero-logo-img {
    width: 76px;
    height: 76px;
  }
  .hero-title {
    font-size: 1.45rem;
  }
  .hero-desc {
    font-size: 0.86rem;
    line-height: 1.5;
  }
  .stat-pill {
    font-size: 0.78rem;
  }

  /* Paper tabs compact badges */
  .paper-tab {
    padding: 8px 6px;
    font-size: 0.82rem;
    gap: 5px;
  }
  .paper-tab .count-badge {
    display: none;
  }
  .paper-tab .tab-icon {
    font-size: 1rem;
  }

  /* Video player card headers */
  .video-info-box {
    padding: 14px 12px;
  }
  .topic-title-main {
    font-size: 1.15rem;
  }
  .btn-complete {
    font-size: 0.78rem;
    padding: 6px 10px;
  }
  .topic-nav-controls {
    flex-direction: row;
    gap: 6px;
  }
  .nav-topic-btn {
    padding: 6px 8px;
  }
  .nav-label {
    font-size: 0.65rem;
  }

  /* Player Mobile Nav Tabs */
  .player-tab-pill {
    padding: 8px 6px;
    font-size: 0.8rem;
    gap: 4px;
  }

  /* Discussion posting card */
  .posting-identity-badge {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
  .question-form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .question-form-actions .btn {
    width: 100%;
  }

  /* Card headers */
  .card-thumbnail-header {
    height: 120px;
    padding: 14px;
  }
  .subject-card-body {
    padding: 14px;
  }
  .subject-card-title {
    font-size: 1.1rem;
  }

  /* Modals */
  .modal-overlay {
    padding: 16px 12px;
  }
  .modal-card,
  .admin-modal-card {
    max-height: calc(100vh - 24px);
    border-radius: var(--radius-md);
  }
  .modal-card.auth-modal-card {
    width: calc(100% - 24px) !important;
    max-width: 390px !important;
    margin: 12px auto !important;
    border-radius: 16px !important;
  }
  .modal-header-coffee,
  .modal-header-auth,
  .admin-modal-header {
    padding: 14px 16px;
  }
  .modal-card .modal-body,
  .admin-modal-card .modal-body {
    padding: 14px 14px;
  }
  .coffee-tiers-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .upi-copy-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    text-align: center;
  }
  .upi-copy-container .btn {
    width: 100%;
  }
}

/* EXTRA SMALL SCREENS (<= 360px) */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.3rem;
  }
  .paper-tab {
    font-size: 0.78rem;
    padding: 6px 4px;
  }
  .btn-coffee {
    padding: 5px 8px;
  }
}

/* ================= COURSE THUMBNAIL & ICON THEMES ================= */
.card-thumbnail-header.has-image {
  background-size: cover;
  background-position: center;
  position: relative;
}

.card-thumbnail-header.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 11, 24, 0.35) 0%, rgba(6, 11, 24, 0.82) 100%);
  pointer-events: none;
}

/* Icon Theme Variations */
.card-icon-bubble.icon-theme-neon {
  border: 1.5px solid var(--brand-cyan);
  box-shadow: 0 0 16px rgba(31, 181, 245, 0.45), inset 0 0 8px rgba(31, 181, 245, 0.2);
  background: rgba(6, 15, 35, 0.85);
}

.card-icon-bubble.icon-theme-cyber {
  border: 1.5px solid var(--brand-orange);
  box-shadow: 0 0 16px rgba(247, 147, 30, 0.45), inset 0 0 8px rgba(247, 147, 30, 0.2);
  background: rgba(28, 12, 4, 0.85);
  border-radius: 6px 14px 6px 14px;
}

.card-icon-bubble.icon-theme-gradient {
  background: linear-gradient(135deg, rgba(31, 181, 245, 0.4), rgba(247, 147, 30, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.card-icon-bubble.icon-theme-glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card-icon-bubble.icon-theme-minimal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* ================= SOCIAL AUTH & UNIFIED LOGIN ================= */
.social-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.btn-social {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-social.btn-google {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.btn-social.btn-google:hover {
  background: #f9fafb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}
.auth-divider span {
  padding: 0 10px;
}

.auth-footer-prompt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 14px;
}
.auth-footer-prompt a {
  color: var(--brand-cyan);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ================= MFA SETUP & VERIFY STYLES ================= */
.mfa-enroll-box, .mfa-verify-box {
  background: rgba(14, 25, 48, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}
body[data-theme="light"] .mfa-enroll-box, 
body[data-theme="light"] .mfa-verify-box {
  background: #f8faff;
}

.mfa-badge-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.mfa-shield-icon {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(247, 147, 30, 0.15);
  border: 1px solid rgba(247, 147, 30, 0.3);
  flex-shrink: 0;
}

.mfa-step-instruction {
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.45;
}

.mfa-qr-wrapper {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.mfa-qr-box {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 170px;
}
.mfa-qr-box img, .mfa-qr-box canvas, .mfa-qr-box svg {
  max-width: 170px;
  max-height: 170px;
  display: block;
}

.mfa-manual-key-row {
  text-align: center;
  margin: 10px 0;
}
.mfa-secret-display-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 6px;
}
.mfa-secret-display-box code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--brand-cyan);
  letter-spacing: 0.1em;
}

.mfa-digit-input {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.25em;
  padding: 10px;
  border: 2px solid var(--brand-cyan);
  border-radius: 8px;
  background: var(--bg-input);
}
.mfa-admin-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  background: rgba(31, 181, 245, 0.1);
  border: 1px solid rgba(31, 181, 245, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

/* ================= RBAC MANAGEMENT STYLES ================= */
.rbac-table th, .rbac-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.rbac-table tr:hover td {
  background: rgba(31, 181, 245, 0.04);
}
.rbac-role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rbac-role-super {
  background: rgba(247, 147, 30, 0.18);
  color: var(--brand-orange);
  border: 1px solid rgba(247, 147, 30, 0.35);
}
.rbac-role-content {
  background: rgba(31, 181, 245, 0.18);
  color: var(--brand-cyan);
  border: 1px solid rgba(31, 181, 245, 0.35);
}
.rbac-role-instructor {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.rbac-role-moderator {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}
.rbac-role-student {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.btn-export-csv {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  transition: all 0.2s ease !important;
}
.btn-export-csv:hover {
  background: rgba(16, 185, 129, 0.28) !important;
  border-color: #10b981 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.btn-export-json {
  background: rgba(31, 181, 245, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(31, 181, 245, 0.35) !important;
  transition: all 0.2s ease !important;
}
.btn-export-json:hover {
  background: rgba(31, 181, 245, 0.28) !important;
  border-color: #1fb5f5 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.thumbnail-preview-box {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 1px dashed var(--border-color);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  position: relative;
  overflow: hidden;
}
.thumbnail-preview-box.has-img {
  border-style: solid;
  border-color: var(--brand-cyan);
}

/* ================= CLOUD DATABASE MANAGER STYLES ================= */
.cloud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--card-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.cloud-status-badge:hover {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-1px);
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.cloud-modal-card {
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.15);
}

/* ================= AUTH ERROR ALERTS & DEMO CREDENTIALS ================= */
.auth-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInDown 0.25s ease-out;
}

.auth-alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

body[data-theme="light"] .auth-alert-error {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}

.demo-credentials-card {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(31, 181, 245, 0.04);
  border: 1px dashed rgba(31, 181, 245, 0.25);
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
}

body[data-theme="light"] .demo-credentials-card {
  background: rgba(2, 132, 199, 0.05);
  border-color: rgba(2, 132, 199, 0.3);
}

.demo-card-title {
  font-weight: 700;
  color: var(--brand-cyan);
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.demo-card-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.demo-badge-role {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-badge-role.student {
  background: rgba(31, 181, 245, 0.15);
  color: var(--brand-cyan);
  border: 1px solid rgba(31, 181, 245, 0.3);
}

.demo-badge-role.admin {
  background: rgba(247, 147, 30, 0.15);
  color: var(--brand-orange);
  border: 1px solid rgba(247, 147, 30, 0.3);
}

.demo-card-item code {
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

body[data-theme="light"] .demo-card-item code {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

/* ================= ACTION INFO i-CARDS ================= */
.action-info-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-action-info {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.btn-action-info:hover,
.btn-action-info.active {
  background: rgba(31, 181, 245, 0.2);
  border-color: var(--brand-cyan);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(31, 181, 245, 0.4);
}

.btn-action-info-danger:hover,
.btn-action-info-danger.active {
  background: rgba(255, 77, 77, 0.25);
  border-color: #ff4d4d;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
}

.action-info-card {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(31, 181, 245, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(31, 181, 245, 0.15);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  text-align: left;
}

.action-info-group:hover .action-info-card,
.action-info-card.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.action-info-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin-bottom: 6px;
}

.action-info-card-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 6px 0;
}

.action-info-card-tip {
  font-size: 0.7rem;
  color: var(--brand-cyan);
  font-weight: 600;
  line-height: 1.35;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
}

/* ================= RBAC MANAGEMENT STYLES ================= */
.rbac-table {
  min-width: 680px;
}
.rbac-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  position: sticky;
  top: 0;
  background: var(--bg-card, #0c1830);
  z-index: 5;
  box-shadow: 0 1px 0 var(--border-color);
}
.rbac-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.rbac-table tr:hover td {
  background: rgba(31, 181, 245, 0.04);
}
.rbac-label-mobile {
  display: none;
}
.rbac-role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rbac-role-super {
  background: rgba(247, 147, 30, 0.18);
  color: var(--brand-orange);
  border: 1px solid rgba(247, 147, 30, 0.35);
}
.rbac-role-content {
  background: rgba(31, 181, 245, 0.18);
  color: var(--brand-cyan);
  border: 1px solid rgba(31, 181, 245, 0.35);
}
.rbac-role-instructor {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.rbac-role-moderator {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}
.rbac-role-student {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

/* ================= RBAC MANAGEMENT ENHANCEMENTS ================= */
.status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  text-transform: capitalize !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

.status-badge-active {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15) !important;
}

.status-badge-suspended {
  color: #ff4d4d !important;
  background: rgba(255, 77, 77, 0.15) !important;
  border: 1px solid rgba(255, 77, 77, 0.4) !important;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.15) !important;
}

.status-badge-deleted {
  color: #94a3b8 !important;
  background: rgba(148, 163, 184, 0.12) !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.active {
  background: #10b981;
  box-shadow: 0 0 6px #10b981, 0 0 10px rgba(16, 185, 129, 0.5);
  animation: statusPulseGlow 2s infinite ease-in-out;
}

.status-dot.suspended {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.status-dot.deleted {
  background: #94a3b8;
}

@keyframes statusPulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.rbac-role-select {
  background: var(--bg-input, #0f172a);
  border: 1px solid rgba(31, 181, 245, 0.35);
  color: var(--text-primary);
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.rbac-role-select:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 8px rgba(31, 181, 245, 0.3);
}

.btn-suspend-user {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-suspend-user.suspended {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}
.btn-suspend-user.active {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

/* RBAC Filter Sub-tabs row */
.rbac-filter-tabs-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  padding-bottom: 4px !important;
  max-width: 100% !important;
}
.rbac-filter-tabs-row::-webkit-scrollbar {
  display: none !important;
}
.rbac-filter-tabs-row .auth-tab-btn {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  padding: 6px 14px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  border-radius: 20px !important;
  color: var(--text-secondary) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border-subtle) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}
.rbac-filter-tabs-row .auth-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
.rbac-filter-tabs-row .auth-tab-btn.active {
  background: linear-gradient(135deg, rgba(31, 181, 245, 0.22), rgba(31, 181, 245, 0.1)) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(31, 181, 245, 0.5) !important;
  box-shadow: 0 0 12px rgba(31, 181, 245, 0.25) !important;
  font-weight: 700 !important;
}

/* Footer Social Row */
.footer-social-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-social-row .footer-social-btn,
.footer-social-row .btn-coffee {
  width: auto !important;
  height: auto !important;
  min-height: 38px !important;
  max-width: 100% !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-full) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  overflow: visible !important;
}
.footer-social-row .btn-coffee span {
  display: inline !important;
}

/* Doubts Hub Badges & Header actions */
.badge-answered {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  font-weight: 700 !important;
}
.badge-unanswered {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  font-weight: 700 !important;
}

/* Darker status text so the badges stay readable on white */
body[data-theme="light"] .badge-answered {
  color: #047857 !important;
}
body[data-theme="light"] .badge-unanswered {
  color: #b45309 !important;
}

@media (max-width: 640px) {
  .queries-header-card {
    padding: 18px 14px !important;
    text-align: center !important;
  }
  .queries-header-card > div:first-child {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }
  .queries-header-card h2 {
    justify-content: center !important;
  }
  .queries-controls-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .queries-filter-pills {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 6px !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }
  .queries-filter-pills .filter-pill {
    flex-shrink: 0 !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 480px) {
  .footer-social-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .footer-social-row .footer-social-btn,
  .footer-social-row .btn-coffee {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
}



/* ================= BRAND PALETTE (taken from the CS Revolt logo) =================
   Navy ring -> royal/electric blue -> orange "REVOLT" lettering.
   Blue is the main colour, orange is the single highlight, navy gives the weight. */
:root {
  --brand-navy: #0a2a5e;
  --brand-royal: #1565c0;
}

/* Cool navy wash behind the top of the catalog */
#catalogView {
  position: relative;
}
#catalogView::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 720px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(640px 340px at 8% 4%, rgba(31, 181, 245, 0.14), transparent 70%),
    radial-gradient(560px 320px at 92% 6%, rgba(247, 147, 30, 0.10), transparent 70%);
}

.hero-card {
  background:
    linear-gradient(90deg, var(--brand-royal), var(--brand-cyan), var(--brand-orange)) top / 100% 4px no-repeat,
    linear-gradient(135deg, #0b2554, #081a3d 60%, #061431);
  border: 1px solid rgba(31, 181, 245, 0.28);
}
body[data-theme="light"] .hero-card {
  background:
    linear-gradient(90deg, var(--brand-royal), var(--brand-cyan), var(--brand-orange)) top / 100% 4px no-repeat,
    linear-gradient(135deg, #ffffff 0%, #eaf3ff 100%);
  border: 1px solid rgba(10, 42, 94, 0.18);
}
.hero-card::before {
  background: radial-gradient(circle, rgba(31, 181, 245, 0.18) 0%, transparent 70%);
}
.hero-card::after {
  background: radial-gradient(circle, rgba(247, 147, 30, 0.14) 0%, transparent 70%);
}

.hero-title .gradient-cyan {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-royal) 55%, #0b8fd6);
  -webkit-background-clip: text;
  background-clip: text;
}
body[data-theme="dark"] .hero-title .gradient-cyan {
  background: linear-gradient(135deg, #5fd0ff, var(--brand-cyan));
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-pill {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: rgba(21, 101, 192, 0.10);
  border: 1px solid rgba(21, 101, 192, 0.28);
}
.stat-pill:nth-child(2) {
  background: rgba(247, 147, 30, 0.12);
  border-color: rgba(247, 147, 30, 0.38);
}

.hero-logo-img {
  box-shadow: 0 0 30px rgba(31, 181, 245, 0.35), 0 0 46px rgba(247, 147, 30, 0.2);
}

.paper-tab .count-badge {
  background: rgba(21, 101, 192, 0.16);
}

/* Subject cards: navy-to-royal header, blue edge on hover */
.card-thumbnail-header.cyan-gradient {
  background: linear-gradient(135deg, #082049, #0d3b82 60%, #1565c0);
}
.subject-card:hover {
  box-shadow: var(--shadow-md), 0 0 25px rgba(31, 181, 245, 0.2);
}
.card-progress-fill {
  background: linear-gradient(90deg, var(--brand-royal), var(--brand-cyan));
}
body[data-theme="light"] .card-progress-bar {
  background: rgba(10, 42, 94, 0.10);
}


/* ================= ADMIN DASHBOARD: TOP BAR + SIDEBAR =================
   Slim top bar (status + the one primary action) and a navigation sidebar
   that becomes a scrollable tab strip on small screens. */
:root {
  --admin-side-w: 232px;
  --admin-bar-h: 48px;
}

.admin-floating-bar,
body[data-theme="light"] .admin-floating-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: none;
  padding: 0;
  min-height: var(--admin-bar-h);
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  align-items: center;
}
.admin-floating-bar .admin-floating-bar-inner {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--admin-bar-h);
}
.admin-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-floating-bar .admin-add-btn {
  flex: 0 0 auto;
  padding: 7px 16px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.admin-cloud-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.admin-cloud-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.admin-cloud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.admin-cloud-dot.live {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

/* ---- Sidebar ---- */
.admin-sidebar {
  display: none;
}
body.admin-on .admin-sidebar {
  display: flex;
}
body.auth-locked .admin-sidebar,
body.auth-locked .admin-nav-backdrop {
  display: none;
}

.admin-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.admin-nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.admin-nav-item.active {
  background: rgba(21, 101, 192, 0.14);
  border-left-color: var(--brand-cyan);
  color: var(--text-primary);
}
.admin-nav-icon {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.admin-nav-label {
  flex: 1;
}
.admin-nav-badge {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--brand-orange);
  color: #1a1000;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}
.admin-nav-caret {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}
.admin-nav-group.open .admin-nav-caret {
  transform: rotate(180deg);
}

.admin-nav-panel {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0 4px 14px;
}
.admin-nav-group.open .admin-nav-panel {
  display: flex;
}
.admin-menu-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}
.admin-menu-item strong {
  font-size: 0.84rem;
}
.admin-menu-item span {
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: normal;
}
.admin-menu-item:hover {
  background: var(--bg-card-hover);
}
.admin-menu-item-danger strong {
  color: #ff6b6b;
}
body[data-theme="light"] .admin-menu-item-danger strong {
  color: #b91c1c;
}
.admin-menu-item-danger:hover {
  background: rgba(220, 38, 38, 0.1);
}

/* ---- Slide-in drawer (all screen sizes), opened with the hamburger ---- */
.admin-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1.15rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.admin-hamburger:hover {
  border-color: var(--border-strong);
}
.admin-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 290px;
  max-width: 86vw;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
body.admin-nav-open .admin-sidebar {
  transform: translateX(0);
}
.admin-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.admin-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
}
.admin-drawer-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.admin-nav-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.admin-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 10, 28, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
body.admin-nav-open .admin-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}
body.admin-on.admin-nav-open {
  overflow: hidden;
}
body:not(.admin-on) .admin-nav-backdrop {
  display: none;
}

/* ================= SUBJECTS DRAWER (public hamburger) ================= */
.site-hamburger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  margin-right: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.site-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--text-primary);
}
.site-hamburger:hover {
  border-color: var(--border-strong);
}

.site-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 86vw;
  padding: 16px 18px 28px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  transform: translateX(-105%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
}
body.site-nav-open .site-drawer {
  transform: translateX(0);
  visibility: visible;
}
.site-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.site-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
}
.site-drawer-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.site-drawer-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.site-drawer-link:hover {
  background: var(--bg-card-hover);
}
.site-drawer-title {
  margin: 20px 0 8px;
  padding: 0 12px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.site-drawer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.site-drawer-list a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.site-drawer-list a:hover {
  background: var(--bg-card-hover);
  color: var(--brand-cyan);
}

.site-drawer-title.title-cse,
.site-drawer-title.title-da {
  padding: 6px 12px;
  border-left: 3px solid;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.site-drawer-title.title-cse {
  color: var(--brand-cyan);
  border-color: var(--brand-cyan);
  background: rgba(31, 181, 245, 0.1);
}
.site-drawer-title.title-da {
  color: var(--brand-orange);
  border-color: var(--brand-orange);
  background: rgba(245, 158, 11, 0.1);
}
.site-drawer-list.list-cse a:hover {
  color: var(--brand-cyan);
}
.site-drawer-list.list-da a:hover {
  background: rgba(245, 158, 11, 0.1);
  color: var(--brand-orange);
}

.site-nav-backdrop {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 94;
  background: rgba(3, 10, 28, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
body.site-nav-open .site-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}
body.site-nav-open {
  overflow: hidden;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.site-hamburger {
  margin-right: 0;
}
.site-drawer-admin {
  display: none;
}
body.admin-on .site-drawer-admin {
  display: block;
}
.site-drawer-admin .admin-nav-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: none;
}
body.auth-locked .site-hamburger,
body.auth-locked .site-drawer,
body.auth-locked .site-nav-backdrop {
  display: none;
}

/* ================= "VIEW SITE AS" (Super Admin) ================= */
.dropdown-viewas {
  padding: 8px 14px 10px;
}
.dropdown-viewas label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dropdown-viewas .form-control {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.86rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
}

/* ================= RBAC: STAGED ROLE CHANGE (Save / Cancel) ================= */
.rbac-role-edit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.rbac-role-edit.pending .rbac-role-select {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 2px rgba(247, 147, 30, 0.25);
}
.rbac-role-actions {
  align-items: center;
  gap: 6px;
}
.rbac-role-actions .btn {
  padding: 4px 12px;
  font-size: 0.76rem;
}

/* Slimmer hero on all screens */
.hero-section {
  padding: 24px 0 16px;
}
.hero-card {
  padding: 24px 32px;
}
.hero-title {
  font-size: 2rem;
  margin-bottom: 8px;
}
.hero-desc {
  margin-bottom: 0;
}
@media (max-width: 768px) {
  .hero-section { padding: 16px 0 10px; }
  .hero-card { padding: 18px 16px; }
  .hero-title { font-size: 1.5rem; }
}

/* ================= PDF RESOURCES AND QUIZZES (take the video place) ================= */
.video-frame-wrapper.is-panel {
  padding-top: 0;
  background: var(--bg-card);
  min-height: 420px;
}
.topic-panel {
  position: static;
  width: 100%;
  color: var(--text-primary);
}
.topic-panel[hidden] {
  display: none;
}
.topic-panel-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* PDF viewer */
.resource-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.resource-bar-title {
  font-weight: 700;
  font-family: var(--font-heading);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resource-bar-actions {
  display: inline-flex;
  gap: 8px;
}
.resource-bar-actions .btn {
  padding: 6px 12px;
  font-size: 0.8rem;
}
.resource-frame {
  display: block;
  width: 100%;
  height: min(75vh, 760px);
  border: 0;
  background: #fff;
}

/* Quiz runner */
.quiz-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 24px 28px;
}
.quiz-head {
  text-align: center;
  margin-bottom: 18px;
}
.quiz-head h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin: 6px 0 4px;
}
.quiz-icon {
  font-size: 2.6rem;
  line-height: 1;
}
.quiz-muted {
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.quiz-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.quiz-big-btn {
  padding: 11px 26px;
  font-size: 0.98rem;
  font-weight: 700;
}
.quiz-last {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(31, 181, 245, 0.07);
}
.quiz-last-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.quiz-last-score {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
}
.quiz-last-score span {
  font-size: 1rem;
  color: var(--brand-cyan);
}
.quiz-progress {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.quiz-progress-track {
  height: 6px;
  border-radius: 6px;
  background: var(--border-subtle);
  overflow: hidden;
  margin-bottom: 20px;
}
.quiz-progress-track > div {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-royal), var(--brand-cyan));
  transition: width 0.25s ease;
}
.quiz-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.quiz-type.mcq {
  background: rgba(31, 181, 245, 0.15);
  color: var(--brand-cyan);
}
.quiz-type.msq {
  background: rgba(247, 147, 30, 0.16);
  color: var(--brand-orange);
}
.quiz-q-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 14px;
}
.quiz-options {
  display: grid;
  gap: 10px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option:hover {
  border-color: var(--brand-cyan);
}
.quiz-option.picked {
  border-color: var(--brand-cyan);
  background: rgba(31, 181, 245, 0.12);
}
.quiz-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.quiz-option-mark {
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
}
.quiz-option input[type="checkbox"] + .quiz-option-mark {
  border-radius: 5px;
}
.quiz-option.picked .quiz-option-mark {
  border-color: var(--brand-cyan);
  background: var(--brand-cyan);
  box-shadow: inset 0 0 0 3px var(--bg-card);
}
.quiz-nav {
  display: flex;
  align-items: center;
  margin-top: 22px;
  gap: 10px;
}
.quiz-nav-gap {
  flex: 1;
}
.quiz-submit-early {
  text-align: center;
  margin-top: 8px;
}
.quiz-big-score {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
}
.quiz-big-score span {
  font-size: 1.4rem;
  color: var(--text-secondary);
}
.quiz-pct {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-cyan);
  margin-bottom: 6px;
}

/* Quiz answer review */
.quiz-review-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.quiz-review-head h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0;
}
.quiz-review-item {
  border: 1px solid var(--border-subtle);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.quiz-review-item.ok {
  border-left-color: #10b981;
}
.quiz-review-item.bad {
  border-left-color: #ef4444;
}
.quiz-review-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.quiz-review-item.ok .quiz-verdict {
  color: #10b981;
}
.quiz-review-item.bad .quiz-verdict {
  color: #ef4444;
}
.quiz-review-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.quiz-review-options li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}
.quiz-review-options li em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.quiz-review-options li.is-correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}
.quiz-review-options li.is-wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}
.quiz-explain {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Admin: kind picker and quiz builder */
.kind-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.kind-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.kind-pill.active {
  border-color: var(--brand-cyan);
  background: rgba(31, 181, 245, 0.14);
  color: var(--brand-cyan);
}
.admin-form-error {
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.83rem;
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.qb {
  display: grid;
  gap: 12px;
}
.qb-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.qb-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qb-type {
  margin-left: auto;
  width: auto;
  padding: 5px 8px;
  font-size: 0.8rem;
}
.qb-options-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.qb-option {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qb-option .form-control {
  flex: 1;
}
.qb-remove {
  padding: 4px 8px;
  font-size: 0.8rem;
}
.qb-add-opt {
  justify-self: start;
  padding: 5px 12px;
  font-size: 0.78rem;
}

/* Syllabus edit controls: always visible on touch screens and on the open item (no hover there) */
.sidebar-topic-item.active .sidebar-topic-admin-actions {
  display: flex;
}
@media (hover: none) {
  .sidebar-topic-admin-actions {
    display: flex;
  }
}

@media (max-width: 640px) {
  .quiz-card {
    padding: 18px 14px 22px;
  }
  .video-frame-wrapper.is-panel {
    min-height: 320px;
  }
}

/* Quizzes and PDFs hang under the lecture they belong to: no number, indented */
.sidebar-topic-item.is-attachment {
  padding-left: 34px;
  position: relative;
}
.sidebar-topic-item.is-attachment::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 0;
  bottom: 50%;
  width: 8px;
  border-left: 2px solid var(--border-subtle);
  border-bottom: 2px solid var(--border-subtle);
  border-bottom-left-radius: 6px;
  pointer-events: none;
}

/* ================= TOPIC DROPDOWN IN THE SYLLABUS + BUTTONS UNDER THE VIDEO ================= */
/* Quizzes and PDFs live inside their topic, hidden until the topic's arrow is opened */
.topic-extras-list {
  display: none;
}
.topic-group.open .topic-extras-list {
  display: block;
}
.topic-extras-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
}
.topic-extras-toggle:hover {
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}
.topic-extras-count {
  font-weight: 700;
}
.topic-extras-caret {
  transition: transform 0.15s ease;
}
.topic-group.open .topic-extras-caret {
  transform: rotate(180deg);
}
.topic-extras-add {
  display: flex;
  gap: 6px;
  padding: 6px 12px 8px 34px;
}
.topic-extras-add .btn {
  padding: 3px 10px;
  font-size: 0.72rem;
}
.add-topic-placement {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(31, 181, 245, 0.08);
}

.topic-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 4px;
}
.topic-extras[hidden] {
  display: none;
}
.extras-wrap {
  position: relative;
}
.extras-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.extras-btn:hover:not(:disabled),
.extras-btn.active {
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}
.extras-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.extras-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(31, 181, 245, 0.15);
  color: var(--brand-cyan);
  font-size: 0.72rem;
  text-align: center;
}
.extras-caret {
  font-size: 0.7rem;
}
.extras-back {
  border-style: dashed;
}
.extras-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-width: min(360px, 86vw);
  padding: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}
.extras-menu[hidden] {
  display: none;
}
.extras-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  font-size: 0.86rem;
  cursor: pointer;
}
.extras-item:hover,
.extras-item.active {
  background: rgba(31, 181, 245, 0.12);
}
.extras-item em {
  float: right;
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.extras-add {
  color: var(--brand-cyan);
  font-weight: 600;
}
.extras-empty {
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.duration-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.save-note {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.extras-spacer {
  flex: 1 1 auto;
}
.extras-nav {
  background: linear-gradient(135deg, var(--brand-royal), var(--brand-cyan));
  border-color: transparent;
  color: #fff;
}
.extras-nav:hover:not(:disabled) {
  color: #fff;
  filter: brightness(1.08);
}
.extras-nav:disabled {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* ================= HERO: longer description and highlight chips ================= */
.hero-desc + .hero-desc {
  margin-top: 10px;
}
.hero-desc strong {
  color: var(--text-primary);
}
.hero-content .hero-stats-row {
  margin-top: 16px;
  gap: 10px;
}

/* Hero description typography */
.hero-content .hero-desc {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--text-primary);
  opacity: 0.88;
  max-width: 760px;
  letter-spacing: 0;
}
.hero-content .hero-desc + .hero-desc {
  font-size: 0.98rem;
  font-weight: 400;
  opacity: 0.75;
}
.hero-content .hero-desc strong {
  font-weight: 700;
}
.nowrap {
  white-space: nowrap;
}
@media (max-width: 768px) {
  .hero-content .hero-desc,
  .hero-content .hero-desc + .hero-desc {
    font-size: 0.92rem;
    line-height: 1.6;
  }
}

/* Hero tagline: monospace with a blinking cursor */
.hero-tagline {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-cyan);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
@media (max-width: 768px) {
  .hero-tagline { font-size: 0.9rem; text-align: center; }
}

/* Illustrated subject thumbnails (assets/thumbs): keep the artwork bright, add the accent edge */
.card-thumbnail-header.has-art {
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid var(--brand-cyan);
}
.subject-card.accent-orange .card-thumbnail-header.has-art {
  border-bottom-color: var(--brand-orange);
}
.card-thumbnail-header.has-art::after {
  background: linear-gradient(180deg, rgba(6, 11, 24, 0) 55%, rgba(6, 11, 24, 0.35) 100%);
}


/* Subject line icons (js/icons.js): coloured by the card accent */
.subject-svg-icon {
  width: 28px;
  height: 28px;
  display: block;
  color: #6fd0fb;
}
.subject-card.accent-orange .subject-svg-icon {
  color: #ffb14d;
}
#sidebarCourseTitle .subject-svg-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  color: var(--brand-cyan);
}

/* Hero tagline: sans-serif */
.hero-content .hero-tagline {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}
/* Hero description: monospace serif; Courier Prime only ships 400/700 */
.hero-content .hero-desc {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-weight: 400;
  /* Justified on every screen size; hyphens keep monospace word gaps from stretching too wide */
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.hero-content .hero-tagline {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0;
}


/* Hero language chip: Telugu + English */
.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(247, 147, 30, 0.14), rgba(31, 181, 245, 0.14));
  border: 1px solid rgba(31, 181, 245, 0.32);
  box-shadow: 0 2px 10px rgba(31, 181, 245, 0.12);
}
.lang-bubble {
  font-size: 1rem;
}
.lang-te {
  font-family: 'Noto Sans Telugu', 'Nirmala UI', 'Gautami', sans-serif;
  font-size: 1rem;
  color: var(--brand-orange-dark);
}
.lang-plus {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
}
.lang-en {
  font-family: var(--font-heading);
  color: var(--brand-royal, var(--brand-blue));
}
body[data-theme="dark"] .lang-te {
  color: var(--brand-orange-light);
}
body[data-theme="dark"] .lang-en {
  color: var(--brand-cyan-light);
}

/* ================= HERO WALL (logo rolls up a wall of subject bricks, js/hero-wall.js) ================= */
.hero-wall-showcase {
  width: 360px;
  max-width: 100%;
}
/* Laptops and up have room for a bigger wall */
@media (min-width: 1100px) {
  .hero-wall-showcase { width: 420px; }
}
@media (min-width: 1440px) {
  .hero-wall-showcase { width: 460px; }
}
.hero-wall {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
/* Foundation course: one row of long, flat bricks the wall stands on and the logo starts from */
.wall-foundation-brick {
  fill: rgba(21, 101, 192, 0.2);
  stroke: var(--border-strong);
  stroke-width: 1;
}
.hero-wall-edge {
  fill: none;
  stroke: var(--brand-cyan);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.wall-brick {
  stroke-width: 1;
}
.wall-brick.is-cse {
  fill: rgba(31, 181, 245, 0.16);
  stroke: rgba(31, 181, 245, 0.55);
}
.wall-brick.is-da {
  fill: rgba(247, 147, 30, 0.16);
  stroke: rgba(247, 147, 30, 0.55);
}
.wall-brick.is-plain {
  fill: rgba(21, 101, 192, 0.07);
  stroke: var(--border-subtle);
}
.wall-brick-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-anchor: middle;
  dominant-baseline: central;
  fill: var(--text-secondary);
  pointer-events: none;
}
.wall-brick-label.is-da {
  fill: var(--brand-orange);
}

/* Rope and climbers on the slope (js/hero-wall.js), faded in once the logo is on top */
.hero-wall-climbers {
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-wall.has-climbers .hero-wall-climbers {
  opacity: 1;
}
.hero-rope {
  fill: none;
  stroke: #a8743f;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 3 1;   /* reads as a twisted rope */
}
.hero-rope-stake {
  fill: #7a4f26;
}
body[data-theme="dark"] .hero-rope { stroke: #d6a06b; }
body[data-theme="dark"] .hero-rope-stake { fill: #b07a45; }
.hero-climber-limb {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-climber.is-cse .hero-climber-limb { stroke: var(--brand-cyan); }
.hero-climber.is-da .hero-climber-limb { stroke: var(--brand-orange); }
.hero-climber.is-cse .hero-climber-head { fill: var(--brand-cyan); }
.hero-climber.is-da .hero-climber-head { fill: var(--brand-orange); }
.hero-wall-logo-bg {
  fill: #060b18;
}
.hero-wall-logo-ring {
  fill: none;
  stroke: var(--brand-cyan);
  stroke-width: 2.5;
}
.hero-wall-spin {
  filter: drop-shadow(0 0 10px rgba(31, 181, 245, 0.45)) drop-shadow(0 0 16px rgba(247, 147, 30, 0.2));
}
.hero-wall-float {
  transform-box: fill-box;
  transform-origin: center;
}
/* Contact shadow under the logo (positioned by hero-wall.js); breathes with the float */
.hero-wall-shadow {
  fill: #060b18;
  fill-opacity: 0.45;
  transform-box: fill-box;
  transform-origin: center;
}
body[data-theme="dark"] .hero-wall-shadow {
  fill: #000;
  fill-opacity: 0.9;
}
.hero-wall-shadow.is-floating {
  animation: hero-shadow-breathe 6s ease-in-out infinite;
}
@keyframes hero-shadow-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.7; }
}
.hero-wall-float.is-floating {
  animation: float-logo 6s ease-in-out infinite;
}

/* Live stats on the logo's starting spot (left quarter of the wall, above the foundation);
   they fade in once the logo has rolled away and settled (.hero-wall.is-rested) */
.hero-wall-stage {
  position: relative;
  width: 100%; /* the showcase centres its children; without this the SVG falls back to 300px */
}
.hero-wall-stats {
  position: absolute;
  left: 0;
  bottom: 9%;
  width: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.hero-wall.is-rested + .hero-wall-stats {
  opacity: 1;
  transform: none;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.hero-stat[hidden] {
  display: none;
}
.hero-stat-num {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.hero-stat-label {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: liveDotPulse 1.8s ease-out infinite;
}
@keyframes liveDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  100% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}
@media (max-width: 768px) {
  .hero-stat-num { font-size: 0.92rem; }
  .hero-stat-label { font-size: 0.52rem; }
  .hero-wall-stats { gap: 6px; }
}

/* Channel name sits under the wall, right-aligned with its end */
.hero-wall-channel {
  width: max-content;
  margin-left: auto;
  margin-top: 2px;
  text-align: right;
}
.hero-channel-name {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}
.hero-channel-handle {
  font-size: 0.76rem;
  color: var(--brand-cyan);
}

@media (max-width: 768px) {
  .hero-wall-showcase {
    width: 340px;
  }
}

/* ================= SCROLL LOCK WHILE A PANEL OR OVERLAY IS OPEN ================= */
/* The page scrolls on <html>, so the lock has to go there (body overflow alone does nothing) */
html:has(body.site-nav-open),
html:has(body.admin-on.admin-nav-open),
html:has(.modal-overlay.active:not(#loginModalOverlay)) {
  overflow: hidden;
  overscroll-behavior: none;
}
/* Keep the scrollbar's space so the page doesn't shift sideways when it locks */
html {
  scrollbar-gutter: stable;
}
.site-drawer,
.modal-overlay {
  overscroll-behavior: contain;
}

/* ================= SIGN-IN CHECK ON LOAD ================= */
/* index.html starts with body.auth-pending: nothing but the logo shows until auth.js knows
   whether the visitor is signed in (then it shows the home page or the sign-in screen). */
body.auth-pending > * {
  visibility: hidden;
}
body.auth-pending::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: url('../assets/logo.png') center / contain no-repeat;
  box-shadow: 0 0 30px rgba(31, 181, 245, 0.45);
  animation: authPendingPulse 1.4s ease-in-out infinite;
}
@keyframes authPendingPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  body.auth-pending::after { animation: none; }
}

/* ================= SIGN-IN SCREEN: SPLIT LAYOUT ================= */
/* Left: navy brand panel with the subject wall. Right: the forms on a solid surface.
   On phones the brand panel becomes a short top band and the form a sheet below it. */
#loginModalOverlay.auth-screen {
  --auth-surface: #ffffff;
  --auth-field: #f7f9fc;
  --auth-line: #cfd8e6;
  --auth-ink: #0b1730;
  --auth-muted: #4a5a75;
  --auth-accent: #0d5fa8;
  --auth-accent-hover: #0a4f8d;
  padding: 0;
  background: var(--auth-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* The form side is always light, whatever the site theme */
#loginModalOverlay.auth-screen {
  color-scheme: light;
}
body[data-theme="dark"] #loginModalOverlay .auth-alert-success {
  background: #ecfdf3;
  border-color: #6ccf98;
  color: #166534;
}
body[data-theme="dark"] #loginModalOverlay .auth-alert-error {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}
body.auth-locked #loginModalOverlay.auth-screen {
  background: var(--auth-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* The page cannot scroll behind the sign-in screen, so drop the reserved scrollbar space */
html:has(body.auth-locked) {
  scrollbar-gutter: auto;
}
#loginModalOverlay.auth-screen.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
}

/* ---- Brand panel ---- */
.auth-brand {
  min-height: 100dvh;
  box-sizing: border-box;
  padding: 48px clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  background: radial-gradient(120% 90% at 0% 0%, #10264f 0%, #081633 55%, #050d22 100%);
  color: #e8f1ff;
}
.auth-brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.auth-brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
}
.auth-brand-name .cs { color: var(--brand-cyan); }
.auth-brand-name .revolt { color: var(--brand-orange); }
.auth-brand-tag {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fb3d4;
}
.auth-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
}
.auth-brand-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1.12;
  color: #ffffff;
  text-wrap: balance;
}
.auth-brand-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #b9c8e2;
}

/* The subject wall, with the logo resting on its top step */
.auth-brand-wall {
  --wb-w: 62px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.auth-wall-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 calc(var(--wb-w) * 0.42) 6px 0;
  box-shadow: 0 0 0 2px var(--brand-cyan), 0 0 28px rgba(31, 181, 245, 0.45);
  animation: float-logo 6s ease-in-out infinite;
}
.auth-wall-row {
  display: flex;
  gap: 4px;
}
.wb {
  width: var(--wb-w);
  height: 22px;
  box-sizing: border-box;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font: 600 10px/20px var(--font-mono);
  text-align: center;
}
.wb.cse {
  background: rgba(31, 181, 245, 0.14);
  border-color: rgba(31, 181, 245, 0.5);
  color: #8fd8ff;
}
.wb.da {
  background: rgba(247, 147, 30, 0.18);
  border-color: rgba(247, 147, 30, 0.55);
  color: #ffb35c;
}
.auth-wall-floor {
  align-self: stretch;
  height: 2px;
  margin-top: 2px;
  background: rgba(31, 181, 245, 0.45);
}
.auth-brand-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
.auth-brand-facts li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: #b9c8e2;
}
.auth-brand-facts strong {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  color: #ffffff;
}

/* ---- Form side ---- */
#loginModalOverlay .modal-card.auth-modal-card {
  width: auto !important;
  max-width: none !important;
  max-height: none;
  min-height: 100dvh;
  margin: 0 !important;
  box-sizing: border-box;
  padding: 48px 32px;
  border: 0;
  border-radius: 0 !important;
  box-shadow: none;
  background: var(--auth-surface);
  animation: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
#loginModalOverlay .modal-header-auth,
#loginModalOverlay .modal-card .modal-body {
  width: min(400px, 100%);
  padding: 0;
  border: 0;
  overflow: visible;
  text-align: left;
}
#loginModalOverlay .modal-header-auth {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#loginModalOverlay .auth-modal-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--auth-ink);
}
#loginModalOverlay .auth-modal-sub {
  margin: 0;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--auth-muted);
}
#loginModalOverlay .modal-close-btn {
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--auth-line);
  background: var(--auth-surface);
  color: var(--auth-muted);
}
#loginModalOverlay .modal-close-btn:hover {
  background: var(--auth-field);
  color: var(--auth-ink);
}
#loginModalOverlay .form-group {
  margin-bottom: 18px;
}
#loginModalOverlay .form-label {
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-ink);
}
#loginModalOverlay .form-control {
  height: 46px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: var(--auth-field);
  color: var(--auth-ink);
  font-size: 0.95rem;
}
#loginModalOverlay .form-control::placeholder {
  color: #8a97ab;
}
#loginModalOverlay .form-control:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(13, 95, 168, 0.18);
}
.auth-pass-wrap {
  position: relative;
}
#loginModalOverlay .auth-pass-wrap .form-control {
  padding-right: 50px;
}
.auth-pass-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}
.auth-pass-toggle:hover,
.auth-pass-toggle[aria-pressed="true"] {
  color: var(--auth-ink);
}
.auth-pass-toggle:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 1px;
}
#loginModalOverlay .btn.auth-submit {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--auth-accent);
  box-shadow: none;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
}
#loginModalOverlay .btn.auth-submit:hover {
  background: var(--auth-accent-hover);
  transform: none;
}
#loginModalOverlay .btn-social.btn-google {
  height: 48px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: var(--auth-surface);
  box-shadow: none;
  color: var(--auth-ink);
  font-size: 0.95rem;
}
#loginModalOverlay .btn-social.btn-google:hover {
  background: var(--auth-field);
  transform: none;
}
#loginModalOverlay .auth-divider {
  margin: 20px 0;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--auth-muted);
}
#loginModalOverlay .auth-divider::before,
#loginModalOverlay .auth-divider::after {
  background: var(--auth-line);
}
#loginModalOverlay .auth-footer-prompt {
  margin-top: 18px;
  font-size: 0.875rem;
  color: var(--auth-muted);
}
#loginModalOverlay .auth-footer-prompt a {
  color: var(--auth-accent);
  text-decoration: none;
}
#loginModalOverlay .auth-footer-prompt a:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .auth-brand-wall { --wb-w: 52px; }
}
/* Phones and small tablets: no brand panel, just the light form, centred */
@media (max-width: 900px) {
  #loginModalOverlay.auth-screen.active {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-brand {
    display: none;
  }
  #loginModalOverlay .modal-card.auth-modal-card {
    padding: 56px 20px 32px;
    gap: 18px;
  }
  #loginModalOverlay .auth-modal-title { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-wall-logo { animation: none; }
}

/* Password reset: "Forgot password?" beside the label, and the "email sent" notice */
.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
#loginModalOverlay .auth-label-row .form-label {
  margin-bottom: 0;
}
.auth-forgot-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--auth-accent, var(--brand-cyan));
  text-decoration: none;
}
.auth-forgot-link:hover {
  text-decoration: underline;
}
.auth-alert-success {
  background: #ecfdf3;
  border: 1px solid #6ccf98;
  color: #166534;
}
body[data-theme="dark"] .auth-alert-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}
#loginModalOverlay .btn.auth-submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

/* Staff 2-step screens on the sign-in screen: same surface and colours as the forms, centred.
   The page heading (setHeading in auth.js) already names the step, so the old boxed header goes. */
#loginModalOverlay .mfa-enroll-box,
#loginModalOverlay .mfa-verify-box {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
}
#loginModalOverlay .mfa-badge-header {
  display: none;
}
#loginModalOverlay .mfa-step-instruction {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--auth-ink);
}
#loginModalOverlay .mfa-qr-wrapper {
  margin: 0 0 16px;
}
#loginModalOverlay .mfa-qr-box {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--auth-line);
  box-shadow: none;
}
#loginModalOverlay .mfa-qr-box img,
#loginModalOverlay .mfa-qr-box canvas,
#loginModalOverlay .mfa-qr-box svg {
  width: 168px;
  height: 168px;
  max-width: 100%;
}
#loginModalOverlay .mfa-manual-key-row {
  margin: 0 0 8px;
  color: var(--auth-muted);
}
#loginModalOverlay .mfa-manual-key-row > div {
  color: var(--auth-muted) !important;
  font-size: 0.82rem !important;
  margin-bottom: 8px !important;
}
#loginModalOverlay .mfa-secret-display-box {
  max-width: 100%;
  box-sizing: border-box;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: var(--auth-field);
}
#loginModalOverlay .mfa-secret-display-box code {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
  color: var(--auth-accent);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}
#loginModalOverlay .mfa-secret-display-box .btn {
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: var(--auth-surface);
  color: var(--auth-ink);
}
#loginModalOverlay .mfa-admin-pill {
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 4px;
  padding: 10px 14px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: var(--auth-field);
  color: var(--auth-muted);
  font-size: 0.85rem;
  text-align: center;
}
#loginModalOverlay .mfa-admin-pill strong {
  color: var(--auth-ink);
  overflow-wrap: anywhere;
}
#loginModalOverlay .mfa-enroll-box .form-group,
#loginModalOverlay .mfa-verify-box .form-group {
  margin-top: 18px !important;
  text-align: left;
}
#loginModalOverlay .mfa-digit-input {
  height: 54px;
  border: 1.5px solid var(--auth-line);
  background: var(--auth-field);
  color: var(--auth-ink);
  font-size: 1.4rem;
  text-align: center;
  letter-spacing: 0.3em;
}
#loginModalOverlay .mfa-digit-input:focus {
  border-color: var(--auth-accent);
}
/* Verify on top, Cancel under it, both full width */
#loginModalOverlay .mfa-enroll-box .form-actions-row,
#loginModalOverlay .mfa-verify-box .form-actions-row {
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 10px;
  margin-top: 18px !important;
}
#loginModalOverlay .mfa-enroll-box .form-actions-row .btn,
#loginModalOverlay .mfa-verify-box .form-actions-row .btn {
  width: 100%;
  height: 48px;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.95rem;
  box-shadow: none;
}
#loginModalOverlay .form-actions-row .btn-primary {
  border: 0;
  background: var(--auth-accent);
  color: #ffffff;
}
#loginModalOverlay .form-actions-row .btn-primary:hover {
  background: var(--auth-accent-hover);
  transform: none;
}
#loginModalOverlay .form-actions-row .btn-outline {
  border: 1px solid var(--auth-line);
  background: var(--auth-surface);
  color: var(--auth-ink);
}
#loginModalOverlay .form-actions-row .btn-outline:hover {
  background: var(--auth-field);
}
/* On the 2-step screens, centre the heading too */
#loginModalOverlay .modal-card.auth-modal-card:has(#authMfaEnrollView[style*="block"]) .modal-header-auth,
#loginModalOverlay .modal-card.auth-modal-card:has(#authMfaVerifyView[style*="block"]) .modal-header-auth {
  text-align: center;
}

/* ---- Sign-in screen: fit the 2-step screens in the window, phone layout ---- */
/* Brand mark above the heading, phones only (the brand panel is hidden there) */
.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--auth-ink);
}
.auth-mobile-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.auth-mobile-brand .cs { color: #0b7fc0; }
.auth-mobile-brand .revolt { color: #d97706; }

/* 2-step screens: tighter so the whole step fits on a laptop screen without scrolling */
#loginModalOverlay .mfa-step-instruction {
  margin-bottom: 14px;
  font-size: 0.9rem;
}
#loginModalOverlay .mfa-qr-wrapper {
  margin-bottom: 14px;
}
#loginModalOverlay .mfa-qr-box {
  padding: 10px;
}
#loginModalOverlay .mfa-qr-box img,
#loginModalOverlay .mfa-qr-box canvas,
#loginModalOverlay .mfa-qr-box svg {
  width: 148px;
  height: 148px;
}
#loginModalOverlay .mfa-secret-display-box {
  align-items: center;
  gap: 6px 10px;
  padding: 8px 10px;
}
#loginModalOverlay .mfa-secret-display-box code {
  font-size: 0.8rem;
}
#loginModalOverlay .mfa-secret-display-box .btn {
  padding: 5px 10px !important;
}
/* Every line of a 2-step screen is centred, labels included */
#loginModalOverlay .mfa-enroll-box .form-group,
#loginModalOverlay .mfa-verify-box .form-group {
  margin-top: 16px !important;
  text-align: center;
}
#loginModalOverlay .mfa-enroll-box .form-label,
#loginModalOverlay .mfa-verify-box .form-label {
  display: block;
}
#loginModalOverlay .mfa-enroll-box .form-actions-row,
#loginModalOverlay .mfa-verify-box .form-actions-row {
  margin-top: 16px !important;
}

/* Short laptop screens: smaller QR, buttons side by side */
@media (min-width: 901px) and (max-height: 860px) {
  #loginModalOverlay .modal-card.auth-modal-card {
    padding-block: 28px;
    gap: 16px;
  }
  #loginModalOverlay .mfa-qr-box img,
  #loginModalOverlay .mfa-qr-box canvas,
  #loginModalOverlay .mfa-qr-box svg {
    width: 124px;
    height: 124px;
  }
  #loginModalOverlay .mfa-step-instruction,
  #loginModalOverlay .mfa-qr-wrapper {
    margin-bottom: 10px;
  }
  #loginModalOverlay .mfa-enroll-box .form-actions-row,
  #loginModalOverlay .mfa-verify-box .form-actions-row {
    flex-direction: row-reverse;
  }
  #loginModalOverlay .mfa-enroll-box .form-actions-row .btn,
  #loginModalOverlay .mfa-verify-box .form-actions-row .btn {
    flex: 1 1 0;
    width: auto;
  }
}
@media (min-width: 901px) and (max-height: 700px) {
  #loginModalOverlay .mfa-qr-box img,
  #loginModalOverlay .mfa-qr-box canvas,
  #loginModalOverlay .mfa-qr-box svg {
    width: 104px;
    height: 104px;
  }
  #loginModalOverlay .auth-modal-title {
    font-size: 1.6rem;
  }
}

/* Phones: brand mark on top, content starts from the top with even 24px margins */
@media (max-width: 900px) {
  .auth-mobile-brand {
    display: flex;
  }
  #loginModalOverlay .modal-card.auth-modal-card {
    justify-content: flex-start;
    padding: 28px 24px 40px;
    gap: 20px;
  }
  #loginModalOverlay .modal-header-auth,
  #loginModalOverlay .modal-card .modal-body {
    width: min(440px, 100%);
  }
  #loginModalOverlay .auth-modal-title {
    font-size: 1.6rem;
  }
  /* 2-step screens are centred, so is the brand mark */
  #loginModalOverlay .modal-card.auth-modal-card:has(#authMfaEnrollView[style*="block"]) .auth-mobile-brand,
  #loginModalOverlay .modal-card.auth-modal-card:has(#authMfaVerifyView[style*="block"]) .auth-mobile-brand {
    justify-content: center;
  }
}

/* Sign-in screen keeps pull-to-refresh: the page behind is frozen by overflow alone */
#loginModalOverlay.modal-overlay {
  overscroll-behavior: auto;
}

/* Phones: roomier margins on the sign-in, sign-up and 2-step screens */
@media (max-width: 900px) {
  #loginModalOverlay .modal-card.auth-modal-card {
    padding: 40px 32px 48px;
    gap: 24px;
  }
  .auth-mobile-brand {
    margin-bottom: 28px;
  }
}
@media (max-width: 360px) {
  #loginModalOverlay .modal-card.auth-modal-card {
    padding: 32px 24px 40px;
  }
}

/* Signed out: the sign-in screen joins the page flow instead of floating over it */
body.auth-locked #loginModalOverlay.auth-screen.active {
  position: relative;
  inset: auto;
  min-height: 100dvh;
  overflow: visible;
  z-index: 1;
}
