/* ═══════════════════════════════════════════════════════════════
   Blueprint.gg — Feature Detail Page Styles
   Shared styles for standalone feature pages
   (budget-pacing, ai-insights, quality-scores, search-terms, team-collaboration)
   ═══════════════════════════════════════════════════════════════ */

/* ── Feature Detail Hero ── */
.fd-hero {
  padding-top: calc(var(--nav-height) + var(--space-16));
  padding-bottom: var(--space-12);
  background: var(--color-slate-900);
  color: var(--color-white);
}

.fd-hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}

.fd-hero__content {
  flex: 1;
  max-width: var(--max-w-md);
}

.fd-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--color-teal);
  margin-bottom: var(--space-4);
}

.fd-hero__eyebrow svg {
  flex-shrink: 0;
}

.fd-hero h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
  color: var(--color-white);
}

.fd-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-slate-300);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.fd-hero .hero__ctas {
  margin-bottom: var(--space-6);
}

.fd-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.fd-hero__platform {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-slate-400);
  font-weight: var(--weight-medium);
}

.fd-hero__platform svg {
  flex-shrink: 0;
}

.fd-hero__tier {
  display: inline-flex;
}

/* Ghost button on dark hero */
.fd-hero .btn--ghost {
  color: var(--color-slate-300);
  border: 1px solid var(--color-slate-600);
}

.fd-hero .btn--ghost:hover {
  color: var(--color-white);
  background-color: var(--color-slate-700);
  border-color: var(--color-slate-500);
}

/* ── Hero Dashboard Visual ── */
.fd-hero__visual {
  flex: 1;
  max-width: var(--max-w-lg);
  min-width: 0;
}

.fd-hero-dash {
  background: var(--color-slate-800);
  border: 1px solid var(--color-slate-700);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: 0 20px 40px var(--color-overlay-black-30);
}

.fd-hero-dash__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-slate-700);
}

.fd-hero-dash__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-slate-300);
}

.fd-hero-dash__title--flex {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* KPI Row */
.fd-hero-dash__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.fd-hero-dash__kpi {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  background: var(--color-slate-900);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-slate-700);
}

.fd-hero-dash__kpi-label {
  font-size: var(--text-3xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--color-slate-500);
  white-space: nowrap;
}

.fd-hero-dash__kpi-value {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  font-family: var(--font-body);
  color: var(--color-white);
  line-height: 1;
  white-space: nowrap;
}

.fd-hero-dash__kpi-sub {
  font-size: var(--text-3xs);
  color: var(--color-slate-500);
}

.fd-hero-dash__kpi-sub--success {
  color: var(--color-success-text);
}

.fd-hero-dash__kpi-sub--warning {
  color: var(--color-warning);
}

.fd-hero-dash__kpi--status {
  justify-content: flex-start;
  align-items: center;
  text-align: center;
}

.fd-hero-dash__status-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-3xs);
  font-weight: var(--weight-semibold);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  width: fit-content;
}

.fd-hero-dash__status-badge--success {
  background: var(--color-success-15);
  color: var(--color-success);
}

.fd-hero-dash__status-badge--warning {
  background: var(--color-warning-15);
  color: var(--color-warning);
}

/* Mini Chart */
.fd-hero-dash__chart {
  background: var(--color-slate-900);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-slate-700);
  padding: var(--space-3);
}

.fd-hero-dash__chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.fd-hero-dash__chart-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-slate-400);
}

.fd-hero-dash__chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.fd-hero-dash__legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-3xs);
  color: var(--color-slate-500);
}

.fd-hero-dash__legend-item::before {
  content: '';
  display: block;
  width: var(--space-3);
  height: 2px;
  border-radius: 1px;
}

.fd-hero-dash__legend-item--actual::before {
  background: var(--color-teal);
}

.fd-hero-dash__legend-item--ideal::before {
  background: var(--color-slate-500);
  border-top: 1px dashed var(--color-slate-500);
  height: 0;
  border-width: 2px;
}

.fd-hero-dash__chart-area {
  position: relative;
  height: var(--space-32); /* mockup-specific — chart area height (8rem, nearest base-4) */
}

.fd-hero-dash__chart-svg {
  width: 100%;
  height: 100%;
}

.fd-hero-dash__chart-y {
  position: absolute;
  top: 0;
  left: 0;
  bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: var(--text-3xs);
  font-family: var(--font-body);
  color: var(--color-slate-600);
  pointer-events: none;
}

.fd-hero-dash__chart-x {
  position: absolute;
  bottom: 0;
  left: var(--space-8);
  right: var(--space-4);
  display: flex;
  justify-content: space-between;
  font-size: var(--text-3xs);
  font-family: var(--font-body);
  color: var(--color-slate-600);
  pointer-events: none;
}

/* KPI Row — 3-column variant */
.fd-hero-dash__kpis--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* KPI value color modifiers */
.fd-hero-dash__kpi-value--warning {
  color: var(--color-warning);
}

.fd-hero-dash__kpi-sub--danger {
  color: var(--color-danger);
}

/* Chart padding override */
.fd-hero-dash__chart--padded {
  padding: var(--space-4);
}

