/* ================================================
   course-dashboard.css
   ================================================ */

.cd-ambient {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 10% 10%, rgba(255,0,127,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 90%, rgba(99,102,241,0.06) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

.cd-wrap {
  position: relative; z-index: 1;
  max-width: 860px; margin: 0 auto;
  padding: calc(72px + 2.5rem) 1.5rem 5rem;
  min-height: 100vh;
}

/* Loading */
.cd-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
}
.cd-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: rgba(255,0,127,0.8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Header */
.cd-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1.5rem; margin-bottom: 2rem;
  flex-wrap: wrap;
}
.cd-greeting {
  font-size: 0.875rem; color: rgba(255,255,255,0.4);
  margin: 0 0 0.25rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.cd-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 700; color: #fff; margin: 0 0 0.25rem;
}
.cd-tagline {
  font-size: 0.875rem; color: rgba(255,255,255,0.4); margin: 0;
}

/* Progress ring */
.cd-progress-ring-wrap {
  position: relative; width: 80px; height: 80px; flex-shrink: 0;
}
.cd-ring {
  width: 80px; height: 80px; transform: rotate(-90deg);
}
.cd-ring-bg {
  fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 6;
}
.cd-ring-fill {
  fill: none; stroke: #ff007f; stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 213.6;
  stroke-dashoffset: 213.6;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.cd-ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.cd-ring-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 700; color: #fff;
  line-height: 1;
}
.cd-ring-sub {
  font-size: 0.6rem; color: rgba(255,255,255,0.4); margin-top: 1px;
}

/* Stats */
.cd-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin-bottom: 1.75rem;
}
.cd-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 1rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
}
.cd-stat .material-symbols-outlined {
  font-size: 1.2rem; color: rgba(255,0,127,0.7); margin-top: 1px;
}
.cd-stat strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9375rem; font-weight: 600; color: #fff;
  margin-bottom: 0.1rem;
}
.cd-stat span {
  font-size: 0.75rem; color: rgba(255,255,255,0.4);
}

/* CTA row */
.cd-cta-row {
  display: flex; gap: 0.875rem; flex-wrap: wrap; margin-bottom: 2.5rem;
}
.cd-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px; border: none; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.cd-btn:hover { transform: translateY(-1px); }
.cd-btn-primary {
  background: #ff007f; color: #fff;
}
.cd-btn-primary:hover { background: #e6006f; box-shadow: 0 4px 20px rgba(255,0,127,0.3); }
.cd-btn-secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
}
.cd-btn-secondary:hover { background: rgba(255,255,255,0.1); }
.cd-btn-success {
  background: rgba(74,222,128,0.15);
  border: 1px solid rgba(74,222,128,0.3);
  color: #4ade80;
}
.cd-btn-success:hover { background: rgba(74,222,128,0.2); }
.cd-btn .material-symbols-outlined { font-size: 1.1rem; }

/* Units */
.cd-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 1rem;
}
.cd-units { display: flex; flex-direction: column; gap: 0.75rem; }

.cd-unit {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; overflow: hidden;
  transition: border-color 0.2s;
}
.cd-unit.complete { border-color: rgba(74,222,128,0.2); }

.cd-unit-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; cursor: pointer;
  user-select: none;
}
.cd-unit-header:hover { background: rgba(255,255,255,0.02); }

.cd-unit-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.cd-unit.complete .cd-unit-num {
  background: rgba(74,222,128,0.15);
  border-color: rgba(74,222,128,0.3);
  color: #4ade80;
}

.cd-unit-info { flex: 1; min-width: 0; }
.cd-unit-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9375rem; font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-unit-meta {
  font-size: 0.75rem; color: rgba(255,255,255,0.35);
  margin-top: 0.15rem;
}

.cd-unit-bar-wrap {
  width: 80px; flex-shrink: 0;
}
.cd-unit-bar-bg {
  height: 4px; background: rgba(255,255,255,0.07); border-radius: 2px; overflow: hidden;
}
.cd-unit-bar-fill {
  height: 100%; background: #ff007f; border-radius: 2px;
  transition: width 0.8s ease;
}
.cd-unit.complete .cd-unit-bar-fill { background: #4ade80; }

.cd-unit-chevron {
  font-size: 1.1rem; color: rgba(255,255,255,0.25);
  transition: transform 0.25s;
  flex-shrink: 0;
}
.cd-unit.open .cd-unit-chevron { transform: rotate(180deg); }

.cd-unit-lessons {
  display: none; border-top: 1px solid rgba(255,255,255,0.05);
}
.cd-unit.open .cd-unit-lessons { display: block; }

.cd-lesson-row {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 0.75rem 1.25rem 0.75rem 1.5rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  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-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.cd-lesson-check.done {
  background: rgba(74,222,128,0.15);
  border-color: rgba(74,222,128,0.5);
}
.cd-lesson-check .material-symbols-outlined {
  font-size: 0.8rem; color: #4ade80; display: none;
}
.cd-lesson-check.done .material-symbols-outlined { display: block; }

.cd-lesson-title {
  font-size: 0.875rem; color: rgba(255,255,255,0.65);
  flex: 1;
}
.cd-lesson-row:hover .cd-lesson-title { color: rgba(255,255,255,0.9); }
.cd-lesson-duration {
  font-size: 0.75rem; color: rgba(255,255,255,0.25);
}

/* ── Guest view ── */
.cd-guest-hero { margin-bottom: 2rem; }

.cd-guest-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700; color: #fff;
  margin: 0 0 0.5rem;
}
.cd-guest-tagline {
  font-size: 1.0625rem; color: rgba(255,255,255,0.55);
  margin: 0 0 1.25rem;
}
.cd-guest-pills {
  display: flex; flex-wrap: wrap; gap: 0.625rem;
}
.cd-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.375rem 0.875rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500;
  color: rgba(255,255,255,0.7);
}
.cd-pill .material-symbols-outlined { font-size: 0.95rem; color: #ff007f; }

.cd-guest-cta {
  display: flex; gap: 0.875rem; flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.cd-guest-outcomes { margin-bottom: 2.5rem; }
.cd-outcomes-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.625rem;
}
.cd-outcomes-list li {
  display: flex; align-items: flex-start; gap: 0.625rem;
  font-size: 0.9375rem; color: rgba(255,255,255,0.7);
}
.cd-outcomes-list .material-symbols-outlined {
  font-size: 1.05rem; color: #4ade80; margin-top: 2px; flex-shrink: 0;
}

.cd-guest-curriculum {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-bottom: 5rem;
}
.cd-guest-curriculum .cd-section-title { margin-bottom: 0; }

/* Mobile sticky sign-up banner */
.cd-guest-sticky {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #ff007f; z-index: 200;
}
.cd-guest-sticky-link {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 1rem;
  color: #fff; text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9375rem; font-weight: 600;
}
.cd-guest-sticky-link .material-symbols-outlined { font-size: 1.1rem; }

/* Responsive */
@media (max-width: 640px) {
  .cd-stats { grid-template-columns: 1fr 1fr; }
  .cd-header { flex-direction: row; }
  .cd-unit-bar-wrap { display: none; }
}
@media (max-width: 420px) {
  .cd-stats { grid-template-columns: 1fr; }
}
@media (min-width: 641px) {
  .cd-guest-sticky { display: none !important; }
}
