/**
 * FAST Premium Product Vignettes
 * Source: 10-premium-vignettes.md · 06-dashboard.md · 03-colors.md
 */

/* ─── Base ─── */
.fast-vignette {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: var(--space-3);
  background: var(--color-bg-base);
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 10px;
  line-height: 1.4;
  text-align: left;
}

.fast-vignette__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
}

.fast-vignette__title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.fast-vignette__live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

/* ─── Metrics ─── */
.fast-vignette__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.fast-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-bg-raised);
}

.fast-metric__label {
  font-size: 8px;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fast-metric__value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.fast-metric__delta {
  font-size: 8px;
  font-weight: 500;
  color: var(--color-success);
}

.fast-metric__delta--warn {
  color: var(--color-warning);
}

/* ─── Body grid ─── */
.fast-vignette__body {
  display: grid;
  flex: 1;
  gap: var(--space-2);
  min-height: 0;
}

.fast-vignette__body--split {
  grid-template-columns: 1.2fr 0.8fr;
}

.fast-vignette__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 0;
  padding: var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-bg-raised);
}

.fast-vignette__panel-head {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Live feed ─── */
.fast-live {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}

.fast-live__row {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 9px;
  color: var(--color-text-secondary);
}

.fast-live__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
}

.fast-live__dot--pulse {
  /* static live indicator — no pulse per premium motion spec */
}

.fast-live__time {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ─── Device health ─── */
.fast-device-health {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fast-device-health__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 9px;
}

.fast-device-health__row strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}

.fast-device-health__status--ok {
  color: var(--color-success);
}

.fast-device-health__status--warn {
  color: var(--color-warning);
}

.fast-device-health__meta {
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
  font-size: 8px;
  color: var(--color-text-muted);
}

/* ─── Vignette B: Analytics ─── */
.fast-vignette--analytics {
  padding: var(--space-4);
}

.fast-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.fast-chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 72px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.fast-chart-bar {
  flex: 1;
  min-width: 0;
  border-radius: 3px 3px 0 0;
  background: var(--color-primary);
  opacity: 0.9;
}

.fast-chart-bar:nth-child(1) {
  height: 45%;
  opacity: 0.48;
}
.fast-chart-bar:nth-child(2) {
  height: 62%;
  opacity: 0.64;
}
.fast-chart-bar:nth-child(3) {
  height: 55%;
  opacity: 0.48;
}
.fast-chart-bar:nth-child(4) {
  height: 78%;
  opacity: 0.8;
}
.fast-chart-bar:nth-child(5) {
  height: 88%;
}
.fast-chart-bar:nth-child(6) {
  height: 70%;
  opacity: 0.64;
}
.fast-chart-bar:nth-child(7) {
  height: 92%;
}

.fast-chart__labels {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: var(--color-text-muted);
}

/* ─── Heatmap ─── */
.fast-heatmap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fast-heatmap__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.fast-heatmap__cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--color-primary);
}

.fast-heatmap__cell--1 {
  opacity: 0.12;
}
.fast-heatmap__cell--2 {
  opacity: 0.24;
}
.fast-heatmap__cell--3 {
  opacity: 0.48;
}
.fast-heatmap__cell--4 {
  opacity: 0.64;
}
.fast-heatmap__cell--5 {
  opacity: 0.9;
}

.fast-heatmap__row-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  font-size: 7px;
  color: var(--color-text-muted);
  text-align: center;
}

.fast-heatmap__legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: 8px;
  color: var(--color-text-muted);
}

.fast-heatmap__legend-bar {
  display: flex;
  flex: 1;
  gap: 2px;
  max-width: 120px;
}

.fast-heatmap__legend-bar span {
  flex: 1;
  height: 6px;
  border-radius: 2px;
  background: var(--color-primary);
}

.fast-heatmap__legend-bar span:nth-child(1) {
  opacity: 0.12;
}
.fast-heatmap__legend-bar span:nth-child(2) {
  opacity: 0.24;
}
.fast-heatmap__legend-bar span:nth-child(3) {
  opacity: 0.48;
}
.fast-heatmap__legend-bar span:nth-child(4) {
  opacity: 0.64;
}
.fast-heatmap__legend-bar span:nth-child(5) {
  opacity: 0.9;
}

