/**
 * Dashboard shared styles — used by all category data pages (569, 570, 406,
 * 578, 588, 589, 590, 613, 614, 615, 409) and the front page data ribbon.
 *
 * @package ABTdomain
 */

/* ==========================================================================
   Layout
   ========================================================================== */

.dashboard {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.dashboard-header {
  padding: 40px 0 32px;
  text-align: center;
}

.dashboard-header h1 .dashboard-heading-accent {
  color: var(--signal);
}

.dashboard-header > p {
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
  font-size: var(--fs-13);
  color: var(--ink-soft);
}

.dashboard-header h1 {
  font-size: var(--fs-28);
  font-weight: 800;
  margin-bottom: 8px;
}

.dashboard-header p {
  font-size: var(--fs-13);
  color: var(--ink-soft);
  max-width: 640px;
  line-height: 1.7;
}

.dashboard-section {
  padding-bottom: var(--section-gap);
}

.dashboard-section h2 {
  font-size: var(--fs-22);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  text-align: center;
}

.dashboard-section > p {
  font-size: var(--fs-13);
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* Centered section variant: used when a dashboard-section is a narrative block
   rather than a data table. Centers heading/paragraph and caps line length. */
.dashboard-section-center {
  text-align: center;
}

.dashboard-section-center > p {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero header variant: overrides default padding for front-page layout. */
.dashboard-header-hero {
  padding: 28px 0;
}

.dashboard-header-hero > p {
  max-width: 680px;
}

/* Small muted caption under stat ribbons / charts */
.dashboard-caption {
  text-align: center;
  font-size: var(--fs-11);
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 8px;
}

.dashboard-caption a {
  color: var(--muted);
  text-decoration: underline;
}

/* Centered sub-heading used inside dashboard-section above the content body */
.dashboard-section-intro {
  max-width: 600px;
  margin: 0 auto 24px;
  font-size: var(--fs-13);
  color: var(--ink-soft);
  line-height: 1.7;
}

.dashboard-section-footer {
  text-align: center;
  margin-top: 24px;
}

/* Empty-state message inside any dashboard block */
.dashboard-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-13);
}

/* Empty section placeholder (large padding variant) */
.dashboard-section-empty {
  text-align: center;
  padding: 80px 0;
}

.dashboard-section-empty p {
  color: var(--muted);
}

/* Lifecycle breadcrumb label above category-page headers */
.lifecycle-label {
  font-size: var(--fs-11);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* Narrow wrapper for a pie / doughnut chart that should not span the full width */
.chart-narrow {
  max-width: 480px;
  margin: 0 auto;
}

/* Caption paragraph that appears directly below a chart */
.chart-caption {
  text-align: center;
  font-size: var(--fs-13);
  color: var(--ink-soft);
  margin-top: 8px;
}

.chart-caption-muted {
  color: var(--muted);
  margin-top: 12px;
}

/* Feature card big value that is a long string (e.g. domain name),
   wraps with word-break and drops to a smaller size */
.feature-card-value-break {
  font-size: var(--fs-15);
  word-break: break-all;
}

/* Intelligence callout: narrative context block inside a dashboard-section */
.intelligence-callout {
  max-width: 640px;
  margin: 0 auto 24px;
  padding: 16px 20px;
  background: var(--paper-deep);
  border-left: 3px solid var(--signal);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: var(--fs-13);
  line-height: 1.7;
  color: var(--ink-soft);
}

.intelligence-callout-spaced {
  margin: 24px auto;
}

/* Monitor changes scroll wrapper: shorter height variant */
.changes-scroll-wrapper-short {
  height: 180px;
}

.dash-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0 0 var(--section-gap);
}

/* Category-406 specific: publication date line */
.section-date {
  font-size: var(--fs-11);
  color: var(--muted);
  margin-bottom: 24px;
}

/* ==========================================================================
   Stats cards row (3/4/5 columns)
   ========================================================================== */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 2px solid var(--ink);
  padding: 28px 0;
  margin-bottom: 40px;
}

.stats-row-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stats-row-5 {
  grid-template-columns: repeat(5, 1fr);
}

.stats-row-5 .stat-card {
  padding: 0 12px;
}

.stats-row-5 .stat-card-value {
  font-size: var(--fs-22);
}

.stat-card {
  text-align: center;
  padding: 0 16px;
  border-right: 1px solid var(--rule);
}

.stat-card:last-child {
  border-right: none;
}

