/* ============================================
   ATENA CRYPTO — COIN PAGE v2 (CMC-inspired)
   Prefix: cp- to avoid conflicts with coin.css
   ============================================ */

/* PAGE WRAPPER */
.cp-page { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem 4rem; }

/* ── HERO ─────────────────────────────────── */
.cp-hero {
  display: flex; align-items: flex-start; gap: 1.4rem;
  padding: 2rem 0 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.cp-coin-logo {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-surface-2); flex-shrink: 0;
  object-fit: cover;
}
.cp-coin-logo-fallback {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-surface-2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; border: 1px solid var(--border-subtle);
}
.cp-identity { flex: 1; min-width: 0; }
.cp-name-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.cp-name { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.025em; color: var(--text); margin: 0; }
.cp-sym {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  color: var(--text-secondary); background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle); border-radius: 4px; padding: 3px 8px;
}
.cp-rank {
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-tertiary);
  background: var(--bg-surface-1); border: 1px solid var(--border-subtle);
  border-radius: 4px; padding: 2px 7px;
}
.cp-categories { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.35rem; }
.cp-cat-pill {
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 500;
  color: var(--text-tertiary); background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle); border-radius: 20px; padding: 2px 8px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* PRICE BLOCK */
.cp-price-block { display: flex; align-items: baseline; gap: 0.75rem; margin-top: 0.6rem; flex-wrap: wrap; }
.cp-price { font-family: var(--font-mono); font-size: 2.4rem; font-weight: 900; color: var(--text); letter-spacing: -0.04em; }
.cp-change {
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600;
  padding: 3px 9px; border-radius: 5px;
}
.cp-change.cp-up   { color: var(--green); background: rgba(0,197,102,0.08); }
.cp-change.cp-down { color: var(--red-bright); background: rgba(239,68,68,0.08); }

/* TIMEFRAME PILLS */
.cp-tf-row { display: flex; gap: 0.3rem; margin-top: 0.9rem; flex-wrap: wrap; }
.cp-tf-pill {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  padding: 4px 11px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border-subtle); background: var(--bg-surface-1);
  color: var(--text-secondary); transition: all 120ms ease; user-select: none;
  appearance: none; margin: 0; line-height: 1.2;
}
.cp-tf-pill:hover { border-color: var(--border-default); color: var(--text); }
.cp-tf-pill.active {
  background: var(--green); color: #000; border-color: var(--green);
}
.cp-tf-pill.disabled { opacity: 0.35; cursor: not-allowed; }

/* HIGH / LOW RANGE */
.cp-range-row {
  display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-tertiary);
}
.cp-range-bar-wrap { flex: 1; max-width: 200px; height: 4px; border-radius: 2px; background: var(--bg-surface-2); overflow: hidden; }
.cp-range-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--red-bright), var(--green)); }

/* ── MAIN LAYOUT ──────────────────────────── */
.cp-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; margin-top: 1.5rem; }
@media (max-width: 900px) { .cp-layout { grid-template-columns: 1fr; } }

/* ── CHART SECTION ────────────────────────── */
.cp-chart-card {
  background: var(--bg-surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden; min-height: 480px;
  margin-top: 1rem;
}
.cp-chart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border-subtle);
}
.cp-chart-title { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.cp-chart-source {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.cp-chart-frame {
  width: 100%; height: 480px; border: none; display: block;
  background: #10161F;
}
.cp-chart-frame iframe { border-radius: inherit; }

/* ── STATS GRID ───────────────────────────── */
.cp-stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-top: 1rem;
}
@media (max-width: 600px) { .cp-stats-grid { grid-template-columns: 1fr; } }

.cp-stat-card {
  background: var(--bg-surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 0.9rem 1rem; position: relative; overflow: hidden;
  transition: border-color 140ms ease;
}
.cp-stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 28px; height: 2px; background: var(--green); border-radius: 0 0 2px 0;
}
.cp-stat-card:hover { border-color: var(--border-default); }
.cp-stat-label {
  font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem;
}
.cp-stat-val {
  font-family: var(--font-mono); font-size: 1.05rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.02em; line-height: 1.3;
}
.cp-stat-sub { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-tertiary); margin-top: 0.2rem; }
.cp-stat-up   { color: var(--green) !important; }
.cp-stat-down { color: var(--red-bright) !important; }

