/* =====================================================
   COURSE DETAIL MODAL — Udemy-style
   ===================================================== */

.cd-overlay {
  z-index: 2000;
  align-items: flex-start;
  padding: 0;
  overflow-y: auto;
}
.cd-overlay.active { display: flex; }

.cd-modal {
  background: var(--dark);
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-y: auto;
}

.cd-close {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 2100;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cd-close:hover { background: rgba(255,255,255,0.15); }

/* ── Hero ── */
.cd-hero {
  background: linear-gradient(135deg, #0d0d1a 0%, #1a1040 100%);
  border-bottom: 1px solid var(--card-border);
  padding: 48px 48px 40px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.cd-breadcrumb {
  font-size: 0.78rem;
  color: var(--primary-light);
  margin-bottom: 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cd-breadcrumb span { opacity: 0.8; }

.cd-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.25;
  margin: 0 0 14px;
}

.cd-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  margin: 0 0 18px;
}

.cd-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cd-rating-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
}
.cd-stars { color: #f59e0b; letter-spacing: 1px; }
.cd-enrolled { font-size: 0.82rem; color: rgba(255,255,255,0.6); }
.cd-duration-badge {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 50px;
}

.cd-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-tag-chip {
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.35);
  color: var(--primary-light);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
}

/* ── Hero card (right side) ── */
.cd-hero-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  position: sticky;
  top: 20px;
}
.cd-thumb {
  width: 100%;
  height: 180px;
  background: var(--gradient);
  overflow: hidden;
}
.cd-price-box {
  padding: 20px;
}
.cd-price-free {
  font-size: 1.6rem;
  font-weight: 800;
  color: #10b981;
}
.cd-price-current {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
}
.cd-enroll-btn {
  width: 100%;
  background: var(--gradient);
  color: white;
  border: none;
  padding: 13px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin: 14px 0 8px;
  transition: opacity 0.2s, transform 0.15s;
}
.cd-enroll-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.cd-guarantee {
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0 0 16px;
}
.cd-includes {
  border-top: 1px solid var(--card-border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cd-include-item {
  font-size: 0.82rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Body ── */
.cd-body {
  padding: 40px 48px;
}

/* Constrain text-heavy sections but let curriculum go full width */
.cd-section:not(.cd-section-curriculum) {
  max-width: 760px;
}

.cd-section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--card-border);
}
.cd-section:last-child { border-bottom: none; }

.cd-section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  margin: 0 0 20px;
}

/* What you'll learn */
.cd-learn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
}
.cd-learn-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}
.cd-check {
  color: #10b981;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Requirements */
.cd-req-list {
  padding-left: 20px;
  margin: 0;
}
.cd-req-list li {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Description */
.cd-description {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.8;
}
.cd-description p { margin: 0 0 14px; }
.cd-description h4 { font-size: 0.95rem; font-weight: 700; color: var(--white); margin: 20px 0 10px; }
.cd-description ul { padding-left: 20px; }
.cd-description li { margin-bottom: 6px; }
.cd-description strong { color: var(--white); }

/* Instructor */
.cd-inst-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 22px;
}
.cd-inst-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.cd-inst-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-light);
  margin: 0 0 4px;
}
.cd-inst-title {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 10px;
}
.cd-inst-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cd-inst-bio {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

/* Related courses */
.cd-related {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cd-related-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.cd-related-card:hover {
  border-color: rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.06);
}
.cd-related-thumb {
  width: 72px;
  height: 56px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.cd-related-body h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 4px;
}
.cd-related-body p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cd-related-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}
.cd-related-price {
  color: var(--primary-light);
  font-weight: 700;
}

