/**
 * gated-utilities.css — Modular Gating Contract (Epic 10) shared styles.
 *
 * Consolidates all gated-field rendering: blur containers, lock overlays,
 * upgrade CTAs, teaser skeleton shapes, and status banners.
 * Consumed by gatable-renderer.js and any page that renders GatableResponse.
 */

/* ── Blur container ─────────────────────────────────────────────────────── */

.gated-blur-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md, 8px);
}

.gated-blur-wrap__content {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
}

/* ── Lock overlay ───────────────────────────────────────────────────────── */

.gated-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
  border-radius: inherit;
  text-align: center;
  padding: 12px;
}

.gated-lock-overlay__icon {
  font-size: 20px;
  line-height: 1;
}

.gated-lock-overlay__label {
  font-size: var(--font-size-sm, 12px);
  font-weight: 600;
  color: var(--color-text-primary, #0f172a);
  margin: 0;
  line-height: 1.3;
}

.gated-lock-overlay__sublabel {
  font-size: var(--font-size-xs, 11px);
  color: var(--color-text-tertiary, #94a3b8);
  margin: 0;
}

/* ── Upgrade CTA button ─────────────────────────────────────────────────── */

.gated-upgrade-btn {
  display: inline-block;
  padding: 5px 12px;
  font-size: var(--font-size-xs, 11px);
  font-weight: 600;
  color: #fff;
  background: var(--color-accent, #2563eb);
  border: none;
  border-radius: var(--radius-sm, 4px);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.gated-upgrade-btn:hover,
.gated-upgrade-btn:focus-visible {
  background: var(--color-accent-hover, #1d4ed8);
  outline: 2px solid var(--color-accent, #2563eb);
  outline-offset: 2px;
}

/* ── Status banner (PARTIAL / LOCKED) ───────────────────────────────────── */

.gated-status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid;
}

.gated-status-banner--partial {
  background: var(--color-status-info-bg);
  border-color: var(--color-status-info-border);
  color: var(--color-status-info-text);
}

.gated-status-banner--locked {
  background: var(--color-status-warning-bg);
  border-color: var(--color-status-warning-border);
  color: var(--color-status-warning-text);
}

.gated-status-banner__icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gated-status-banner--partial .gated-status-banner__icon {
  background: var(--color-status-info-bg);
  color: var(--color-status-info-text);
}

.gated-status-banner--locked .gated-status-banner__icon {
  background: var(--color-status-warning-bg);
  color: var(--color-status-warning-text);
}

.gated-status-banner__body {
  flex: 1;
  min-width: 0;
}

.gated-status-banner__title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 2px;
}

.gated-status-banner__text {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.8;
  margin: 0;
}

/* ── Skeleton shapes (teaser placeholders) ──────────────────────────────── */

.gated-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

/* Shared shimmer animation */
@keyframes gated-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.gated-skeleton__bar,
.gated-skeleton__circle,
.gated-skeleton__card,
.gated-skeleton__line,
.gated-skeleton__chart {
  background: linear-gradient(90deg, var(--color-surface-subtle) 25%, var(--color-surface-inset) 50%, var(--color-surface-subtle) 75%);
  background-size: 800px 100%;
  animation: gated-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm, 4px);
}

/* SCORE_BARS — horizontal bar skeleton rows */
.gated-skeleton--score-bars {
  gap: 8px;
}

.gated-skeleton--score-bars .gated-skeleton__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gated-skeleton--score-bars .gated-skeleton__label {
  flex: 0 0 120px;
  height: 10px;
  background: linear-gradient(90deg, var(--color-surface-subtle) 25%, var(--color-surface-inset) 50%, var(--color-surface-subtle) 75%);
  background-size: 800px 100%;
  animation: gated-shimmer 1.4s ease-in-out infinite;
  border-radius: 2px;
}

.gated-skeleton--score-bars .gated-skeleton__bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
}

.gated-skeleton--score-bars .gated-skeleton__value {
  flex: 0 0 28px;
  height: 10px;
  background: linear-gradient(90deg, var(--color-surface-subtle) 25%, var(--color-surface-inset) 50%, var(--color-surface-subtle) 75%);
  background-size: 800px 100%;
  animation: gated-shimmer 1.4s ease-in-out infinite;
  border-radius: 2px;
}

/* DISTRIBUTION_CURVE — bell curve area placeholder */
.gated-skeleton--distribution-curve .gated-skeleton__chart {
  height: 80px;
  border-radius: var(--radius-md, 8px);
}

/* BEFORE_AFTER — two side-by-side metric cards */
.gated-skeleton--before-after {
  flex-direction: row;
  gap: 12px;
}

.gated-skeleton--before-after .gated-skeleton__card {
  flex: 1;
  height: 80px;
  border-radius: var(--radius-md, 8px);
}

/* TIMELINE_GRAPH — line chart area placeholder */
.gated-skeleton--timeline-graph .gated-skeleton__chart {
  height: 120px;
  border-radius: var(--radius-md, 8px);
}

/* CHECKLIST — stacked item rows */
.gated-skeleton--checklist {
  gap: 8px;
}

.gated-skeleton--checklist .gated-skeleton__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gated-skeleton--checklist .gated-skeleton__checkbox {
  flex: 0 0 14px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-surface-subtle) 25%, var(--color-surface-inset) 50%, var(--color-surface-subtle) 75%);
  background-size: 800px 100%;
  animation: gated-shimmer 1.4s ease-in-out infinite;
}

.gated-skeleton--checklist .gated-skeleton__line {
  flex: 1;
  height: 10px;
}

/* METRIC_CARDS — row of small metric tiles */
.gated-skeleton--metric-cards {
  flex-direction: row;
  gap: 10px;
}

.gated-skeleton--metric-cards .gated-skeleton__card {
  flex: 1;
  height: 64px;
  border-radius: var(--radius-md, 8px);
}

/* TILE_GRID — 2×N grid of tile placeholders */
.gated-skeleton--tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gated-skeleton--tile-grid .gated-skeleton__card {
  height: 88px;
  border-radius: var(--radius-md, 8px);
}

/* ── Respect reduced-motion preference ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .gated-skeleton__bar,
  .gated-skeleton__circle,
  .gated-skeleton__card,
  .gated-skeleton__line,
  .gated-skeleton__chart,
  .gated-skeleton__label,
  .gated-skeleton__value,
  .gated-skeleton__checkbox {
    animation: none;
    background: var(--color-surface-subtle);
  }
}
