:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --muted: #52607a;
  --text: #0f172a;
  --primary: #4f46e5;
  --accent: #10b981;
  --border: #e5e7eb;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(79,70,229,0.08), transparent 30%),
              radial-gradient(circle at 80% 0%, rgba(16,185,129,0.07), transparent 32%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.container {
  width: min(1150px, 96%);
  margin: 0 auto;
  padding: 28px 0 64px;
}

.hero {
  background: linear-gradient(135deg, rgba(79,70,229,0.12), rgba(16,185,129,0.12));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 38px);
  margin: 0 0 12px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 16px;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tab-btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 150ms ease;
}

.tab-btn:hover { border-color: var(--primary); }
.tab-btn.active { background: #eef2ff; border-color: #c7d2fe; color: #312e81; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--primary), #6b5ff5);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(79,70,229,0.18);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(79,70,229,0.22); }

.section {
  margin-bottom: 26px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.section p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Force single-column layout for task lists */
#homework-content-all,
#assignments-content-all,
#exercises-content-all {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Larger titles inside task cards */
#homework-content-all h4,
#assignments-content-all h4,
#exercises-content-all h4 {
  font-size: 20px !important;
}

/* Larger question text */
#homework-content-all span,
#assignments-content-all span,
#exercises-content-all span {
  font-size: 16px !important;
}

/* YouTube-style video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.video-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.video-thumbnail a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 150ms ease;
}

.video-thumbnail:hover img {
  filter: brightness(0.6);
}

.video-thumbnail:hover div[style*="position: absolute"] {
  background: rgba(255,0,0,1) !important;
}

.video-thumbnail .btn-primary {
  position: absolute;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.video-content {
  padding: 12px 12px 16px;
}

.video-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.video-duration {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.video-description {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* Responsive: 2 columns on tablet */
@media (max-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive: 1 column on mobile */
@media (max-width: 640px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .video-content {
    padding: 12px;
  }
  
  .video-title {
    font-size: 13px;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 150ms ease, border-color 150ms ease;
}

.card:hover { transform: translateY(-3px); border-color: #cbd5e1; }

.roadmap-level {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-track {
  background: #f1f5f9;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  width: 0;
  transition: width 200ms ease;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.tag {
  background: #eef2ff;
  color: #312e81;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #c7d2fe;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.resource-link:hover { color: var(--primary); }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-row input { margin-top: 4px; }

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.input {
  flex: 1 1 240px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
}

.input::placeholder { color: #94a3b8; }

textarea.input { min-height: 100px; }

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.btn-ghost:hover { border-color: var(--primary); color: #312e81; }

.progress-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 600;
}

.small-text { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* Quiz Styles */
.exercise-quiz-card {
  display: flex;
  flex-direction: column;
}

.quiz-questions {
  margin-top: 8px;
}

.quiz-question label:hover {
  background: #f3f4f6 !important;
  border-color: #d1d5db !important;
}

.quiz-question input[type="radio"]:checked + span {
  font-weight: 600;
  color: var(--primary);
}

.quiz-question label:has(input:checked) {
  background: #eef2ff !important;
  border-color: var(--primary) !important;
}

#quizResultsModal .submission-modal {
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .hero { padding: 24px; }
  .section-header { flex-direction: column; align-items: flex-start; }
}