/* Make h3 in cards look clickable */
.master-card h3,
.course-card h3,
.live-card h3 {
  cursor: pointer;
  transition: color 0.18s;
}
.master-card h3:hover,
.course-card h3:hover,
.live-card h3:hover {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Responsive */
@media (max-width: 768px) {
  .cd-hero { grid-template-columns: 1fr; padding: 24px; }
  .cd-hero-card { position: static; }
  .cd-body { padding: 24px; }
  .cd-section:not(.cd-section-curriculum) { max-width: 100%; }
  .cd-learn-grid { grid-template-columns: 1fr; }
  .cd-title { font-size: 1.4rem; }
}

/* =====================================================
   CURRICULUM SECTION — Box layout
   ===================================================== */
.cd-curriculum-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cd-curriculum-stats span {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cd-no-curriculum {
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ── Module box ── */
.cd-module {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.cd-module:hover { border-color: rgba(124,58,237,0.4); }

.cd-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(37,99,235,0.08));
  cursor: pointer;
  user-select: none;
  transition: background 0.18s;
  gap: 14px;
}
.cd-module-header:hover { background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(37,99,235,0.14)); }

.cd-module-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

/* Module number badge */
.cd-module-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(124,58,237,0.25);
  border: 1px solid rgba(124,58,237,0.4);
  color: var(--primary-light);
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cd-module-info { flex: 1; min-width: 0; }
.cd-module-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--white);
  display: block;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-module-meta {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  gap: 10px;
}

.cd-module-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.cd-module-arrow {
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.2s;
}
.cd-module-expand-hint {
  font-size: 0.72rem;
  color: var(--primary-light);
  font-weight: 600;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  padding: 3px 10px;
  border-radius: 50px;
}

/* ── Lessons list (sub-modules) ── */
.cd-lessons-list {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 8px 0;
  background: rgba(0,0,0,0.2);
}

.cd-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 20px 9px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  gap: 12px;
  transition: background 0.15s;
}
.cd-lesson-row:last-child { border-bottom: none; }
.cd-lesson-row:hover { background: rgba(255,255,255,0.03); }

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

/* Lesson type pill */
.cd-lesson-type-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  flex-shrink: 0;
  white-space: nowrap;
}
.cd-type-video   { background: rgba(239,68,68,0.12);  color: #f87171; }
.cd-type-reading { background: rgba(59,130,246,0.12);  color: #60a5fa; }
.cd-type-lab     { background: rgba(16,185,129,0.12);  color: #34d399; }
.cd-type-live    { background: rgba(245,158,11,0.12);  color: #fbbf24; }

.cd-lock-icon {
  font-size: 0.68rem;
  color: var(--muted);
  flex-shrink: 0;
  opacity: 0.5;
}
.cd-lesson-title {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-lesson-dur {
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 50px;
}
.cd-no-lessons {
  padding: 12px 28px;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* ===== Job Ready strip in course detail hero ===== */
.cd-job-ready {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(14,165,233,0.07));
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
}
.cd-job-ready span:first-child { font-size: 1rem; }
.cd-job-ready strong {
  color: #10b981;
  font-weight: 700;
  font-size: 0.82rem;
}
.cd-jr-dot {
  color: rgba(255,255,255,0.2);
  font-size: 0.9rem;
}

/* ===== Top Companies Hiring ===== */
.cd-companies {
  margin-top: 14px;
}
.cd-companies-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.cd-companies-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cd-company-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 5px 12px 5px 6px;
  transition: border-color 0.18s, background 0.18s;
}
.cd-company-chip:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
}
.cd-company-logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--gradient);
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cd-company-chip span {
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

/* ===== Salary Trend Chart ===== */
.cd-salary {
  margin-top: 16px;
  background: rgba(16,185,129,0.05);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 12px;
  padding: 14px 16px 10px;
}
.cd-salary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}
.cd-salary-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  margin-bottom: 3px;
}
.cd-salary-sub {
  font-size: 0.7rem;
  color: var(--muted);
}
.cd-hike-badge {
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: #10b981;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  white-space: nowrap;
}
.cd-chart-wrap {
  position: relative;
}
.cd-chart {
  width: 100%;
  height: 80px;
  display: block;
}
.cd-chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px 0;
}
.cd-chart-labels span {
  font-size: 0.65rem;
  color: var(--muted);
}
