/* ── COIN STAR TOOLTIP ─────────────────────────────── */
.coin-star-btn {
    position: relative;
}

.coin-star-btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #0F172A;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 10;
}

.coin-star-btn:hover::after {
    opacity: 1;
}


/* ── STAR BURST ANIMATION ── */
@keyframes starBurst {
  0%   { transform: scale(1);   }
  30%  { transform: scale(1.6); }
  50%  { transform: scale(0.9); }
  70%  { transform: scale(1.3); }
  100% { transform: scale(1);   }
}
@keyframes starRipple {
  0%   { box-shadow: 0 0 0 0   rgba(245,158,11,0.5); }
  100% { box-shadow: 0 0 0 10px rgba(245,158,11,0);  }
}
.coin-star-btn.burst i,
.mover-star-btn.burst i {
  animation: starBurst 0.4s cubic-bezier(0.36,0.07,0.19,0.97);
}
.coin-star-btn.burst,
.mover-star-btn.burst {
  animation: starRipple 0.5s ease-out;
}


/* ── COIN STAR BUTTON ── */
.coin-star-btn {
  border: none;
  background: transparent;
  color: #CBD5E1;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
  vertical-align: middle;
}
.coin-star-btn:hover   { color: #F59E0B; }
.coin-star-btn.starred { color: #F59E0B; }

/* =====================================================
   COINS.CSS — List page, Movers, Table, Modal, Detail
   ===================================================== */

/* ══════════════════════════════════════════
   COINS LIST PAGE
   ══════════════════════════════════════════ */
.coins-page {
  padding: 28px 40px 100px;
  background: #F8FAFC;
  min-height: 100vh;
}

/* Header */
.coins-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.coins-header-left {}
.coins-title {
  font-size: 26px; font-weight: 900; color: #0f172a; margin-bottom: 4px;
  font-family: 'Syne', sans-serif;
}
.coins-subtitle { font-size: 13px; color: #94a3b8; font-weight: 500; }

/* View toggle */
.coins-view-toggle {
  display: flex; gap: 4px;
  background: #fff; border: 1.5px solid #e2e8f0;
  border-radius: 12px; padding: 4px; flex-shrink: 0;
}
.view-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: none; border-radius: 8px;
  background: transparent; color: #94a3b8;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: all 0.15s; text-decoration: none; white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
}
.view-btn:hover { color: #334155; background: #f8fafc; }
.view-btn.active { background: #0f172a; color: #fff; }
.view-btn i { font-size: 13px; }

/* ══ MOVERS SECTION ══ */
.movers-section {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 18px; margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(57,117,234,0.05); overflow: hidden;
}
.movers-tabs {
  display: flex; align-items: center;
  padding: 0 16px; border-bottom: 1px solid #f1f5f9; background: #fafbfc;
}
.mover-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px; border: none; background: transparent;
  font-size: 12.5px; font-weight: 700; color: #94a3b8;
  cursor: pointer; border-bottom: 2.5px solid transparent;
  transition: all 0.15s; white-space: nowrap; margin-bottom: -1px;
  font-family: 'DM Sans', sans-serif;
}
.mover-tab i { font-size: 11px; }
.mover-tab:hover { color: #334155; }
.mover-tab[data-tab="gainers"].active { color: #16a34a; border-bottom-color: #16a34a; }
.mover-tab[data-tab="losers"].active  { color: #dc2626; border-bottom-color: #dc2626; }
.mover-tab[data-tab="picks"].active   { color: #3975EA; border-bottom-color: #3975EA; }

.movers-collapse {
  margin-left: auto; background: none; border: none;
  color: #94a3b8; cursor: pointer; padding: 8px;
  border-radius: 8px; font-size: 13px; transition: all 0.15s;
}
.movers-collapse:hover { color: #334155; background: #f1f5f9; }

.movers-body {}
.movers-list {
  display: none; overflow-x: auto; scrollbar-width: none;
}
.movers-list::-webkit-scrollbar { display: none; }
.movers-list.active { display: block; }

/* Card view movers */
.movers-list-cards { padding: 14px 18px; }
.movers-list-cards.active { display: flex; gap: 12px; }

/* Mover card */
.mover-card {
  display: flex; flex-direction: column; gap: 10px;
  background: #f8fafc; border: 1.5px solid #e8edf5; border-radius: 16px;
  padding: 14px 16px; flex-shrink: 0; min-width: 200px; max-width: 220px;
  cursor: pointer; transition: all 0.15s;
}
.mover-card:hover { border-color: #bfdbfe; background: #eff6ff; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(57,117,234,0.1); }
.mover-card-top { display: flex; align-items: center; gap: 8px; }
.mover-name-wrap { flex: 1; min-width: 0; }
.mover-price { font-size: 17px; font-weight: 900; color: #0f172a; }
.mover-stats-row { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid #e2e8f0; }
.mover-stat { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.mover-stat-lbl { font-size: 9px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.3px; }
.mover-stat-val { font-size: 11px; font-weight: 700; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Force mover table rows */
tr.mover-row { display: table-row !important; }
tr.mover-row td { display: table-cell !important; }

/* ══ MOVERS TABLE ROWS ══ */
.movers-table {
  width: 100%; border-collapse: collapse;
}
.mover-row {
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer; transition: background 0.12s;
}
.mover-row:last-child { border-bottom: none; }
.mover-row:hover { background: #f8fafc; }
.mover-row td { padding: 11px 14px; vertical-align: middle; font-size: 13px; }

.mover-td-rank {
  font-size: 11px; font-weight: 700; color: #94a3b8;
  width: 40px; text-align: center;
}
.mover-td-coin { width: 200px; }
.mover-identity { display: flex; align-items: center; gap: 10px; }
.mover-logo-wrap {
  width: 32px; height: 32px; border-radius: 50%;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.mover-logo-wrap img { width: 24px; height: 24px; object-fit: contain; display: block; }
.mover-logo-fb { font-size: 12px; font-weight: 800; color: #3975EA; display: none; }
.mover-coin-name {
  display: block; font-size: 13px; font-weight: 700; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px;
}
.mover-coin-sym { display: block; font-size: 10px; font-weight: 600; color: #94a3b8; text-transform: uppercase; }

.mover-td-badge { width: 90px; }
.mover-badge {
  font-size: 11.5px; font-weight: 800;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.mover-badge.up   { background: #f0fdf4; color: #16a34a; }
.mover-badge.down { background: #fef2f2; color: #dc2626; }

.mover-td-price {
  font-size: 14px; font-weight: 800; color: #0f172a;
  white-space: nowrap; text-align: right;
}
.mover-td-meta {
  font-size: 12px; color: #64748b; font-weight: 500;
  white-space: nowrap; text-align: right;
}

/* ══ TOOLBAR ══ */
.coin-library-heading { margin-bottom: 10px; padding: 0 4px; }
.coin-library-title { font-size: 18px; font-weight: 800; color: #0f172a; margin: 0; font-family: 'Syne', sans-serif; }

.coins-toolbar {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 18px; margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(57,117,234,0.04); overflow: hidden;
  max-width: 100%;
}
.search-wrapper { position: relative; padding: 4px; }
.search-wrapper input {
  width: 100%; padding: 12px 40px 12px 44px;
  border: none; outline: none;
  font-size: 14px; background: transparent; color: #0f172a;
  font-family: 'DM Sans', sans-serif;
}
.search-wrapper input::placeholder { color: #94a3b8; }
.search-icon {
  position: absolute; left: 18px; top: 50%;
  transform: translateY(-50%); color: #94a3b8; font-size: 14px;
}
.search-clear-btn {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); color: #94a3b8;
  text-decoration: none; font-size: 13px; padding: 4px;
  transition: color 0.15s;
}
.search-clear-btn:hover { color: #dc2626; }

/* Count row */
.coins-count-row {
  font-size: 12.5px; color: #94a3b8; font-weight: 500;
  margin-bottom: 12px; padding: 0 4px;
}
.coins-count-row strong { color: #0f172a; font-weight: 800; }
.coins-count-row em { color: #3975EA; font-style: normal; }

/* ══ TABLE VIEW ══ */
.coins-table-wrap {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(57,117,234,0.04);
}
.coins-table { width: 100%; border-collapse: collapse; }
.coins-table thead tr { background: #f8fafc; border-bottom: 1.5px solid #e2e8f0; }
.coins-table th {
  padding: 12px 16px; font-size: 11px; font-weight: 800;
  color: #64748b; text-transform: uppercase; letter-spacing: 0.5px;
  text-align: left; white-space: nowrap;
}
.th-rank { width: 50px; text-align: center; }
.th-right { text-align: right; }

.coin-row {
  border-bottom: 1px solid #f8fafc;
  cursor: pointer; transition: background 0.12s;
}
.coin-row:last-child { border-bottom: none; }
.coin-row:hover { background: #f8fafc; }

.coins-table td {
  padding: 13px 16px; font-size: 13.5px;
  font-weight: 600; color: #0f172a; vertical-align: middle;
}
.td-rank { text-align: center; font-size: 12px; font-weight: 700; color: #94a3b8; }
.td-name {}
.td-right { text-align: right; }
.td-price { font-weight: 800; }
.td-muted { color: #475569; font-size: 13px; }
.td-spark { text-align: right; vertical-align: middle; }

/* Table sparkline SVG */
.tbl-sparkline {
  display: inline-block;
  vertical-align: middle;
  overflow: visible;
}

/* 24h High / Low range bar */
.hl-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  white-space: nowrap;
  justify-content: flex-end;
}
.hl-bar {
  width: 50px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}
.hl-bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
  min-width: 3px;
}
.hl-low  { color: #dc2626; font-weight: 600; font-size: 11px; min-width: 70px; text-align: right; }
.hl-high { color: #16a34a; font-weight: 600; font-size: 11px; min-width: 70px; text-align: left; }

/* Coin identity in table */
.coin-tbl-identity {
  display: flex; align-items: center; gap: 10px;
}
.coin-tbl-img-wrap {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.coin-tbl-img-wrap img {
  width: 26px; height: 26px; object-fit: contain; display: block;
}
.coin-tbl-fb {
  font-size: 14px; font-weight: 900; color: #3975EA; display: none;
}
.coin-tbl-text { display: flex; flex-direction: column; gap: 2px; }
.coin-tbl-name { font-size: 14px; font-weight: 700; color: #0f172a; }
.coin-tbl-sym  { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; }

/* Change pill */
.chg-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800;
}
.chg-pill.up   { background: #f0fdf4; color: #16a34a; }
.chg-pill.down { background: #fef2f2; color: #dc2626; }

/* Detail arrow button */
.tbl-detail-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: #f1f5f9; color: #94a3b8;
  text-decoration: none; font-size: 11px; transition: all 0.15s;
}
.coin-row:hover .tbl-detail-btn { background: #eff6ff; color: #3975EA; }

.tbl-empty {
  text-align: center; padding: 60px 20px !important;
  color: #94a3b8; font-size: 14px;
}

/* ══ CARD VIEW ══ */
.coins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* ── UNIFIED COIN CARD ── */
.coin-card {
  background: #ffffff;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: all 0.15s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.coin-card:hover {
  border-color: #DBEAFE;
  box-shadow: 0 4px 20px rgba(57,117,234,0.1);
  transform: translateY(-2px);
}

/* top row: rank + 24h badge */
.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-rank {
  font-size: 10px;
  font-weight: 800;
  color: #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.coin-change {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.coin-change.positive { background: #F0FDF4; color: #16A34A; }
.coin-change.negative { background: #FEF2F2; color: #DC2626; }

/* identity: logo + name + star */
.card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card-coin-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}

.card-coin-name {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.card-coin-symbol {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 600;
  margin-top: 2px;
  display: block;
}

/* inline star */
.coin-star-btn {
  border: none;
  background: transparent;
  color: #CBD5E1;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}

.coin-star-btn:hover { color: #F59E0B; }
.coin-star-btn.starred { color: #F59E0B; }

/* price */
.coin-price {
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 12px;
}

/* stats grid */
.card-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.card-stat-box {
  background: #F8FAFC;
  border-radius: 8px;
  padding: 6px 8px;
}

.card-stat-label {
  font-size: 9px;
  font-weight: 800;
  color: #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.card-stat-val {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
}

/* footer: sparkline + view link */
.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
}

.card-sparkline {
  height: 24px;
  flex: 1;
  margin-right: 8px;
  overflow: visible;
}

.card-view-link {
  font-size: 11px;
  font-weight: 700;
  color: #3975EA;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-view-link:hover { text-decoration: underline; }

/* legacy aliases kept for modal compat */
.card-meta-item { display: flex; flex-direction: column; gap: 2px; }
.card-meta-label { font-size: 10px; font-weight: 700; color: #cbd5e1; text-transform: uppercase; letter-spacing: 0.4px; }
.card-meta-val   { font-size: 12px; font-weight: 600; color: #64748b; }
.coins-empty     { text-align: center; padding: 60px; color: #94a3b8; font-size: 15px; }

/* ══════════════════════════════════════════
   COIN MODAL
   ══════════════════════════════════════════ */
.coin-modal {
  position: fixed; inset: 0;
  background: rgba(10,16,30,0.5); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
}
.coin-modal.hidden { display: none; }
.coin-modal-box {
  background: #ffffff; border-radius: 22px; width: 100%;
  max-width: 780px; overflow: hidden;
  box-shadow: 0 40px 100px rgba(57,117,234,0.2);
  animation: cModalPop 0.28s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column;
}
@keyframes cModalPop {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.cmodal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px; background: #0f172a;
}
.cmodal-header-left { display: flex; align-items: center; gap: 14px; }
.cmodal-logo-ring {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.cmodal-logo-ring img { width: 34px; height: 34px; object-fit: contain; }
.cmodal-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.cmodal-name { font-size: 20px; font-weight: 800; color: #ffffff; }
.cmodal-symbol {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.08); padding: 2px 7px; border-radius: 4px;
}
.cmodal-rank-badge { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.35); }
.cmodal-header-right { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.cmodal-big-price { font-size: 22px; font-weight: 800; color: #ffffff; text-align: right; }
.cmodal-change { font-size: 13px; font-weight: 700; text-align: right; margin-top: 3px; }
.cmodal-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6);
  cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; flex-shrink: 0;
}
.cmodal-close:hover { background: rgba(255,255,255,0.2); color: #fff; }
.cmodal-stats-strip {
  display: flex; align-items: center; background: #f8fafc;
  border-bottom: 1px solid #e2e8f0; padding: 13px 28px; overflow-x: auto;
}
.cms-item { display: flex; flex-direction: column; gap: 2px; padding: 0 16px; flex-shrink: 0; }
.cms-item:first-child { padding-left: 0; }
.cms-label { font-size: 9.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.cms-value { font-size: 13px; font-weight: 700; color: #0f172a; white-space: nowrap; }
.cms-div { width: 1px; height: 26px; background: #e2e8f0; flex-shrink: 0; }
.cmodal-chart-wrap { padding: 16px 24px 8px; height: 260px; }
#modalChart { width: 100%; height: 100%; }
.cmodal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px 16px; border-top: 1px solid #f1f5f9;
}
.cmodal-disclaimer { font-size: 11px; color: #94a3b8; display: flex; align-items: center; gap: 6px; }
.cmodal-disclaimer i { color: #f59e0b; }
.cmodal-view-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; background: #3975EA; color: #fff;
  border-radius: 9px; font-size: 13px; font-weight: 700;
  text-decoration: none; transition: all 0.2s;
}
.cmodal-view-btn:hover { background: #2d62d4; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(57,117,234,0.35); }

/* ══════════════════════════════════════════
   COIN DETAIL PAGE
   ══════════════════════════════════════════ */
.coin-detail-page { padding: 36px 48px; background: #F8FAFC; min-height: 100vh; }
.cd-hero {
  display: flex; align-items: center; justify-content: space-between;
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 20px;
  padding: 24px 28px; margin-bottom: 22px; box-shadow: 0 2px 8px rgba(57,117,234,0.05);
}
.cd-hero-left { display: flex; align-items: center; gap: 18px; }
.cd-logo { width: 58px; height: 58px; border-radius: 50%; object-fit: contain; }
.cd-hero-name-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cd-name { font-size: 26px; font-weight: 800; color: #0f172a; margin: 0; font-family: 'Syne', sans-serif; }
.cd-symbol-badge { background: #f1f5f9; color: #64748b; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.cd-rank-badge { background: #eff6ff; color: #3975EA; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.cd-categories { display: flex; gap: 6px; flex-wrap: wrap; }
.cd-cat-tag { font-size: 11px; font-weight: 600; background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; padding: 2px 9px; border-radius: 5px; }
.cd-hero-right { text-align: right; }
.cd-price { font-size: 32px; font-weight: 800; color: #0f172a; letter-spacing: -0.5px; }
.cd-change-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.cd-change-pill.up   { background: #dcfce7; color: #16a34a; }
.cd-change-pill.down { background: #fee2e2; color: #dc2626; }
.cd-change-label { font-size: 11px; opacity: 0.6; }
.cd-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.cd-left, .cd-right { display: flex; flex-direction: column; gap: 18px; }
.cd-chart-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 20px 24px; box-shadow: 0 2px 8px rgba(57,117,234,0.05); }
.cd-chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cd-chart-title { font-size: 14px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 8px; }
.cd-chart-title i { color: #3975EA; }
.cd-period-btns { display: flex; background: #f1f5f9; border-radius: 8px; padding: 3px; gap: 2px; }
.period-btn { padding: 5px 13px; border: none; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; background: transparent; color: #64748b; transition: all 0.18s; font-family: 'DM Sans', sans-serif; }
.period-btn:hover { color: #1e293b; }
.period-btn.active { background: #ffffff; color: #3975EA; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.cd-chart-loading { display: flex; align-items: center; justify-content: center; height: 260px; }
.cd-spinner { width: 26px; height: 26px; border: 3px solid #e2e8f0; border-top-color: #3975EA; border-radius: 50%; animation: cdSpin 0.7s linear infinite; }
@keyframes cdSpin { to { transform: rotate(360deg); } }
.cd-chart-container { height: 260px; }
#coinChart { width: 100%; height: 100%; }
.cd-range-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px 22px; box-shadow: 0 1px 4px rgba(57,117,234,0.04); }
.cd-range-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cd-range-label { font-size: 13px; font-weight: 700; color: #0f172a; }
.cd-range-badge { font-size: 10px; font-weight: 700; background: #eff6ff; color: #3975EA; padding: 2px 8px; border-radius: 4px; }
.cd-range-row { display: flex; align-items: center; gap: 12px; }
.cd-range-low, .cd-range-high { font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.cd-range-low  { color: #dc2626; }
.cd-range-high { color: #16a34a; }
.cd-range-track { flex: 1; height: 6px; background: linear-gradient(90deg,#fee2e2 0%,#fef3c7 50%,#dcfce7 100%); border-radius: 999px; position: relative; }
.cd-range-dot { position: absolute; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; background: #3975EA; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(57,117,234,0.3); }
.cd-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cd-stat-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 15px 18px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 1px 3px rgba(57,117,234,0.03); }
.cd-stat-label { font-size: 10.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.4px; display: flex; align-items: center; gap: 5px; }
.cd-stat-label i { color: #3975EA; font-size: 10px; }
.cd-stat-val { font-size: 16px; font-weight: 800; color: #0f172a; }
.cd-ath { color: #16a34a; }
.cd-stat-sub { font-size: 11px; font-weight: 600; color: #94a3b8; }
.cd-stat-sub.up   { color: #16a34a; }
.cd-stat-sub.down { color: #dc2626; }
.cd-supply-bar { height: 4px; background: #e2e8f0; border-radius: 999px; margin: 3px 0; overflow: hidden; }
.cd-supply-fill { height: 100%; background: linear-gradient(90deg,#3975EA,#7c3aed); border-radius: 999px; }
.cd-about-card, .cd-links-card, .cd-dev-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 20px 22px; box-shadow: 0 2px 6px rgba(57,117,234,0.04); }
.cd-section-title { font-size: 13.5px; font-weight: 800; color: #0f172a; margin: 0 0 14px 0; display: flex; align-items: center; gap: 8px; font-family: 'Syne', sans-serif; }
.cd-about-body { font-size: 13px; line-height: 1.7; color: #475569; }
.cd-about-body a { color: #3975EA; text-decoration: none; }
.cd-about-body a:hover { text-decoration: underline; }
.cd-read-more { margin-top: 10px; background: none; border: none; color: #3975EA; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 0; display: block; }
.cd-links-list { display: flex; flex-direction: column; gap: 6px; }
.cd-link-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; background: #f8fafc; border: 1px solid #f1f5f9; color: #334155; font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.15s; }
.cd-link-item i { width: 14px; text-align: center; color: #3975EA; font-size: 12px; }
.cd-link-item:hover { background: #eff6ff; border-color: #bfdbfe; color: #2d62d4; transform: translateX(3px); }
.cd-dev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cd-dev-item { background: #f8fafc; border-radius: 10px; padding: 12px; text-align: center; }
.cd-dev-val { display: block; font-size: 18px; font-weight: 800; color: #0f172a; }
.cd-dev-label { font-size: 10px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.3px; }

/* ══ RESPONSIVE ══ */
@media (max-width: 1024px) {
  .cd-layout { grid-template-columns: 1fr; }
  .cd-right { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
}
@media (max-width: 900px) {
  .coins-page { padding: 20px 20px 100px; }
}
@media (max-width: 768px) {
  .coins-page { padding: 16px 16px 100px; }
  .coins-title { font-size: 20px; }
  .view-btn span { display: none; }
  .view-btn { padding: 8px 10px; }
  .th-hide-mobile { display: none !important; }
  .coins-table-wrap { overflow-x: auto; }
  .coins-table { min-width: 380px; }
  .mover-td-meta { display: none; }
  .coins-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cd-hero { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
  .cd-hero-right { text-align: left; }
  .cd-price { font-size: 26px; }
  .cd-stats-grid { grid-template-columns: 1fr 1fr; }
  .cd-right { grid-template-columns: 1fr; }
  .cd-chart-container { height: 220px; }
  .coin-detail-page { padding: 20px 16px; }
  .cmodal-header { padding: 16px; }
  .cmodal-big-price { font-size: 18px; }
  .cmodal-stats-strip { padding: 12px 16px; }
  .cms-item { padding: 0 10px; }
  .cmodal-chart-wrap { height: 220px; padding: 14px 16px; }
  .cmodal-footer { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
}
@media (max-width: 480px) {
  .coins-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .coin-card { padding: 12px; border-radius: 14px; }
  .coin-price { font-size: 15px; }
  .cd-name { font-size: 20px; }
  .cd-price { font-size: 22px; }
  .cd-stats-grid { grid-template-columns: 1fr; }
  .cd-chart-container { height: 200px; }
  .coin-modal { padding: 0; align-items: flex-end; }
  .coin-modal-box { border-radius: 20px 20px 0 0; max-height: 95vh; }
  .cmodal-header { border-radius: 20px 20px 0 0; }
  .cmodal-name { font-size: 15px; }
  .cmodal-big-price { font-size: 15px; }
  .cmodal-chart-wrap { height: 180px; }
}

/* CRITICAL: table rows must never get coin-card flex layout */
tr.coin-row {
  display: table-row !important;
}
tr.coin-row td {
  display: table-cell !important;
}

/* Search: hidden rows must truly disappear */
tr.coin-row[style*="display: none"],
tr.coin-row[style*="display:none"] {
  display: none !important;
  visibility: collapse !important;
}

/* =====================================================
   COINS PAGE — DARK MODE
   ===================================================== */
body.dark .coins-page          { background: transparent; }
body.dark .coins-header        { background: transparent; }
body.dark .coins-title         { color: #F1F5F9; }
body.dark .coins-subtitle      { color: #64748B; }
body.dark .view-btn            { background: #1E293B; border-color: #334155; color: #94A3B8; }
body.dark .view-btn.active     { background: #1E3A5F; color: #3B82F6; border-color: #2563EB; }

body.dark .movers-section      { background: #1E293B; border-color: #334155; }
body.dark .movers-tabs         { border-bottom-color: #334155; }
body.dark .mover-tab           { color: #94A3B8; }
body.dark .mover-tab.active    { color: #3B82F6; border-bottom-color: #3B82F6; }
body.dark .movers-collapse     { color: #94A3B8; background: #0F172A; border-color: #334155; }

body.dark .mover-row           { background: #1E293B; border-bottom-color: #334155; }
body.dark .mover-row:hover     { background: #273549; }
body.dark .mover-td-rank       { color: #64748B; }
body.dark .mover-coin-name     { color: #F1F5F9; }
body.dark .mover-coin-sym      { color: #64748B; }
body.dark .mover-td-price      { color: #F1F5F9; }
body.dark .mover-td-meta       { color: #94A3B8; }

body.dark .mover-card          { background: #1E293B; border-color: #334155; }
body.dark .mover-card:hover    { background: #273549; }

/* Main coin table */
body.dark .coins-table         { border-color: #334155; }
body.dark .coins-table thead tr { background: #0F172A; border-bottom-color: #334155; }
body.dark .coins-table th      { color: #64748B; border-color: #334155; }
body.dark .coins-table td      { color: #94A3B8; border-bottom-color: #334155; }
body.dark .coins-table tbody tr:hover { background: #273549; }
body.dark .coin-name-text      { color: #F1F5F9; }
body.dark .coin-sym-text       { color: #64748B; }
body.dark .coin-price          { color: #F1F5F9; }

/* Card view */
body.dark .coin-card-item      { background: #1E293B; border-color: #334155; }
body.dark .coin-card-item:hover { background: #273549; }
body.dark .coin-card-name      { color: #F1F5F9; }
body.dark .coin-card-sym       { color: #64748B; }
body.dark .coin-card-price     { color: #F1F5F9; }

/* Infinite scroll sentinel */
.coins-load-sentinel {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.coins-load-spinner {
    width: 24px; height: 24px;
    border: 3px solid #E2E8F0;
    border-top-color: #3975EA;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}
body.dark .coins-load-spinner {
    border-color: #334155;
    border-top-color: #3B82F6;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.coins-all-loaded {
    font-size: 12px;
    color: #94A3B8;
    text-align: center;
    padding: 16px 0;
    display: none;
}
body.dark .coins-all-loaded { color: #64748B; }
