/*
 * statsPanel.css — Career Copilot v0.4.0
 * Modern SaaS layout — full width, no squeezing, every device
 * Prefix: .stp-* — zero conflict
 * Tokens: exact variables.css
 */

/* ── Keyframes ────────────────────────────────────────────────────────────── */

@keyframes stp-up {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0);    }
}

@keyframes stp-bar {
  from { width:0 }
  to   { width:var(--stp-w,0%) }
}

@keyframes stp-pulse {
  0%  { transform:scale(.85); opacity:.8; }
  70% { transform:scale(1.9); opacity:0;  }
  100%{ transform:scale(.85); opacity:0;  }
}

@keyframes stp-shimmer {
  0%   { background-position:-200% 0 }
  100% { background-position: 200% 0 }
}

@keyframes stp-fade-row {
  from { opacity:0; transform:translateX(-6px); }
  to   { opacity:1; transform:translateX(0);    }
}

/* ── Home page layout — full width stacked ───────────────────────────────── */
/* Hero full width → stats panel full width → feature cards full width       */

.home-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-layout__left  { width: 100%; }
.home-layout__right { width: 100%; }

/* ── Stats panel root ────────────────────────────────────────────────────── */

#stats-panel-root {
  width: 100%;
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
}

.stp-panel { width: 100%; }

/* ── Live badge ──────────────────────────────────────────────────────────── */

.stp-live-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  opacity: 0;
  animation: stp-up 0.4s ease forwards;
}

.stp-live-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
}

.stp-live-dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: var(--color-green);
  animation: stp-pulse 2.4s ease-out infinite;
}

.stp-live-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Top counters — 3 big cards full width ───────────────────────────────── */

.stp-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.stp-counter {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5) var(--space-5);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: stp-up 0.5s cubic-bezier(.22,1,.36,1) forwards;
  animation-delay: var(--stp-i, 0s);
}

/* Colored top accent line */
.stp-counter::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stp-ac, var(--color-accent));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stp-counter__num {
  font-size: 42px;
  font-weight: var(--weight-black);
  color: var(--color-text-primary);
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-2);
}

.stp-counter__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.stp-counter__bar {
  height: 3px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.stp-counter__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--stp-ac, var(--color-accent));
  width: 0;
}

.stp-counter__fill--go {
  animation: stp-bar 1s cubic-bezier(.4,0,.2,1) forwards;
  animation-delay: var(--stp-bd, .3s);
}

/* ── Bottom row — model usage + activity ─────────────────────────────────── */

.stp-bottom {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.8fr);
  gap: var(--space-4);
}

.stp-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  opacity: 0;
  animation: stp-up 0.5s cubic-bezier(.22,1,.36,1) forwards;
  animation-delay: var(--stp-i, 0s);
}

.stp-card__head {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: var(--space-4);
}

/* ── Model bars ──────────────────────────────────────────────────────────── */

.stp-models { display:flex; flex-direction:column; gap:14px; }

.stp-model-row { display:flex; align-items:center; gap:10px; }

.stp-model-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--stp-mc);
  flex-shrink: 0;
}

.stp-model-name {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  width: 100px;
  flex-shrink: 0;
}

.stp-model-track {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.stp-model-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--stp-mc);
  width: 0;
}

.stp-model-fill--go {
  animation: stp-bar 0.9s cubic-bezier(.4,0,.2,1) forwards;
  animation-delay: var(--stp-bd, .5s);
}

.stp-model-pct {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  min-width: 32px;
  text-align: right;
}

/* ── Activity feed ───────────────────────────────────────────────────────── */

.stp-feed { display:flex; flex-direction:column; }

.stp-feed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  opacity: 0;
  animation: stp-fade-row 0.4s ease forwards;
  animation-delay: var(--stp-i, 0s);
}

.stp-feed-row:last-child { border-bottom:none; padding-bottom:0; }

.stp-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items:center; justify-content:center;
  font-size: 11px; font-weight: var(--weight-bold);
  flex-shrink: 0;
}

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

.stp-feed-role {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  white-space: nowrap; overflow:hidden; text-overflow:ellipsis;
}

.stp-feed-action {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 1px;
}

.stp-badge {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  white-space: nowrap;
}

.stp-time {
  font-size: 10px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Empty states ────────────────────────────────────────────────────────── */

.stp-empty-msg {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-4) 0;
}

.stp-no-data {
  display: flex; flex-direction:column;
  align-items:center; justify-content:center;
  text-align:center;
  padding: var(--space-10) var(--space-6);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  min-height: 220px;
  position: relative;
}

.stp-no-data__ring {
  position: absolute;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 1.5px solid var(--color-green);
  animation: stp-pulse 2.4s ease-out infinite;
  opacity: .25;
}

.stp-no-data__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2);
  position: relative;
}

.stp-no-data__sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0; line-height:1.6;
  position: relative;
}

/* ── Skeleton ────────────────────────────────────────────────────────────── */

.stp-sk {
  border-radius: var(--radius);
  background: linear-gradient(90deg,
    var(--color-border) 25%,
    var(--color-border-strong) 50%,
    var(--color-border) 75%);
  background-size: 200% 100%;
  animation: stp-shimmer 1.5s ease-in-out infinite;
}

.stp-sk--num  { height:44px; width:50%; margin-bottom:var(--space-2); }
.stp-sk--lbl  { height:12px; width:70%; margin-bottom:var(--space-4); }
.stp-sk--bar  { height:3px; width:100%; border-radius:var(--radius-full); }
.stp-sk--row  { height:20px; width:100%; margin-bottom:var(--space-3); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* Tablet — stack bottom row */
@media (max-width: 768px) {
  .stp-bottom {
    grid-template-columns: minmax(0,1fr);
  }
}

/* Mobile — 2 col counters */
@media (max-width: 600px) {
  .stp-counters {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .stp-counter__num { font-size: 32px; }
}

/* Small mobile — 1 col */
@media (max-width: 380px) {
  .stp-counters { grid-template-columns: minmax(0,1fr); }
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */

[data-theme="dark"] .stp-counter,
[data-theme="dark"] .stp-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .stp-counter__bar,
[data-theme="dark"] .stp-model-track {
  background: var(--color-border);
}

[data-theme="dark"] .stp-feed-row {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .stp-sk {
  background: linear-gradient(90deg,
    var(--color-border) 25%,
    var(--color-border-strong) 50%,
    var(--color-border) 75%);
  background-size: 200% 100%;
}
