/* ===========================
   G-KBY EXCHANGE — style.css
   =========================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-base:    #0a0e1a;
  --bg-card:    #0d1120;
  --bg-dark:    #080b14;
  --bg-side:    #0b0f1c;
  --border:     rgba(255,255,255,0.07);
  --border-dim: rgba(255,255,255,0.03);
  --text-1:     #e2e8f0;
  --text-2:     #8892a4;
  --text-3:     #5a6478;
  --text-4:     #3d4760;
  --text-5:     #2d3448;
  --accent:     #6c63ff;
  --accent-dim: rgba(108,99,255,0.1);
  --accent-bdr: rgba(108,99,255,0.25);
  --green:      #22d3a5;
  --red:        #f0657a;
  --amber:      #e2b247;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── NAVBAR ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-card);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
}

.logo-text {
  font-size: 17px; font-weight: 500;
  color: #fff; letter-spacing: 0.04em;
  white-space: nowrap;
}
.logo-text span { color: var(--accent); }

.nav-links {
  display: flex; gap: 4px; align-items: center;
  flex: 1; justify-content: center;
}

.nav-link {
  font-size: 13px; color: var(--text-3); cursor: pointer;
  padding: 6px 12px; border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-1);
  background: var(--accent-dim);
}

.nav-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,211,165,0.08);
  border: 0.5px solid rgba(34,211,165,0.2);
  border-radius: 5px; padding: 4px 10px;
  font-size: 11px; color: var(--green);
  white-space: nowrap;
}

.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%; background: var(--green);
  animation: pulse 1.5s infinite;
}

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

.refresh-btn {
  font-size: 12px; padding: 6px 12px;
  background: transparent;
  border: 0.5px solid var(--accent-bdr);
  color: var(--accent); border-radius: 6px; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.refresh-btn:hover { background: var(--accent-dim); }

.login-btn {
  font-size: 12px; padding: 6px 16px;
  background: var(--accent); border: none;
  color: #fff; border-radius: 6px; cursor: pointer;
  font-weight: 500; transition: opacity 0.2s;
  white-space: nowrap;
}
.login-btn:hover { opacity: 0.85; }

.hamburger {
  display: none;
  background: transparent; border: 0.5px solid var(--border);
  color: var(--text-2); padding: 6px 9px;
  border-radius: 6px; cursor: pointer; font-size: 18px;
}

/* ── MOBILE MENU ── */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-card);
  border-bottom: 0.5px solid var(--border);
  padding: 8px 16px 12px;
  gap: 2px;
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { padding: 10px 12px; border-radius: 6px; }

/* ── TICKER BAR ── */
.ticker-bar {
  background: var(--bg-dark);
  border-bottom: 0.5px solid rgba(255,255,255,0.04);
  padding: 8px 0; overflow: hidden;
}

.ticker-inner {
  display: flex; gap: 32px;
  animation: tickerScroll 36s linear infinite;
  white-space: nowrap; padding: 0 24px;
}

.ticker-inner:hover { animation-play-state: paused; }

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.t-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3);
}
.t-name  { color: var(--text-1); font-weight: 500; }
.t-price { color: var(--text-2); }
.ticker-loading { font-size: 11px; color: var(--text-4); }

/* ── HERO STATS ── */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.04);
  border-bottom: 0.5px solid rgba(255,255,255,0.04);
}

.hero-cell {
  background: var(--bg-card);
  padding: 16px 20px;
}

