/* ============================================================
   VIEW STYLES - journal, progress and collection surfaces
   ------------------------------------------------------------
   Split out of the original 3,093-line css/components.css on
   2026-08-29. The seven files are loaded in their original
   source order, so the cascade is byte-for-byte unchanged:
     layout -> components -> views-content -> views-cards
     -> overlays -> views-progress -> utilities
   Section numbers below are the original components.css numbering.

     19. Reflection journal
     20. Skeleton / loading states
     21. Topic grid
     22. Learning path card
     23. Progress & analytics
     24. Achievements view
   ============================================================ */

/* ──────────────────────────────────────────
   19. REFLECTION JOURNAL
   ────────────────────────────────────────── */

.reflection-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.reflection-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.reflection-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.reflection-date {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.reflection-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.mood-indicator {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.mood-indicator[data-mood="great"]   { background: var(--accent-emerald); box-shadow: 0 0 6px rgba(52, 211, 153, 0.5); }
.mood-indicator[data-mood="good"]    { background: var(--accent-blue); box-shadow: 0 0 6px rgba(96, 165, 250, 0.5); }
.mood-indicator[data-mood="neutral"] { background: var(--text-muted); }
.mood-indicator[data-mood="rough"]   { background: var(--accent-gold); }
.mood-indicator[data-mood="bad"]     { background: var(--accent-red); }

.journal-entry {
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
}

.journal-entry.collapsed {
  max-height: 80px;
  overflow: hidden;
  position: relative;
}

.journal-entry.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--surface));
}

.reflection-expand-btn {
  width: 100%;
  padding: var(--space-3);
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  text-align: center;
}

.reflection-expand-btn:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

/* Journal Compose */
.journal-compose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.journal-compose:focus-within {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
}

.journal-textarea {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: var(--leading-loose);
  resize: none;
  min-height: 120px;
  font-family: var(--font-sans);
}

.journal-textarea::placeholder {
  color: var(--text-muted);
}


/* ──────────────────────────────────────────
   20. SKELETON / LOADING STATES
   ────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-overlay) 25%,
    rgba(255, 255, 255, 0.04) 50%,
    var(--surface-overlay) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 14px;
  width: 100%;
  border-radius: var(--radius-sm);
}

.skeleton-text.w-3-4 { width: 75%; }
.skeleton-text.w-2-3 { width: 66%; }
.skeleton-text.w-half { width: 50%; }
.skeleton-text.w-1-3 { width: 33%; }

.skeleton-title {
  height: 24px;
  width: 60%;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.skeleton-card {
  height: 160px;
  width: 100%;
  border-radius: var(--radius-lg);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.skeleton-line {
  height: 1px;
  width: 100%;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* Loading spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

/* Full page loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  z-index: 999;
}

.page-loader-logo {
  font-size: 40px;
  animation: pulse 2s infinite;
}

.page-loader-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}


/* ──────────────────────────────────────────
   21. TOPIC GRID
   ────────────────────────────────────────── */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  position: relative;
  overflow: hidden;
}

.topic-card:hover {
  border-color: var(--topic-card-color, var(--accent));
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.topic-card-stripe {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--topic-card-color, var(--accent));
  border-radius: 0;
}

.topic-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-3);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.topic-card-name {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  text-transform: capitalize;
}

.topic-card-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mastery level indicator */
.mastery-level {
  display: flex;
  gap: 3px;
  margin-bottom: var(--space-3);
}

.mastery-pip {
  height: 4px;
  flex: 1;
  background: var(--surface-overlay);
  border-radius: var(--radius-full);
  transition: background var(--transition);
}

.mastery-pip.filled {
  background: var(--topic-card-color, var(--accent));
}

.topic-lessons-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}


/* ──────────────────────────────────────────
   22. LEARNING PATH CARD
   ────────────────────────────────────────── */

.path-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.path-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--path-color-start, var(--accent)), var(--path-color-end, var(--accent-blue)));
}

.path-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.path-icon {
  font-size: 36px;
  margin-bottom: var(--space-4);
}

.path-name {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: var(--leading-tight);
}

.path-description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-5);
}

.path-meta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.path-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: var(--font-medium);
}

.path-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}


/* ──────────────────────────────────────────
   23. PROGRESS & ANALYTICS
   ────────────────────────────────────────── */

.chart-container {
  position: relative;
  width: 100%;
  min-height: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.chart-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

/* Skill radar */
.radar-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ──────────────────────────────────────────
   24. ACHIEVEMENTS VIEW
   ────────────────────────────────────────── */

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.achievement-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  gap: var(--space-4);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.achievement-card.unlocked {
  border-color: var(--border-strong);
}

.achievement-card.locked {
  opacity: 0.55;
}

.achievement-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}

.achievement-info {
  flex: 1;
  min-width: 0;
}

.achievement-name {
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.achievement-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.achievement-unlock-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Achievement unlock celebration overlay */
.achievement-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-toast) + 10);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.achievement-unlock-popup {
  background: var(--surface-raised);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-2xl);
  padding: var(--space-8) var(--space-10);
  text-align: center;
  box-shadow: 0 0 60px rgba(251, 191, 36, 0.2), var(--shadow-xl);
  animation: bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}

.unlock-label {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-3);
}

.unlock-icon {
  font-size: 56px;
  margin-bottom: var(--space-4);
  animation: spin 1s ease;
}

.unlock-name {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.unlock-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

