* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  color: #0f172a;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  min-width: 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 24px;
}

.content {
  min-width: 0;
}

.sidebar h1 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 0;
}

.subtitle {
  margin: 8px 0 24px;
  color: #94a3b8;
  font-size: 1.05rem;
  font-weight: 600;
}

.clo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-authors {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #334155;
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.5;
}

.sidebar-authors p {
  margin: 0;
}

.sidebar-authors .author-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.sidebar-logo {
  display: block;
  width: min(180px, 100%);
  max-width: 180px;
  height: auto;
  margin-top: 16px;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
  object-fit: contain;
}

.clo-btn {
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 10px;
  text-align: left;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s;
}

.clo-btn:hover,
.clo-btn.active {
  background: #334155;
  border-color: #64748b;
}

.content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pill {
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  padding: 6px 14px;
}

.summary-list {
  margin: 8px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.slides-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.slide-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.slide-title {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  font-weight: 600;
  font-size: 0.9rem;
}

.slide-frame {
  width: 100%;
  height: 420px;
  border: none;
  display: block;
}

.videos-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.videos-toolbar {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.videos-toolbar label {
  font-weight: 600;
  color: #334155;
}

#video-week-filter {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #ffffff;
  color: #0f172a;
}

.video-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 10px;
}

.video-card {
  display: block;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.video-card:hover {
  transform: translateY(-2px);
}

.video-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.video-title {
  padding: 10px;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.9rem;
}

.videos-empty {
  margin: 0;
  color: #64748b;
}

.tab-header {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.tab {
  border: none;
  background: #e2e8f0;
  color: #0f172a;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: #2563eb;
  color: #ffffff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.sparkhub-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #eef2ff 100%);
  border: 1px solid #dbeafe;
}

.sparkhub-card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
}

.sparkhub-copy {
  position: relative;
  z-index: 1;
}

.sparkhub-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sparkhub-copy h2 {
  margin: 0 0 10px;
  font-size: 1.6rem;
  color: #0f172a;
}

.sparkhub-copy p {
  margin: 0 0 12px;
  max-width: 760px;
  color: #334155;
  line-height: 1.7;
}

.sparkhub-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.sparkhub-highlights span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 0.92rem;
  font-weight: 600;
}

.sparkhub-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  background: #2563eb;
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.sparkhub-link:hover {
  transform: translateY(-1px);
  background: #1d4ed8;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.mcq-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.mcq-progress {
  margin: 0 0 8px;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
}

.options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.option {
  display: flex;
  gap: 8px;
}

.primary,
.secondary {
  margin-top: 12px;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.primary {
  background: #2563eb;
  color: #fff;
}

.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.code-editor-shell {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1f2937;
  background: #0f172a;
}

.code-editor-toolbar {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid #1e293b;
  background: #111827;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red {
  background: #f87171;
}

.dot-yellow {
  background: #fbbf24;
}

.dot-green {
  background: #34d399;
}

.code-editor-label {
  margin-left: 8px;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
}

.code-editor-stage {
  position: relative;
  min-height: 260px;
}

#code-lines {
  margin: 0;
  position: absolute;
  inset: 0 auto 0 0;
  width: 54px;
  min-height: 260px;
  padding: 12px 8px;
  border-right: 1px solid #1e293b;
  background: #111827;
  color: #64748b;
  text-align: right;
  pointer-events: none;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre;
}

#code-highlight,
#code-editor {
  margin: 0;
  width: 100%;
  min-height: 260px;
  padding: 12px 14px 12px 66px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}

#code-highlight {
  color: #e2e8f0;
  pointer-events: none;
}

#code-editor {
  position: absolute;
  inset: 0;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  color: transparent;
  caret-color: #e2e8f0;
}

#code-editor::selection {
  background: rgba(59, 130, 246, 0.3);
}

#code-highlight .py-comment {
  color: #64748b;
}

#code-highlight .py-keyword {
  color: #c084fc;
}

#code-highlight .py-string {
  color: #fbbf24;
}

#code-highlight .py-number {
  color: #22d3ee;
}

#code-highlight .py-func {
  color: #60a5fa;
}

.exercise-prompt {
  margin: 12px 0 8px;
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  padding: 10px;
  border-radius: 8px;
}

.feedback {
  margin-top: 12px;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.feedback.success {
  border-color: #16a34a;
  background: #f0fdf4;
}

.feedback.error {
  border-color: #dc2626;
  background: #fef2f2;
}

.code-solution {
  margin-top: 12px;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-card {
  width: min(420px, 100%);
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  padding: 18px;
}

.modal-card h3 {
  margin: 0 0 8px;
  color: #0f172a;
}

.modal-card p {
  margin: 0;
  color: #334155;
}

.modal-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.modal-actions .primary,
.modal-actions .secondary {
  margin-top: 0;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .slides-grid {
    grid-template-columns: 1fr;
  }

  .videos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .videos-grid {
    grid-template-columns: 1fr;
  }
}