.h-label {
  font-size: 10px; color: var(--text-4);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.h-val  { font-size: 20px; font-weight: 500; color: #fff; }
.h-sub  { font-size: 11px; margin-top: 3px; }

/* ── MAIN LAYOUT ── */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  min-height: calc(100vh - 200px);
}

.content {
  padding: 20px 24px;
  border-right: 0.5px solid var(--border);
}

/* ── SECTION HEADER ── */
.sec-head {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}

.sec-title {
  font-size: 11px; color: var(--text-4);
  font-weight: 500; letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sec-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.filter-tabs { display: flex; gap: 3px; }

.tab {
  font-size: 11px; padding: 4px 10px;
  border-radius: 5px; cursor: pointer;
  color: var(--text-4);
  border: 0.5px solid transparent;
  background: transparent;
  transition: all 0.15s;
}
.tab:hover { color: var(--text-2); }
.tab.active {
  color: var(--accent);
  border-color: var(--accent-bdr);
  background: var(--accent-dim);
}

.last-upd { font-size: 10px; color: var(--text-5); }

/* ── COIN TABLE ── */
.coin-table { width: 100%; border-collapse: collapse; }

.coin-table th {
  font-size: 10px; color: var(--text-5);
  font-weight: 500; text-align: left;
  padding: 8px 8px;
  border-bottom: 0.5px solid rgba(255,255,255,0.04);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.coin-table th.r,
.coin-table td.r { text-align: right; }

.coin-row {
  border-bottom: 0.5px solid var(--border-dim);
  cursor: pointer; transition: background 0.12s;
}
.coin-row:hover { background: rgba(108,99,255,0.04); }

.coin-row td { padding: 10px 8px; font-size: 12px; vertical-align: middle; }

.rk { color: var(--text-5); font-size: 10px; width: 28px; }

.coin-inf { display: flex; align-items: center; gap: 8px; }

.ci {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: contain; flex-shrink: 0;
}
.ci-fb {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.cn { font-size: 12px; font-weight: 500; color: var(--text-1); }
.cs { font-size: 10px; color: var(--text-4); }

.prc { color: #c5cad6; font-variant-numeric: tabular-nums; }
.mcap { color: var(--text-4); font-size: 11px; }

/* ── SPARKLINE ── */
.spark { width: 58px; height: 26px; }
.sp-l  { fill: none; stroke-width: 1.4; }
.sp-u  { stroke: var(--green); }
.sp-d  { stroke: var(--red); }
.sp-au { fill: rgba(34,211,165,0.07); stroke: none; }
.sp-ad { fill: rgba(240,101,122,0.07); stroke: none; }

/* ── UP / DOWN ── */
.up { color: var(--green); }
.dn { color: var(--red); }

/* ── SIDEBAR ── */
.sidebar { padding: 18px; background: var(--bg-side); }

.s-card {
  background: var(--bg-card);
  border: 0.5px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 14px;
  margin-bottom: 14px;
}

.s-title {
  font-size: 10px; color: var(--text-4);
  letter-spacing: 0.07em; text-transform: uppercase;
  margin-bottom: 10px;
}

/* Fear & Greed */
.fg-row { display: flex; align-items: center; justify-content: space-between; }
.fg-num { font-size: 26px; font-weight: 500; }
.fg-txt { font-size: 12px; margin-top: 2px; }
.fg-bar {
  height: 5px; border-radius: 3px;
  background: rgba(255,255,255,0.06); margin-top: 10px;
}
.fg-fill { height: 100%; border-radius: 3px; }
.fg-axis {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-5); margin-top: 3px;
}

/* Global Stats */
.global-rows { display: flex; flex-direction: column; gap: 8px; }
.g-row { display: flex; justify-content: space-between; font-size: 11px; }
.g-lbl { color: var(--text-4); }
.g-val { color: #c5cad6; font-weight: 500; }

/* Trending */
.trending-list { display: flex; flex-direction: column; gap: 0; }
.tr-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 0.5px solid var(--border-dim);
  cursor: pointer; transition: opacity 0.12s;
}
.tr-item:last-child { border-bottom: none; }
.tr-item:hover { opacity: 0.8; }

.tr-left { display: flex; align-items: center; gap: 7px; }
.tr-ic { width: 24px; height: 24px; border-radius: 50%; object-fit: contain; }
.tr-ic-fb {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
}
.tr-name { font-size: 11px; color: var(--text-2); }
.tr-sym  { font-size: 9px;  color: var(--text-5); }
.tr-right { text-align: right; }
.tr-prc { font-size: 11px; color: #c5cad6; }
.tr-chg { font-size: 10px; }

/* ── STATES ── */
.loading-state {
  text-align: center; padding: 40px;
  color: var(--text-4); font-size: 13px;
}

.error-box {
  background: rgba(240,101,122,0.06);
  border: 0.5px solid rgba(240,101,122,0.15);
  border-radius: 8px; padding: 16px;
  color: var(--red); font-size: 12px;
  text-align: center; margin: 10px 0;
}
.error-box small {
  display: block; margin-top: 6px;
  color: var(--text-3); font-size: 10px;
}

/* ── FOOTER ── */
.footer {
  background: var(--bg-card);
  border-top: 0.5px solid var(--border);
  padding: 16px 24px;
}
.footer-inner {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.footer-logo { display: flex; align-items: center; gap: 8px; }
.footer-text { font-size: 11px; color: var(--text-4); }
.footer-text a { color: var(--accent); }
.footer-text a:hover { text-decoration: underline; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .main-layout { grid-template-columns: 1fr; }
  .content { border-right: none; }
  .sidebar { border-top: 0.5px solid var(--border); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-right  { display: none; }
  .hamburger  { display: block; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 14px; }
  .sidebar { padding: 14px; }
  .navbar { padding: 12px 16px; }

  .coin-table th:nth-child(5),
  .coin-table td:nth-child(5),
  .coin-table th:nth-child(6),
  .coin-table td:nth-child(6),
  .coin-table th:nth-child(8),
  .coin-table td:nth-child(8) { display: none; }
}

@media (max-width: 480px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .h-val { font-size: 16px; }
  .logo-text { font-size: 14px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--text-5); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ── SPIN ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.ti-spin { display: inline-block; animation: spin 1s linear infinite; }
