/* ================================================
   Fortschrittsbalken – style.css
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --clr-bg:           #EDEAF8;
  --clr-card:         #FFFFFF;
  --clr-accent:       #4C3FD4;
  --clr-accent-light: #7B70E8;
  --clr-accent-grad:  linear-gradient(90deg, #4C3FD4, #7B70E8);
  --clr-half:         #0E9F6E;
  --clr-track:        #EAE8F7;
  --clr-border:       #E0DCF5;
  --clr-stat-bg:      #F5F3FC;
  --clr-text-primary: #18163A;
  --clr-text-muted:   #9591B8;
  --clr-text-label:   #C4C0DC;
  --clr-banner-month-bg:     #EBF1FF;
  --clr-banner-month-text:   #2D54C8;
  --clr-banner-month-border: #B8CCFB;
  --clr-banner-half-bg:      #E6FAF3;
  --clr-banner-half-text:    #087950;
  --clr-banner-half-border:  #6EE7B7;

  --radius-card:  22px;
  --radius-bar:   12px;
  --radius-stat:  14px;
  --radius-badge: 10px;

  --shadow-card: 0 8px 32px rgba(76, 63, 212, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --clr-bg:           #12102B;
    --clr-card:         #1E1B3A;
    --clr-track:        #2A2650;
    --clr-border:       #312D5A;
    --clr-stat-bg:      #252248;
    --clr-text-primary: #EAE8F7;
    --clr-text-muted:   #6B6898;
    --clr-text-label:   #4A4770;
    --clr-banner-month-bg:     #1A2248;
    --clr-banner-month-text:   #7FA8F8;
    --clr-banner-month-border: #2D4A8A;
    --clr-banner-half-bg:      #0D2B1F;
    --clr-banner-half-text:    #4ADE80;
    --clr-banner-half-border:  #166534;
    --shadow-card: 0 8px 32px rgba(0,0,0,0.35);
  }
}

/* ── Body & Layout ── */
body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--clr-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* ── Card ── */
.card {
  background: var(--clr-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--clr-border);
  padding: 2rem 2.25rem 1.75rem;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-card);
}

/* ── Title ── */
.card__title {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-accent);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ── Banners ── */
.banner {
  display: none;
  border-radius: var(--radius-badge);
  padding: 0.75rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  animation: bannerIn 0.4s ease;
}
.banner--month {
  background: var(--clr-banner-month-bg);
  color: var(--clr-banner-month-text);
  border: 1px solid var(--clr-banner-month-border);
}
.banner--half {
  background: var(--clr-banner-half-bg);
  color: var(--clr-banner-half-text);
  border: 1px solid var(--clr-banner-half-border);
}
.banner.is-visible {
  display: block;
}

@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header Row ── */
.bar__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.bar__date {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--clr-text-muted);
}
.bar__pct {
  font-size: 28px;
  font-weight: 600;
  color: var(--clr-text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ── Progress Bar ── */
.bar__track {
  height: 32px;
  border-radius: var(--radius-bar);
  background: var(--clr-track);
  overflow: hidden;
  border: 1px solid var(--clr-border);
  position: relative;
}
.bar__fill {
  height: 100%;
  border-radius: var(--radius-bar);
  background: var(--clr-accent-grad);
  width: 0%;
  transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 5px;
  position: relative;
}
/* Subtle shimmer on the fill */
.bar__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite linear;
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

/* ── Month Markers ── */
.bar__markers {
  position: relative;
  height: 32px;
  margin-top: 2px;
}
.marker {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.marker__tick {
  width: 1.5px;
  height: 7px;
  border-radius: 2px;
}
.marker__label {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  white-space: nowrap;
  font-weight: 400;
}
.marker--passed .marker__tick  { background: var(--clr-accent); }
.marker--passed .marker__label { color: var(--clr-accent); font-weight: 500; }
.marker--future .marker__tick  { background: var(--clr-text-label); }
.marker--future .marker__label { color: var(--clr-text-label); }
.marker--half   .marker__tick  { background: var(--clr-half); }
.marker--half   .marker__label { color: var(--clr-half); font-weight: 600; }

/* ── Stats Grid ── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 1.1rem;
}
.stat {
  background: var(--clr-stat-bg);
  border-radius: var(--radius-stat);
  padding: 0.75rem 1rem;
  border: 1px solid var(--clr-border);
}
.stat__label {
  font-size: 11px;
  color: var(--clr-text-muted);
  margin-bottom: 5px;
}
.stat__value {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--clr-text-primary);
  font-variant-numeric: tabular-nums;
}

/* ── Footer ── */
.card__footer {
  margin-top: 1.1rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--clr-text-label);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .card {
    padding: 1.25rem 1.1rem 1.25rem;
  }
  .bar__pct {
    font-size: 22px;
  }
  .stat__value {
    font-size: 18px;
  }
  .marker__label {
    font-size: 8.5px;
  }
}