/* Chart header spacing override */
.fd-hero-dash__chart-header--snug {
  margin-bottom: var(--space-3);
}

/* ── Quality Scores Hero Dashboard ── */
.fd-qs-distribution {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.fd-qs-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.fd-qs-row__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fd-qs-row__label {
  font-size: var(--text-xs);
  color: var(--color-slate-400);
  font-weight: var(--weight-medium);
}

.fd-qs-row__count {
  font-size: var(--text-3xs);
  color: var(--color-slate-500);
}

.fd-qs-row__track {
  height: var(--space-2);
  background: var(--color-slate-700);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.fd-qs-row__fill {
  width: var(--bar-w, 0%);
  height: 100%;
  border-radius: var(--radius-full);
}

.fd-qs-row__fill--success { background: var(--color-success-text); }
.fd-qs-row__fill--teal { background: var(--color-teal); }
.fd-qs-row__fill--warning { background: var(--color-warning); }
.fd-qs-row__fill--danger { background: var(--color-danger); }

/* ── Search Terms Hero Dashboard ── */
.fd-st-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.fd-st-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.fd-st-bar-row__label {
  font-size: var(--text-xs);
  color: var(--color-slate-400);
  width: 5.5rem; /* mockup-specific — label column width */
  text-align: right;
  flex-shrink: 0;
}

.fd-st-bar-row__track {
  flex: 1;
  height: var(--icon-sm);
  background: var(--color-slate-800);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.fd-st-bar-row__fill {
  width: var(--bar-w, 0%);
  height: 100%;
  background: var(--color-danger);
  border-radius: var(--radius-sm);
  opacity: 0.85;
}

.fd-st-bar-row__value {
  font-size: var(--text-xs);
  color: var(--color-slate-300);
  width: var(--size-icon-box); /* mockup-specific — value column width */
  flex-shrink: 0;
}

/* ── AI Insights Hero Dashboard ── */
.fd-ai-insights {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fd-ai-insight {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-slate-900);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-slate-700);
}

.fd-ai-insight__dot {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: var(--space-1);
}

.fd-ai-insight__dot--danger { background: var(--color-danger); }
.fd-ai-insight__dot--warning { background: var(--color-warning); }
.fd-ai-insight__dot--info { background: var(--color-info); }

.fd-ai-insight__body {
  flex: 1;
  min-width: 0;
}

.fd-ai-insight__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-slate-200);
  margin-bottom: var(--space-1);
}

.fd-ai-insight__desc {
  font-size: var(--text-3xs);
  color: var(--color-slate-400);
  line-height: var(--leading-relaxed);
}

.fd-ai-insight__severity {
  flex-shrink: 0;
  font-size: var(--text-3xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.fd-ai-insight__severity--critical {
  background: var(--color-danger-15);
  color: var(--color-danger);
}

.fd-ai-insight__severity--high {
  background: var(--color-warning-15);
  color: var(--color-warning);
}

.fd-ai-insight__severity--medium {
  background: var(--color-blue-15);
  color: var(--color-info);
}

/* ── Team Collaboration Hero Dashboard ── */
.fd-tc-invite-btn {
  font-size: var(--text-3xs);
  font-weight: var(--weight-semibold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-teal-15);
  color: var(--color-teal);
  cursor: default;
}

.fd-tc-member-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fd-tc-member {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-slate-900);
  border: 1px solid var(--color-slate-700);
  border-radius: var(--radius-md);
}

.fd-tc-member--pending {
  border-style: dashed;
  border-color: var(--color-slate-600);
  opacity: 0.75;
}

/* Avatar base structure + color variants → components.css */
.fd-tc-avatar {
  width: var(--space-8);
  height: var(--space-8);
  font-size: var(--text-xs);
}

.fd-tc-member__info {
  flex: 1;
  min-width: 0;
}

.fd-tc-member__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-slate-200);
}

.fd-tc-member__email {
  font-size: var(--text-3xs);
  color: var(--color-slate-500);
}

.fd-tc-role-badge {
  font-size: var(--text-3xs);
  font-weight: var(--weight-semibold);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: var(--tracking-snug);
}

.fd-tc-role-badge--owner {
  background: var(--color-teal-15);
  color: var(--color-teal);
}

.fd-tc-role-badge--manager {
  background: var(--color-indigo-15);
  color: var(--color-indigo);
}

.fd-tc-role-badge--analyst {
  background: var(--color-warning-15);
  color: var(--color-warning);
}

.fd-tc-role-badge--viewer {
  background: var(--color-success-15);
  color: var(--color-success);
}

.fd-tc-you-badge {
  font-size: var(--text-3xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-slate-700);
  color: var(--color-slate-300);
}

.fd-tc-free-badge {
  font-size: var(--text-3xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-slate-700);
  color: var(--color-slate-400);
}

.fd-tc-expires {
  font-size: var(--text-3xs);
  font-weight: var(--weight-medium);
  color: var(--color-success);
}

/* Platform font-style override */
.fd-hero__platform--normal {
  font-style: normal;
}

/* Platforms wrapper width override */
.fd-platforms__wrapper--wide {
  max-width: var(--max-w-5xl);
}