.stat-card-label {
  font-size: var(--fs-9);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-value {
  font-family: var(--mono);
  font-size: var(--fs-28);
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-card-signal .stat-card-value {
  color: var(--signal);
}

.stat-card-blue .stat-card-value {
  color: var(--accent-blue);
}

@media (max-width: 768px) {
  .stats-row,
  .stats-row-4,
  .stats-row-5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 0;
  }

  .stat-card:nth-child(2n) {
    border-right: none;
  }

  .stat-card-value {
    font-size: var(--fs-22);
  }
}

@media (max-width: 480px) {
  .stats-row,
  .stats-row-4,
  .stats-row-5 {
    grid-template-columns: 1fr;
    gap: 16px 0;
  }

  .stat-card {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 16px;
  }

  .stat-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

/* ==========================================================================
   Data block (large number display)
   ========================================================================== */

.data-block {
  text-align: center;
  padding: 32px 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}

.data-block-value {
  font-family: var(--mono);
  /* Display-only literal: dashboard big number, one of two documented exceptions (see DESIGN §3.3). */
  font-size: 56px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 8px;
}

.data-block-label {
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted);
}

.data-block-note {
  font-size: var(--fs-11);
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 768px) {
  .data-block-value {
    font-size: var(--fs-34);
  }
}

/* ==========================================================================
   Chart container
   ========================================================================== */

.chart-wrap {
  padding: 24px 0;
  position: relative;
  min-height: 200px;
  margin-bottom: 32px;
}

.chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  z-index: 2;
}

.chart-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--rule);
  border-top-color: var(--signal);
  border-radius: var(--radius-full);
  animation: dashboard-spin 0.8s linear infinite;
}

@keyframes dashboard-spin {
  to { transform: rotate(360deg); }
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

/* ==========================================================================
   TLD selector (radio buttons as pills)
   ========================================================================== */

.tld-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tld-selector label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.tld-selector label:hover {
  border-color: var(--ink);
}

.tld-selector input[type="radio"] {
  display: none;
}

.tld-selector input[type="radio"]:checked + label,
.tld-selector label.is-active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

/* ==========================================================================
   Feature grid (JS-populated metric cards)
   ========================================================================== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--ink);
  padding: 28px 0;
  margin-bottom: 40px;
}

.feature-grid-4col {
  grid-template-columns: repeat(4, 1fr);
  row-gap: 28px;
}

.feature-grid-4col .feature-card:nth-child(4n) {
  border-right: none;
}

.feature-card {
  padding: 0 16px;
  border-right: 1px solid var(--rule);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.feature-card:last-child {
  border-right: none;
}

.feature-card-value {
  font-family: var(--mono);
  font-size: var(--fs-22);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.feature-card-label {
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
}

/* JS-created structure variant (different child order) */
.feature-label {
  order: 1;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.feature-value {
  order: 2;
  font-family: var(--mono);
  font-size: var(--fs-22);
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 4px;
}

.feature-sublabel {
  order: 3;
  font-size: var(--fs-11);
  color: var(--muted);
}

.feature-detail {
  order: 4;
  font-size: var(--fs-11);
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .feature-grid,
  .feature-grid-4col {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 24px;
  }
  .feature-card {
    border-right: none;
  }
  .feature-card:nth-child(odd) {
    border-right: 1px solid var(--rule);
  }
  .feature-grid-4col .feature-card:nth-child(4n) {
    border-right: none;
  }
}

@media (max-width: 480px) {
  .feature-grid,
  .feature-grid-4col {
    grid-template-columns: 1fr;
  }
  .feature-card {
    border-right: none;
  }
}

/* ==========================================================================
   Data table (dashboard version)
   ========================================================================== */

.dash-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 32px;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-13);
}

.dash-table thead tr {
  border-bottom: 2px solid var(--ink);
}

.dash-table th {
  padding: 14px 20px;
  text-align: center;
  font-size: var(--fs-9);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--sans);
  white-space: nowrap;
}

.dash-table td {
  padding: 12px 20px;
  font-family: var(--mono);
  font-size: var(--fs-13);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.dash-table tbody tr {
  border-bottom: 1px solid var(--rule);
}

.dash-table tbody tr:last-child {
  border-bottom: none;
}

.dash-table tbody tr:first-child {
  background: var(--paper-deep);
}

.dash-table .rank-col {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--muted);
  width: 48px;
}

.dash-table .tld-col {
  font-family: var(--sans);
  font-weight: 700;
}

.dash-table .signal-col {
  color: var(--signal);
}

/* ==========================================================================
   CTA (dashboard in-page)
   ========================================================================== */

.dash-cta {
  text-align: center;
  margin: 24px 0 40px;
}

.dash-cta h3 {
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.dash-cta p {
  font-size: var(--fs-13);
  color: var(--muted);
  margin-bottom: 20px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.dash-cta-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   FAQ (dashboard version, JS-driven)
   ========================================================================== */

.faq-section {
  margin-bottom: 40px;
  text-align: left;
}

.faq-item {
  border-bottom: 1px solid var(--rule);
}

.faq-item:first-child {
  border-top: 1px solid var(--rule);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--sans);
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--ink);
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--signal);
}

