/**
 * TelccFree — B1/B2 dashboard visual analytics (SVG progress rings)
 * Poppins loaded via <link> in HTML (no @import).
 */

:root {
  --telc-ring-c: 251.2;
  --telc-ring-blue: #1877f2;
  --telc-ring-rose: #e84575;
  --telc-ring-emerald: #10b981;
  --telc-analytics-radius: 24px;
}

@keyframes progress-glow {
  0% {
    stroke-dashoffset: 251.2;
    filter: drop-shadow(0 0 0 transparent);
  }
  70% {
    filter: drop-shadow(0 0 6px currentColor);
  }
  100% {
    filter: drop-shadow(0 0 10px rgba(24, 119, 242, 0.35));
  }
}

.stats-grid--analytics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}

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

@media (min-width: 901px) and (max-width: 1100px) {
  .stats-grid--analytics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid--analytics .stat-card--analytics:last-child {
    grid-column: 1 / -1;
    max-width: calc(50% - 12px);
    justify-self: center;
  }
}

.stat-card--analytics {
  border-radius: var(--telc-analytics-radius);
  padding: 24px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark .stat-card--analytics {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(51, 65, 85, 0.3);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.stat-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.stat-ring-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.stat-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.stat-ring-track {
  fill: transparent;
  stroke: #e2e8f0;
  stroke-width: 8;
  stroke-linecap: round;
}

html.dark .stat-ring-track {
  stroke: rgba(51, 65, 85, 0.5);
}

.stat-ring-fill {
  fill: transparent;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 1.5s ease-out;
}

.stat-ring-fill.is-animating {
  animation: progress-glow 1.5s ease-out forwards;
}

.stat-ring-fill.ring-total {
  stroke: var(--telc-ring-blue);
  color: var(--telc-ring-blue);
}

.stat-ring-fill.ring-done {
  stroke: var(--telc-ring-rose);
  color: var(--telc-ring-rose);
}

.stat-ring-fill.ring-pass {
  stroke: var(--telc-ring-emerald);
  color: var(--telc-ring-emerald);
}

.stat-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.stat-card--analytics .stat-card-val {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1;
  color: #1e293b;
  letter-spacing: -0.02em;
}

html.dark .stat-card--analytics .stat-card-val {
  color: #ffffff;
}

.stat-card--analytics .stat-card-val.val-total {
  color: var(--telc-ring-blue);
}

.stat-card--analytics .stat-card-val.val-done {
  color: var(--telc-ring-rose);
}

.stat-card--analytics .stat-card-val.val-pass {
  color: var(--telc-ring-emerald);
}

.stat-card--analytics .stat-card-lbl {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  line-height: 1.3;
}

html.dark .stat-card--analytics .stat-card-lbl {
  color: #94a3b8;
}

.hero .stats-grid--analytics .stat-card-icon {
  display: none;
}

.sr-only-stat {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .stat-ring-wrap {
    width: 72px;
    height: 72px;
  }

  .stat-card--analytics {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat-ring-fill {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Section header mini analytics rings (B2 dashboard) ── */
.section-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.section-mini-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.section-mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.section-mini-ring-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.section-mini-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.section-mini-ring-svg .stat-ring-track {
  stroke-width: 8;
}

.section-mini-ring-svg .stat-ring-fill {
  stroke-width: 8;
}

.section-mini-val {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  min-width: 0.75em;
  text-align: left;
}

.section-mini-val.val-total {
  color: var(--telc-ring-blue);
}

.section-mini-val.val-done {
  color: var(--telc-ring-rose);
}

.section-mini-val.val-pass {
  color: var(--telc-ring-emerald);
}

@media (max-width: 640px) {
  .section-mini-ring-wrap {
    width: 30px;
    height: 30px;
  }

  .section-mini-val {
    font-size: 10px;
  }

  .section-mini-stats {
    gap: 5px;
  }
}