/* ── How It Works Section ── */
.fd-how {
  background: var(--color-slate-50);
}

.fd-how__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.fd-how__card {
  background: var(--color-white);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.fd-how__card-icon {
  width: var(--space-10);
  height: var(--space-10);
  border-radius: var(--radius-md);
  background: var(--color-teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-teal);
  margin-bottom: var(--space-4);
}

.fd-how__card-icon svg {
  width: var(--space-5);
  height: var(--space-5);
}

.fd-how__card h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-slate-900);
  margin-bottom: var(--space-2);
}

.fd-how__card p {
  font-size: var(--text-sm);
  color: var(--color-slate-500);
  line-height: var(--leading-relaxed);
}

/* ── Capabilities List Section ── */
.fd-capabilities__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.fd-capabilities__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.fd-capabilities__icon {
  flex-shrink: 0;
  width: var(--space-10);
  height: var(--space-10);
  border-radius: var(--radius-md);
  background: var(--color-teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-teal);
}

.fd-capabilities__icon svg {
  width: var(--space-5);
  height: var(--space-5);
}

.fd-capabilities__item h3 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-slate-900);
  margin-bottom: var(--space-1);
}

.fd-capabilities__item p {
  font-size: var(--text-sm);
  color: var(--color-slate-500);
  line-height: var(--leading-relaxed);
}

/* ── Platform Support Table ── */
.fd-platforms__wrapper {
  max-width: var(--max-w-3xl);
  margin-inline: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-xl);
}

.fd-platforms__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.fd-platforms__table th {
  background: var(--color-white);
  padding: var(--space-4) var(--space-5);
  font-weight: var(--weight-semibold);
  text-align: center;
  border-bottom: 2px solid var(--color-slate-200);
  white-space: nowrap;
}

.fd-platforms__table th:first-child {
  text-align: left;
  width: 40%;
}

.fd-platforms__table td {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-slate-100);
  text-align: center;
  color: var(--color-slate-600);
}

.fd-platforms__table td:first-child {
  text-align: left;
  color: var(--color-slate-700);
  font-weight: var(--weight-medium);
}

.fd-platforms__table tr:last-child td {
  border-bottom: none;
}

.fd-platforms__table .check {
  color: var(--color-teal);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
}

.fd-platforms__table .cross {
  color: var(--color-slate-500);
  font-size: var(--text-lg);
}

/* ── Feature FAQ Section ── */
.fd-faq {
  background: var(--color-slate-50);
}

.fd-faq .faq__list {
  max-width: var(--max-w-5xl);
  margin-inline: auto;
}

/* ── Related Features Section ── */
.fd-related__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.fd-related__card {
  background: var(--color-white);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-decoration: none;
  transition: box-shadow var(--duration-base) var(--ease-default),
              border-color var(--duration-base) var(--ease-default);
  display: flex;
  flex-direction: column;
}

.fd-related__card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-teal);
  color: inherit;
}

.fd-related__card:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

.fd-related__card-icon {
  width: var(--space-10);
  height: var(--space-10);
  border-radius: var(--radius-md);
  background: var(--color-teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-teal);
  margin-bottom: var(--space-4);
}

.fd-related__card-icon svg {
  width: var(--space-5);
  height: var(--space-5);
}

.fd-related__card h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-slate-900);
  margin-bottom: var(--space-2);
}

.fd-related__card p {
  font-size: var(--text-sm);
  color: var(--color-slate-500);
  line-height: var(--leading-relaxed);
  flex: 1;
}

.fd-related__card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-teal);
  margin-top: var(--space-4);
}

.fd-related__card:hover .fd-related__card-link {
  color: var(--color-teal-hover);
}

/* ── Responsive ── */

@media (max-width: 1023px) {
  .fd-hero .container {
    flex-direction: column;
    text-align: center;
  }

  .fd-hero__content {
    max-width: none;
  }

  .fd-hero .hero__ctas {
    justify-content: center;
  }

  .fd-hero__meta {
    justify-content: center;
  }

  .fd-hero h1 {
    font-size: var(--text-4xl);
  }

  .fd-hero__visual {
    max-width: var(--max-w-sm);
    width: 100%;
  }

  .fd-how__grid {
    grid-template-columns: 1fr;
  }

  .fd-capabilities__grid {
    grid-template-columns: 1fr;
  }

  .fd-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .fd-hero {
    padding-top: calc(var(--nav-height) + var(--space-12));
    padding-bottom: var(--space-10);
  }

  .fd-hero h1 {
    font-size: var(--text-3xl);
  }

  .fd-hero__subtitle {
    font-size: var(--text-base);
  }

  .fd-hero__visual {
    max-width: none;
  }

  .fd-hero-dash__kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .fd-platforms__table {
    font-size: var(--text-xs);
  }

  .fd-platforms__table th,
  .fd-platforms__table td {
    padding: var(--space-2) var(--space-3);
  }

  .fd-related__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 639px) {
  .fd-hero h1 {
    font-size: var(--text-2xl);
  }

  .fd-hero-dash__kpi-value {
    font-size: var(--text-base);
  }
}
