:root {
  --bg-primary: #ffffff;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --pill-bg: #f2f2f2;
  --pill-active-bg: #0f172a;
  --pill-active-text: #ffffff;
  --header-height: 56px;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 72px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Layout */
#app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #ffffff;
}

#header-mount {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

#layout-body {
  display: flex;
  flex: 1;
}

#sidebar-mount {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  transition: width 0.2s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#sidebar-mount.collapsed {
  width: var(--sidebar-collapsed-width);
}

#sidebar-mount.collapsed .nav-label,
#sidebar-mount.collapsed .sidebar-progress-card {
  display: none;
}

#content-container {
  flex: 1;
  padding: 16px 24px;
  max-width: 1600px;
  margin: 0 auto;
  background: #ffffff;
}

#pills-mount {
  margin-bottom: 20px;
}

/* Header Elements */
.brand-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: inline-block;
}

.search-bar-wrapper {
  display: flex;
  max-width: 540px;
  width: 100%;
}

.search-input {
  flex: 1;
  padding: 9px 18px;
  border-radius: 24px 0 0 24px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
}

.search-input:focus {
  border-color: #3b82f6;
}

.search-submit-btn {
  padding: 9px 22px;
  border-radius: 0 24px 24px 0;
  border: 1px solid var(--border-color);
  border-left: none;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}

.search-submit-btn:hover {
  background: #f1f5f9;
}

.btn-icon {
  background: none;
  border: none;
  color: #334155;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: #f1f5f9;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}

.user-avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ea580c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Sidebar Elements */
.sidebar-nav-list {
  list-style: none;
  padding: 12px 0;
}

.sidebar-nav-item a {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  margin: 0 10px 4px;
  border-radius: 10px;
  color: #334155;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.sidebar-nav-item:hover a {
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar-nav-item.active a {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
}

/* Sidebar Progress Widget (Matching Screenshot) */
.sidebar-progress-card {
  margin: 16px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.sidebar-progress-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-progress-metrics {
  display: flex;
  gap: 8px;
}

.progress-metric-box {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.metric-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #6366f1;
}

.metric-value.green {
  color: #10b981;
}

/* Category Filter Chips (Matching Screenshot: All, Science, Grade 10, Easy...) */
.pills-scroll-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pill-filter-btn {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--pill-bg);
  border: 1px solid transparent;
  color: #334155;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pill-filter-btn:hover {
  background: #e2e8f0;
}

.pill-filter-btn.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
}

/* YouTube Style Batch Video Cards (Light Mode) */
.batch-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.batch-card {
  background: #ffffff;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}

.batch-card-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000000;
}

/* Thumbnail Visual & Overlay */
.thumbnail-backdrop {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, #09090b, #18181b);
}

.thumbnail-title-overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  max-width: 80%;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* Hover Quick Actions (Watch Later & Playlist) */
.thumbnail-hover-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.batch-card:hover .thumbnail-hover-actions {
  opacity: 1;
}

.hover-action-btn {
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hover-action-btn:hover {
  background: rgba(0, 0, 0, 0.95);
}

.batch-question-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Start Quiz CTA Button (Purple Gradient Overlay) */
.btn-start-quiz-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.batch-card:hover .btn-start-quiz-overlay {
  opacity: 1;
}

/* Card Details */
.batch-card-details {
  padding: 10px 2px;
}

.batch-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.batch-sub-meta {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 6px;
}

.batch-tags {
  display: flex;
  gap: 6px;
}

.subject-tag-pill {
  background: #f1f5f9;
  color: #475569;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary {
  background: #0f172a;
  color: #fff;
}

.btn-primary:hover {
  background: #334155;
}

.btn-header-create {
  background: #f2f2f2;
  color: #0f172a;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-header-create:hover {
  background: #e5e5e5;
}

/* Utility Classes */
.d-none {
  display: none !important;
}

/* Modern Minimalist Focus Mode & Quiz Card Layout (matching screenshot) */
.quiz-runner-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 140px;
}

.quiz-runner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.quiz-runner-header .question-indicator {
  font-size: 15px;
  font-weight: 600;
  color: #475569;
}

.quiz-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  padding: 36px 40px;
  margin-bottom: 36px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quiz-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

.quiz-card .q-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.quiz-card .q-number-pill {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.3px;
}

.quiz-card .q-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 12px 0 24px;
}

.quiz-card .q-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.quiz-card .q-context {
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 28px;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Option Tile matching screenshot */
.option-tile {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.option-tile:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.option-tile.selected {
  border: 2px solid #2563eb !important;
  background: #eff6ff !important;
}

.option-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  margin-right: 18px;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.option-tile.selected .option-letter-badge {
  border-color: #2563eb !important;
  color: #2563eb !important;
  background: #ffffff !important;
}

.option-text-content {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.5;
  flex-grow: 1;
}

.option-tile.selected .option-text-content {
  font-weight: 700 !important;
  color: #0f172a !important;
}

/* Floating Bottom Controls */
.quiz-runner-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
  padding: 16px 32px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