/* ── SIDEBAR ──────────────────────────────── */
.cp-sidebar { display: flex; flex-direction: column; gap: 1rem; }

/* ATENA SCORE CARD */
.cp-score-card {
  background: var(--bg-surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 1.25rem; position: relative; overflow: hidden;
}
.cp-score-card::before {
  content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,197,102,0.3), transparent);
}
.cp-score-title {
  font-size: 0.72rem; font-weight: 700; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem;
}
.cp-score-display { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cp-score-ring {
  width: 72px; height: 72px; position: relative; flex-shrink: 0;
}
.cp-score-ring svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.cp-score-ring-bg { fill: none; stroke: var(--bg-surface-2); stroke-width: 6; }
.cp-score-ring-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1); }
.cp-score-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 1.3rem; font-weight: 900; color: var(--text);
}
.cp-score-label-block { min-width: 0; }
.cp-score-grade { font-size: 1.8rem; font-weight: 900; letter-spacing: -0.04em; }
.cp-score-desc { font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.15rem; }

.cp-score-bars { display: flex; flex-direction: column; gap: 0.6rem; }
.cp-score-bar-row { display: flex; flex-direction: column; gap: 0.25rem; }
.cp-score-bar-label {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-tertiary);
}
.cp-score-bar-track { height: 3px; border-radius: 2px; background: var(--bg-surface-2); overflow: hidden; }
.cp-score-bar-fill { height: 100%; border-radius: 2px; background: var(--green); transition: width 0.8s ease; }

/* INFO CARD (links, contract, etc) */
.cp-info-card {
  background: var(--bg-surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 1.1rem;
}
.cp-info-title {
  font-size: 0.7rem; font-weight: 700; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem;
}
.cp-info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.45rem 0; border-bottom: 1px solid var(--border-subtle); gap: 0.5rem;
}
.cp-info-row:last-child { border-bottom: none; }
.cp-info-key { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-tertiary); flex-shrink: 0; }
.cp-info-val { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-info-link { color: var(--green); text-decoration: none; font-size: 0.65rem; font-family: var(--font-mono); }
.cp-info-link:hover { text-decoration: underline; }

/* AI CTA CARD */
.cp-ai-card {
  background: linear-gradient(135deg, rgba(0,197,102,0.06), rgba(0,197,102,0.02));
  border: 1px solid rgba(0,197,102,0.2); border-radius: var(--radius-lg); padding: 1.1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.cp-ai-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  color: var(--green); background: rgba(0,197,102,0.1);
  border: 1px solid rgba(0,197,102,0.2); border-radius: 20px; padding: 2px 9px;
  width: fit-content; letter-spacing: 0.05em;
}
.cp-ai-badge::before { content: '⬡'; font-size: 0.55rem; }
.cp-ai-prompt { font-size: 0.78rem; color: var(--text); font-weight: 500; line-height: 1.45; }
.cp-ai-btn {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  color: #000; background: var(--green); border: none; border-radius: var(--radius);
  padding: 0.5rem 1rem; cursor: pointer; text-align: center;
  transition: opacity 120ms ease; margin-top: 0.25rem;
}
.cp-ai-btn:hover { opacity: 0.88; }

/* ── BELOW-FOLD TABS ──────────────────────── */
.cp-tabs-bar {
  display: flex; border-bottom: 1px solid var(--border-subtle);
  margin-top: 2rem; gap: 0;
}
.cp-tab {
  font-size: 0.85rem; font-weight: 500; padding: 0.65rem 1.4rem;
  border: none; background: none; cursor: pointer;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color 120ms ease, border-color 120ms ease;
}
.cp-tab:hover { color: var(--text); }
.cp-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

.cp-tab-panel { display: none; padding: 1.5rem 0; }
.cp-tab-panel.active { display: block; }

/* MARKETS TABLE */
.cp-markets-table { width: 100%; border-collapse: collapse; }
.cp-markets-table th {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.5rem 0.9rem; text-align: right; border-bottom: 1px solid var(--border-subtle);
}
.cp-markets-table th:first-child { text-align: left; }
.cp-markets-table td {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--text);
  padding: 0.7rem 0.9rem; text-align: right; border-bottom: 1px solid var(--border-subtle);
}
.cp-markets-table td:first-child { text-align: left; font-weight: 600; }
.cp-markets-table tr:last-child td { border-bottom: none; }
.cp-markets-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ABOUT PROSE */
.cp-about-text {
  font-size: 0.875rem; color: var(--text-secondary); line-height: 1.75;
  max-width: 720px;
}
.cp-about-text p { margin: 0 0 1em; }

