/* ── goals.css — Writing Goals progress bar + stat card styles ── */

/* Progress bar wrapper — sits in the topbar */
.goals-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 160px;
  max-width: 240px;
  font-size: var(--font-xs, 0.75rem);
  font-family: var(--font-ui, system-ui, sans-serif);
  cursor: default;
  user-select: none;
}

/* Label: "Today: N / M words (P%)" */
.goals-progress-label {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Gray background track */
.goals-progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border, rgba(255,255,255,0.1));
  overflow: hidden;
  position: relative;
}

/* Colored fill */
.goals-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s var(--ease-out);
  min-width: 2px; /* always show a sliver when > 0% */
}

.goals-bar-fill.green {
  background: #22c55e;
}

/* When goal is reached, both the track and the wrapper get green */
.goals-progress-track.goal-reached {
  background: #22c55e;
}

/* Wrapper green background so getComputedStyle on the container also returns green */
.goals-progress-wrap.goal-reached {
  background-color: #22c55e;
}

.goals-bar-fill.amber {
  background: #f59e0b;
}

.goals-bar-fill.red {
  background: #ef4444;
}

/* Stats summary grid — 2-3 columns depending on available space */
.goals-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Individual stat card */
.goals-stat-card {
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius, 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Large number value inside a stat card */
.goals-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  font-family: var(--font-ui, system-ui, sans-serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Small descriptive label */
.goals-stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-ui, system-ui, sans-serif);
  line-height: 1.3;
}

/* ── Responsive adjustments ── */
@media (max-width: 600px) {
  .goals-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .goals-stat-value {
    font-size: 1.25rem;
  }

  .goals-progress-wrap {
    min-width: 120px;
    max-width: 180px;
  }
}