/* ─── Stagger animation ─── */
.fast-vignette.is-mounted .fast-metric {
  animation: fast-vignette-in var(--duration-normal) var(--ease-out) backwards;
}

.fast-vignette.is-mounted .fast-metric:nth-child(1) {
  animation-delay: 0ms;
}
.fast-vignette.is-mounted .fast-metric:nth-child(2) {
  animation-delay: 50ms;
}
.fast-vignette.is-mounted .fast-metric:nth-child(3) {
  animation-delay: 100ms;
}
.fast-vignette.is-mounted .fast-metric:nth-child(4) {
  animation-delay: 150ms;
}

.fast-vignette.is-mounted .fast-vignette__panel {
  animation: fast-vignette-in var(--duration-slow) var(--ease-out) backwards;
  animation-delay: 200ms;
}

@keyframes fast-vignette-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fast-live__dot--pulse {
    animation: none;
  }

  .fast-vignette.is-mounted .fast-metric,
  .fast-vignette.is-mounted .fast-vignette__panel {
    animation: none;
  }
}

@media (max-width: 767px) {
  .fast-vignette__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fast-vignette__body--split {
    grid-template-columns: 1fr;
  }
}

/* ─── Vignette C: module hover preview ─── */
.fast-vignette--preview {
  padding: var(--space-2);
  font-size: 8px;
  background: var(--color-bg-base);
  border-radius: var(--radius-sm);
}

.fast-vignette--preview .fast-vignette__metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 0;
}

.fast-vignette--preview .fast-metric {
  padding: 4px 6px;
}

.fast-vignette--preview .fast-metric__label {
  font-size: 7px;
}

.fast-vignette--preview .fast-metric__value {
  font-size: 11px;
}

.fast-preview-access {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fast-preview-access__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 8px;
  color: var(--color-text-secondary);
}

.fast-preview-access__row span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 7px;
  color: var(--color-success);
}

.fast-preview-ai {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fast-preview-ai__row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: start;
  font-size: 8px;
  color: var(--color-text-secondary);
}

.fast-preview-ai__tag {
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.fast-preview-ai__tag--warn {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.12);
}

.fast-preview-ai__tag--risk {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.12);
}

/* ─── Hero Operations Dashboard ─── */
.fast-vignette--operations {
  padding: var(--space-4);
  gap: var(--space-3);
}

.fast-vignette__header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fast-vignette__subtitle {
  font-size: 0.85em;
  color: var(--color-text-muted);
}

.fast-vignette__metrics--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.fast-vignette__ops-body {
  display: grid;
  flex: 1;
  grid-template-columns: 1.35fr 0.65fr;
  gap: var(--space-2);
  min-height: 0;
}

.fast-vignette__ops-main {
  display: grid;
  gap: var(--space-2);
  min-height: 0;
}

.fast-vignette__ops-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-2);
  min-height: 0;
}

.fast-vignette__ops-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface);
}

.fast-vignette__ops-mini strong {
  font-family: var(--font-display);
  font-size: 1.1em;
  font-weight: 600;
  color: var(--color-text-primary);
}

.fast-vignette__ops-mini span {
  font-size: 0.85em;
  color: var(--color-text-muted);
}

.fast-vignette__ops-feed {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.fast-live--scroll {
  animation: fast-feed-scroll 24s linear infinite;
}

@keyframes fast-feed-scroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

.fast-vignette__ops-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
}

.fast-ops-footer__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85em;
}

.fast-ops-footer__item span:first-child {
  color: var(--color-text-muted);
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fast-ops-footer__item strong {
  font-weight: 600;
  color: var(--color-text-primary);
}

.fast-ops-footer__item strong.is-ok {
  color: var(--color-success);
}

.fast-chart--compact .fast-chart__bars {
  height: 56px;
}

.fast-heatmap--compact .fast-heatmap__grid {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 767px) {
  .fast-vignette__metrics--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fast-vignette__ops-body {
    grid-template-columns: 1fr;
  }

  .fast-vignette__ops-row {
    grid-template-columns: 1fr;
  }

  .fast-vignette__ops-footer {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fast-live--scroll {
    animation: none;
  }
}
