/* Premium dashboard — documentation-meets-productivity */

.card {
  background: linear-gradient(145deg, rgba(32, 52, 82, 0.94), rgba(22, 38, 62, 0.88));
  border: 1px solid var(--border);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(0, 120, 212, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--border-bright);
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 0 24px rgba(0, 120, 212, 0.08);
}

.card-span-full {
  grid-column: 1 / -1;
}

.card-span-2 {
  grid-column: span 2;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}

.section-desc {
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Daily motivation */
.daily-motivation-section {
  padding: 1.35rem 1.5rem;
  background: linear-gradient(120deg, rgba(0, 120, 212, 0.18), rgba(183, 148, 246, 0.12));
  border-color: rgba(0, 188, 242, 0.25);
}

.daily-motivation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.daily-motivation-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--azure-light);
}

.daily-motivation-quote {
  margin: 0;
}

.daily-motivation-quote p {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.55;
  color: var(--text-bright);
  font-weight: 500;
}

.daily-motivation-quote footer {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: normal;
}

/* Today's focus */
.today-focus-section {
  padding: 1.25rem 1.5rem;
}

.today-focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.today-focus-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.today-focus-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--azure-light);
  margin-bottom: 0.35rem;
}

.today-focus-value {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.35;
}

.today-focus-meta {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.today-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.today-focus-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Level progress in Study Pulse */
.pulse-level-bar {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.pulse-level-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.pulse-tier {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--azure-bright);
}

.pulse-xp {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.level-progress-track,
.weekly-goal-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.level-progress-fill,
.weekly-goal-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--azure-blue), var(--azure-light));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pulse-level-hint,
.weekly-goal-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Weekly goal */
.weekly-goal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.weekly-goal-pct {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--azure-light);
}

.weekly-goal-status {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.weekly-goal-stats {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem 0.75rem;
}

.weekly-goal-stats li {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.weekly-goal-stats strong {
  color: var(--text-bright);
  font-weight: 600;
}

/* Study heatmap */
.heatmap-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.heatmap-legend-label {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.heatmap-legend-cells {
  display: flex;
  gap: 3px;
}

.heatmap-months {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.35rem;
  padding-left: 0.15rem;
}

.heatmap-month {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.heatmap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: 100%;
}

.heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}

.heatmap-l0 { background: rgba(255, 255, 255, 0.06); }
.heatmap-l1 { background: rgba(0, 120, 212, 0.35); }
.heatmap-l2 { background: rgba(0, 120, 212, 0.55); }
.heatmap-l3 { background: rgba(0, 188, 242, 0.7); }
.heatmap-l4 { background: rgba(0, 188, 242, 0.95); box-shadow: 0 0 6px rgba(0, 188, 242, 0.4); }

/* Milestone states */
.milestone-active .milestone-dot {
  background: rgba(0, 188, 242, 0.35);
  border-color: var(--azure-light);
  box-shadow: 0 0 0 3px rgba(0, 188, 242, 0.2);
  animation: milestone-pulse 2s ease-in-out infinite;
}

.milestone-locked .milestone-dot {
  opacity: 0.45;
}

.milestone-active .milestone-label {
  color: var(--azure-bright);
}

@keyframes milestone-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0, 188, 242, 0.15); }
  50% { box-shadow: 0 0 0 6px rgba(0, 188, 242, 0.28); }
}

/* Topic completion feedback */
@keyframes topic-complete-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.02); background: rgba(110, 231, 160, 0.12); }
  100% { transform: scale(1); }
}

.topic-row.topic-just-done {
  animation: topic-complete-pop 0.65s ease-out;
}

.topic-row.topic-done .topic-label {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: rgba(155, 180, 212, 0.5);
}

/* Achievements */
.achievement {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-height: 5.5rem;
}

.achievement-locked {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.achievement-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.achievement-unlocked {
  opacity: 1;
  filter: none;
  border-color: rgba(0, 188, 242, 0.35);
  background: linear-gradient(145deg, rgba(0, 120, 212, 0.15), rgba(0, 0, 0, 0.15));
}

/* Celebration overlay */
.celebration-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(6, 14, 28, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.celebration-layer.celebration-visible {
  opacity: 1;
  pointer-events: auto;
}

.celebration-card {
  max-width: 26rem;
  padding: 1.75rem 1.5rem;
  text-align: center;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(36, 58, 92, 0.98), rgba(18, 32, 54, 0.98));
  border: 1px solid rgba(0, 188, 242, 0.35);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.celebration-visible .celebration-card {
  transform: translateY(0) scale(1);
}

.celebration-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azure-blue), var(--azure-light));
  font-size: 1.35rem;
  color: #fff;
}

.celebration-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-bright);
}

.celebration-message {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Video — sharp 16:9 */
.video-embed-wrap {
  aspect-ratio: 16 / 9;
  padding-bottom: 0;
  max-width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.video-embed-wrap.video-embed-active {
  background: #000;
}

.video-thumbnail {
  object-fit: cover;
  object-position: center;
  opacity: 0.92;
  image-rendering: auto;
}

.video-facade:hover .video-thumbnail {
  opacity: 1;
}

.video-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-section {
  padding: 1.75rem;
}

/* Lab complete */
.lab-complete-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 120, 212, 0.1);
  border: 1px solid rgba(0, 188, 242, 0.22);
}

.lab-complete-lead {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Overview grid rhythm */
.overview-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.overview-grid-secondary {
  grid-template-columns: repeat(3, 1fr);
}

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

  .overview-grid,
  .overview-grid-secondary {
    grid-template-columns: 1fr;
  }

  .card-span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .heatmap-cell {
    width: 9px;
    height: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .milestone-active .milestone-dot,
  .topic-row.topic-just-done,
  .celebration-card,
  .level-progress-fill,
  .weekly-goal-bar-fill {
    animation: none;
    transition: none;
  }
}