/* LOADING SKELETON */
.cp-skel {
  background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--bg-surface-3, #2a2a2a) 50%, var(--bg-surface-2) 75%);
  background-size: 200% 100%; animation: cpSkel 1.4s ease infinite;
  border-radius: 4px; display: inline-block;
}
@keyframes cpSkel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ERROR STATE */
.cp-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1rem; text-align: center; gap: 0.5rem;
}
.cp-error-icon { font-size: 2rem; opacity: 0.4; }
.cp-error-msg { font-size: 0.85rem; color: var(--text-secondary); }

/* RESPONSIVE */
@media (max-width: 640px) {
  .cp-hero { flex-direction: column; gap: 0.75rem; }
  .cp-price { font-size: 1.8rem; }
  .cp-stats-grid { grid-template-columns: 1fr 1fr; }
  .cp-page { padding: 0 1rem 3rem; }
}

/* ───── FAQ ACCORDION ───── */
.coin-faq {
  margin: 24px auto 0;
  max-width: 1200px;
}
.faq-body {
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 200ms var(--ease);
}
.faq-item:last-child { border-bottom: none; }

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary { list-style: none; }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 4px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.4;
  transition: color 200ms var(--ease);
}
.faq-question:hover { color: var(--green); }
.faq-q-text { flex: 1; }
.faq-chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 250ms var(--ease), color 200ms var(--ease);
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); color: var(--green); }
.faq-item[open] .faq-question { color: var(--green); }

.faq-answer {
  padding: 0 4px 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  animation: faq-fade 300ms var(--ease);
}
@keyframes faq-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .faq-body { padding: 4px 18px 20px; }
  .faq-question { font-size: 14px; padding: 16px 2px; }
  .faq-answer { font-size: 13px; padding: 0 2px 16px; }
}

/* ───── MARKETS TABLE ───── */
.cp-markets-table { font-size: 13px; }
.cp-markets-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-surface-1);
}
.cp-markets-table thead th:nth-child(3),
.cp-markets-table thead th:nth-child(4),
.cp-markets-table thead th:nth-child(5) { text-align: right; }

.cp-market-row { transition: background 140ms var(--ease); }
.cp-market-row:hover { background: rgba(255,255,255,0.035); }

.cp-markets-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.cp-market-exchange {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cp-market-logo {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-surface-3);
  flex-shrink: 0;
  object-fit: cover;
}
.cp-market-exchange span {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-market-pair {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.cp-market-price,
.cp-market-volume {
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
}

.cp-market-spread {
  font-family: var(--font-mono);
  text-align: right;
  color: var(--text-secondary);
}
.cp-market-spread.anomaly { color: var(--warning, #f59e0b); }
.cp-market-spread.stale   { opacity: 0.5; }

@media (max-width: 768px) {
  .cp-markets-table thead th,
  .cp-markets-table tbody td { padding: 10px 12px; font-size: 11px; }
  .cp-market-logo { width: 18px; height: 18px; }
  .cp-markets-table thead th:nth-child(5),
  .cp-markets-table tbody td:nth-child(5) { display: none; }
}
