/**
 * Dashboard shared styles — used by all category data pages
 *
 * @package ABTdomain
 */

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

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

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

.dashboard-header h1 {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 8px;
}

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

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

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

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

/* ==========================================================================
   Stats Cards Row
   ========================================================================== */

.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);
}

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

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

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

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

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

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

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

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

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

  .stat-card .stat-card-value {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .stats-row {
    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;
  background: transparent;
  border-radius: 8px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}

.data-block-value {
  font-family: var(--mono);
  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: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

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

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

/* ==========================================================================
   Chart Container
   ========================================================================== */

.chart-wrap {
  background: var(--white);
  border-radius: 8px;
  padding: 24px;
  position: relative;
  min-height: 200px;
  margin-bottom: 32px;
}

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

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

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

/* ==========================================================================
   TLD Selector (radio buttons)
   ========================================================================== */

.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(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 13px;
  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.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

/* Alternative: radio visible */
.tld-selector--visible input[type="radio"] {
  display: inline;
  accent-color: var(--signal);
}

/* ==========================================================================
   Feature Grid
   ========================================================================== */

.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 {
  background: none;
  border-radius: 0;
  padding: 0 16px;
  border-top: none;
  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: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

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

@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 {
  background: var(--white);
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 32px;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.dash-table th {
  padding: 14px 20px;
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 3px;
  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: 13px;
  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);
}

/* ==========================================================================
   Live Updates List
   ========================================================================== */

.live-list {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 32px;
}

.live-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--rule);
}

.live-list-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--signal);
}

.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--signal);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.live-list-body {
  max-height: 400px;
  overflow-y: auto;
}

.live-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  font-size: 13px;
  border-bottom: 1px solid var(--rule);
}

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

.live-item-domain {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--ink);
  min-width: 160px;
}

.live-item-reason {
  color: var(--ink-soft);
  flex: 1;
}

.live-item-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ==========================================================================
   Example Domains Block
   ========================================================================== */

.example-domains {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.example-domain-card {
  background: var(--white);
  border-radius: 8px;
  padding: 20px;
  border-top: 2px solid var(--signal);
}

.example-domain-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  word-break: break-all;
}

.example-domain-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .example-domains {
    grid-template-columns: 1fr;
  }
}

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

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

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

.dash-cta p {
  font-size: 13px;
  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;
}

/* Button system */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  line-height: 1.4;
}

.btn--signal {
  background: var(--signal);
  color: var(--white);
  border-color: var(--signal);
}

.btn--signal:hover {
  background: #a83220;
  border-color: #a83220;
}

.btn--outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

.btn--outline:hover {
  border-color: var(--ink);
  background: var(--white);
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */

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

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

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

.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: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.2s;
}

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

/* ::after removed — toggle icon handled by <span class="faq-toggle"> in HTML */

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

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

/* ==========================================================================
   Dashboard Articles Section
   ========================================================================== */

.dash-articles {
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.dash-articles-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}

.dash-articles-header h2 {
  font-size: 20px;
  font-weight: 700;
}

/* ==========================================================================
   Trend Summary Cards
   ========================================================================== */

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

.trend-card {
  background: var(--paper-deep);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
}

.trend-card-value {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.trend-card-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

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

/* ==========================================================================
   Growth Indicator
   ========================================================================== */

.growth-up { color: #059669; }
.growth-down { color: var(--signal); }
.growth-flat { color: var(--muted); }

/* ==========================================================================
   Section Divider (between dashboard blocks)
   ========================================================================== */

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

/* ==========================================================================
   JS-generated classes (from legacy min.js files)
   These classes are created dynamically by the old category JS files.
   ========================================================================== */

/* --- Feature cards (created by newly-registered/tld-reports/expired JS) --- */

.feature-label {
  order: 1;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

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

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

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

/* --- Summary cards (created by NRD/TLD trends JS) --- */

.summary-card {
  background: var(--paper-deep);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
}

.summary-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-value {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.summary-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* --- Chart legend (created by NRD/TLD JS) --- */

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

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* --- Monitor change items (created by monitor.min.js) --- */

.change-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--white);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}

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

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

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

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

.change-type {
  display: inline-block;
  padding: 3px 10px;
  background: var(--paper-deep);
  border-radius: 15px;
  font-size: 11px;
  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: 12px;
  margin: 0 4px;
}

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

.new-value {
  color: #059669;
  font-weight: 500;
  font-size: 12px;
}

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

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

/* --- Monitor insight cards (created by monitor.min.js) --- */

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

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

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

/* --- FAQ toggle (legacy JS uses .active class, not .is-open) --- */

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

.faq-toggle.active {
  color: var(--signal);
}

.faq-answer.active {
  display: block;
}

/* --- Scrolling changes list (monitor pages) --- */

.changes-scroll-wrapper {
  height: 300px;
  overflow: hidden;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

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

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

@keyframes 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;
  }
}