.faq-toggle {
  font-size: var(--fs-18);
  font-weight: 300;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.2s;
  line-height: 1;
}

.faq-item.is-open .faq-toggle {
  color: var(--signal);
}

.faq-answer {
  display: none;
  padding: 0 0 18px;
  font-size: var(--fs-13);
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 720px;
}

.faq-item.is-open .faq-answer {
  display: block;
}

/* ==========================================================================
   Dashboard articles section
   ========================================================================== */

/* ==========================================================================
   Monitor page: change items (JS-populated)
   ========================================================================== */

.change-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  margin-bottom: 8px;
  font-size: var(--fs-13);
  border-bottom: 1px solid var(--rule);
}

.change-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  flex-shrink: 0;
}

.change-domain {
  font-family: var(--mono);
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--ink);
}

.change-details {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-11);
  color: var(--muted);
  flex-wrap: wrap;
}

.change-type {
  display: inline-block;
  padding: 3px 10px;
  background: var(--paper-deep);
  border-radius: var(--radius-lg);
  font-size: var(--fs-11);
  font-weight: 500;
  white-space: nowrap;
}

.change-type.nameserver { background: #e0f2fe; color: #0369a1; }
.change-type.transfer   { background: #fef3c7; color: #d97706; }
.change-type.expired    { background: #fee2e2; color: #dc2626; }
.change-type.backorder  { background: #ddd6fe; color: #6d28d9; }
.change-type.status     { background: #e0e7ff; color: #4338ca; }

.change-arrow {
  color: var(--muted);
  font-size: var(--fs-11);
  margin: 0 4px;
}

.old-value {
  color: var(--signal);
  font-weight: 500;
  font-size: var(--fs-11);
}

.new-value {
  color: #059669;
  font-weight: 500;
  font-size: var(--fs-11);
}

.accent-text {
  color: var(--muted);
  font-size: var(--fs-11);
}

.danger-text {
  color: var(--signal);
  font-weight: 500;
  font-size: var(--fs-11);
}

.sale-badge {
  display: inline-block;
  padding: 2px 6px;
  background: #fbbf24;
  color: #78350f;
  border-radius: var(--radius-lg);
  font-size: var(--fs-9);
  font-weight: 600;
  text-transform: uppercase;
}

/* Scrolling changes list (monitor pages) */
.changes-scroll-wrapper {
  height: 300px;
  overflow: hidden;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.changes-list {
  animation: dashboard-scroll-up 80s linear infinite;
  padding: 12px;
}

.changes-list:hover {
  animation-play-state: paused;
}

.monitor-summary-text {
  color: var(--ink-soft);
  font-size: var(--fs-13);
  margin-bottom: 16px;
}

.monitor-empty-note {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.is-hidden {
  display: none;
}

.chart-canvas {
  display: none;
}

.dash-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

@keyframes dashboard-scroll-up {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@media (max-width: 768px) {
  .change-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .change-header {
    min-width: auto;
  }
}

/* ==========================================================================
   Monitor page: insight cards (JS-populated) + trend summary wrapper
   ========================================================================== */

.trend-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 240px));
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 32px;
}

.insight-card {
  background: var(--paper-deep);
  border-radius: var(--radius-md);
  padding: 16px;
}

.insight-label {
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.insight-value {
  font-family: var(--mono);
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 480px) {
  .trend-summary {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Chart legend items (JS-populated for NRD/TLD charts)
   ========================================================================== */

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-13);
  color: var(--ink-soft);
  margin-right: 16px;
  margin-bottom: 8px;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* Round dot variant used by chart legend rendering */
.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  display: inline-block;
}

/* ==========================================================================
   Category-569 (NRD) specific copy blocks
   ========================================================================== */

.nrd-intro {
  max-width: 640px;
  line-height: 1.7;
  font-size: var(--fs-13);
  color: var(--ink-soft);
  margin: 0 auto 24px;
}

.nrd-cta {
  text-align: center;
  margin-top: 24px;
}

.trend-explanation {
  font-size: var(--fs-11);
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ==========================================================================
   About page helpers (template-about.php uses dashboard layout)
   ========================================================================== */

.about-header {
  text-align: center;
  padding: 28px 0;
}

.about-title-signal {
  color: var(--signal);
}

.about-section {
  text-align: center;
}

.about-lead {
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
  font-size: var(--fs-13);
  color: var(--ink-soft);
}

.about-lead-spaced {
  margin-bottom: 24px;
}

.about-lead-zero {
  margin-bottom: 0;
}

.about-body {
  max-width: 640px;
  margin: 0 auto;
  font-size: var(--fs-13);
  color: var(--ink-soft);
  line-height: 1.7;
  text-align: left;
}

.about-capabilities-grid {
  text-align: left;
}
