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

/* ── VARIABLES ── */
:root {
  --panel: rgba(6, 14, 35, 0.82);
  --border: rgba(0, 180, 255, 0.15);
  --muted: #7a9bbf;
  --accent: #00d4ff;
  --green: #26d87c;
  --red: #f2506a;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(160deg, #020c1e 0%, #030e25 50%, #040f2e 100%);
  color: #e8f4ff;
  min-height: 100vh;
  padding-bottom: 72px;
  font-size: 16px;
}

/* ── TOP NAV ── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(2, 8, 22, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.topnav-inner {
  max-width: 960px; margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: #fff; }
.brand-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff; overflow: hidden;
}
.brand-name { font-size: 1rem; font-weight: 700; letter-spacing: 0.05em; }
.brand-name strong { color: var(--accent); }
.topnav-actions { display: flex; gap: 0.4rem; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  color: #c8deff; font-size: 0.95rem; text-decoration: none;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(0,212,255,0.15); color: var(--accent); }

/* ── NOTIFICATION BELL BADGE ── */
.notif-wrap { position: relative; display: inline-flex; }
.notif-dot {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #f2506a; border: 1.5px solid var(--bg);
  display: none;
  animation: notifPulse 1.8s infinite;
}
.notif-dot.show { display: block; }
@keyframes notifPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.7; }
}

/* ── NAV AVATAR PHOTO ── */
#navAvatarBtn { overflow: hidden; padding: 0; }
#navAvatar { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
#navAvatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
#navAvatar .nav-av-letter { font-size: 0.75rem; font-weight: 800; color: #e0f0ff; }
/* ── HERO ── */
.hero-section {
  padding: 2rem 1rem 1.5rem;
  background:
    radial-gradient(ellipse at 15% 40%, rgba(0,150,255,0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 60%, rgba(0,80,200,0.08) 0%, transparent 50%);
}
.hero-section .container { max-width: 960px; margin: 0 auto; }

.hero-title {
  font-size: clamp(1.4rem, 5vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}
.hero-title .accent {
  color: var(--accent);
  background: rgba(0,100,180,0.22);
  border-radius: 6px;
  padding: 0 0.3rem;
}
.hero-sub {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  max-width: 460px;
}
.btn-trade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #0090ff, #00d4ff);
  color: #fff; font-weight: 700; font-size: 0.9rem;
  padding: 0.6rem 1.6rem; border-radius: 8px;
  text-decoration: none; border: none; cursor: pointer;
  margin-bottom: 1.5rem; text-align: center;
  transition: filter 0.2s, transform 0.15s;
}
.btn-trade:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ── HERO STATS BAR ── */
.hero-stats {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(3,16,48,0.95), rgba(2,10,30,0.98));
  border: 1px solid rgba(0,180,255,0.14);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  flex-wrap: wrap;
}
.stat-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1.1rem;
  transition: background 0.2s;
  min-width: 0;
}
.stat-item:hover { background: rgba(0,180,255,0.05); }
.stat-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: rgba(0,150,255,0.14);
  border: 1px solid rgba(0,180,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; color: var(--accent);
}
.stat-icon.si-green  { background: rgba(38,216,124,0.12); border-color: rgba(38,216,124,0.22); color: var(--green); }
.stat-icon.si-purple { background: rgba(160,100,255,0.12); border-color: rgba(160,100,255,0.22); color: #b07aff; }
.stat-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
  margin-bottom: 0.18rem;
  white-space: nowrap;
}
.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
.stat-divider {
  width: 1px; height: 36px; flex-shrink: 0;
  background: linear-gradient(to bottom, transparent, rgba(0,180,255,0.18), transparent);
}

/* Mobile responsive for hero stats */
@media (max-width: 640px) {
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    flex-direction: unset;
  }
  .stat-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem 0.4rem;
    border-bottom: none;
    gap: 0.4rem;
  }
  .stat-item:not(:last-child) {
    border-right: 1px solid rgba(0,180,255,0.08);
  }
  .stat-divider {
    display: none;
  }
  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  .stat-label {
    font-size: 0.55rem;
    white-space: nowrap;
  }
  .stat-value {
    font-size: 0.95rem;
  }
}

/* ── SHARED ── */
.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
.section-block { padding: 0.5rem 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
}
.panel-title { font-size: 0.95rem; font-weight: 700; color: #d0e8ff; }
.btn-options {
  background: rgba(0,180,255,0.12);
  border: 1px solid rgba(0,180,255,0.28);
  color: var(--accent); font-size: 0.75rem;
  padding: 0.22rem 0.65rem; border-radius: 6px; cursor: pointer;
}
.section-title { font-size: 0.95rem; font-weight: 700; color: #d0e8ff; margin-bottom: 0.9rem; }
.view-all { color: var(--accent); font-size: 0.8rem; text-decoration: none; }
.view-all:hover { text-decoration: underline; }
.view-all-wrap { text-align: center; padding-top: 0.5rem; }

/* ── MARKET TABLE ── */
.table-wrap { overflow-x: auto; }
.market-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; table-layout: fixed; }
.market-table th {
  color: var(--muted); font-weight: 600; font-size: 0.72rem;
  padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border);
}
.market-table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(0,150,255,0.07);
  vertical-align: middle;
}
.market-table tr:hover td { background: rgba(0,150,255,0.05); }

.col-name   { text-align: left;   width: 35%; }
.col-price  { text-align: left;   width: 25%; }
.col-spark  { text-align: center; width: 22%; }
.col-change { text-align: right;  width: 18%; }
.market-table td.col-price  { color: #e0f0ff; font-weight: 500; }
.market-table td.col-spark  { padding: 0.25rem 0.4rem; }
.market-table td.col-change { font-weight: 600; }

@keyframes flashGreen { 0%,100%{background:transparent} 50%{background:rgba(38,216,124,0.16)} }
@keyframes flashRed   { 0%,100%{background:transparent} 50%{background:rgba(242,80,106,0.16)} }
.flash-green { animation: flashGreen 0.5s ease; }
.flash-red   { animation: flashRed   0.5s ease; }

.ws-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ws-live       { background: var(--green); box-shadow: 0 0 6px var(--green); animation: wsPulse 1.5s infinite; }
.ws-connecting { background: #ffd060; box-shadow: 0 0 6px #ffd060; }
.ws-off        { background: var(--red); }
@keyframes wsPulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

.coin-cell { display: flex; align-items: center; gap: 0.55rem; }
.green { color: var(--green); }
.red   { color: var(--red); }
.coin-name { font-weight: 600; font-size: 0.85rem; color: #e0f0ff; margin-bottom: 0.25rem; }
.coin-sub  { font-size: 0.7rem; color: var(--muted); margin-top: 0.15rem; }
.sparkline { display: block; width: 80px; height: 26px; }

.coin-img {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: rgba(0,100,200,0.2);
}
.coin-img-err {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.58rem; font-weight: 800; color: #fff;
  background: rgba(0,100,200,0.4);
}

/* ── CHART ── */
.chart-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.chart-tab {
  background: rgba(0,100,180,0.14); border: 1px solid rgba(0,180,255,0.18);
  color: var(--muted); font-size: 0.8rem; padding: 0.28rem 0.75rem;
  border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.chart-tab.active, .chart-tab:hover { background: rgba(0,180,255,0.22); color: var(--accent); border-color: var(--accent); }
.chart-info-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.chart-pair-name { font-weight: 700; font-size: 0.92rem; }
.chart-price { font-size: 1rem; font-weight: 700; }
.chart-time-btns { display: flex; gap: 0.25rem; margin-left: auto; }
.time-btn {
  background: transparent; border: 1px solid rgba(0,180,255,0.18);
  color: var(--muted); font-size: 0.72rem; padding: 0.18rem 0.5rem;
  border-radius: 5px; cursor: pointer; transition: all 0.2s;
}
.time-btn.active { background: rgba(0,180,255,0.18); color: var(--accent); border-color: var(--accent); }
.chart-canvas-wrap { position: relative; width: 100%; }
.chart-canvas-wrap canvas { width: 100% !important; }
.chart-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem; margin-top: 0.75rem;
  border-top: 1px solid var(--border); padding-top: 0.75rem;
}
.chart-stat { padding: 0; min-width: 0; overflow: hidden; }
.cs-label { font-size: 0.68rem; color: var(--muted); margin-bottom: 0.12rem; white-space: nowrap; }
.cs-val { font-size: 0.88rem; font-weight: 700; color: #e0f0ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── WHY CHOOSE US ── */
.why-panel { padding: 1.4rem 1rem; }
.why-header { text-align: center; margin-bottom: 1.3rem; }
.why-badge {
  display: inline-block;
  background: rgba(0,180,255,0.1); border: 1px solid rgba(0,180,255,0.28);
  color: var(--accent); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.18rem 0.7rem; border-radius: 20px; margin-bottom: 0.5rem;
}
.why-title { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 800; color: #e8f4ff; margin-bottom: 0.35rem; }
.why-title span { color: var(--accent); }
.why-sub { font-size: 0.78rem; color: var(--muted); }

.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.feature-box {
  position: relative; display: flex; flex-direction: column; gap: 0.65rem;
  background: rgba(5,15,45,0.65); border: 1px solid rgba(0,150,255,0.1);
  border-radius: 12px; padding: 1rem; overflow: hidden;
  transition: border-color 0.3s, transform 0.2s;
}
.feature-box:hover { border-color: rgba(0,200,255,0.3); transform: translateY(-2px); }
.feature-icon-wrap { position: relative; width: fit-content; }
.feature-icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: rgba(0,100,200,0.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #5bc8ff; position: relative; z-index: 1;
}
.feature-icon.accent2 { background: rgba(0,200,100,0.18);  color: var(--green); }
.feature-icon.accent3 { background: rgba(255,200,0,0.14);  color: #ffd060; }
.feature-icon.accent4 { background: rgba(150,80,255,0.18); color: #b07aff; }
.feature-glow {
  position: absolute; width: 40px; height: 40px; border-radius: 50%;
  filter: blur(12px); top: 0; left: 0; z-index: 0; opacity: 0.45;
}
.glow-blue{background:#00aaff} .glow-green{background:#26d87c}
.glow-yellow{background:#ffd060} .glow-purple{background:#b07aff}
.feature-text h4 { font-size: 0.88rem; font-weight: 700; color: #e0f0ff; margin-bottom: 0.25rem; }
.feature-text p  { font-size: 0.76rem; color: var(--muted); line-height: 1.55; margin: 0; }
.feature-line {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,200,255,0.35), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.feature-box:hover .feature-line { opacity: 1; }

/* ── DEPOSIT ── */
.deposit-panel { text-align: center; }
.deposit-sub { color: var(--muted); font-size: 0.8rem; margin-bottom: 1.1rem; }
.deposit-btns { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.btn-deposit, .btn-withdraw {
  flex: 1; max-width: 200px; padding: 0.7rem 1rem;
  border: none; border-radius: 10px; font-weight: 700; font-size: 0.9rem;
  cursor: pointer; color: #fff; transition: filter 0.2s, transform 0.15s;
}
.btn-deposit  { background: linear-gradient(90deg, #00b894, #00d4aa); }
.btn-withdraw { background: linear-gradient(90deg, #e84393, #f25f72); }
.btn-deposit:hover, .btn-withdraw:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ── NEWS ── */
.news-card { overflow: hidden; }
.news-img-wrap {
  position: relative; border-radius: 10px; overflow: hidden;
  margin-bottom: 0.75rem; height: 170px; background: rgba(0,30,80,0.5);
}
.news-img { width: 100%; height: 100%; object-fit: cover; }
.news-img-fallback {
  display: none; width: 100%; height: 100%;
  align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--muted);
  background: linear-gradient(135deg, rgba(0,50,120,0.6), rgba(0,20,60,0.8));
}
.news-badge {
  display: inline-block; background: rgba(0,180,255,0.18); color: var(--accent);
  font-size: 0.68rem; padding: 0.12rem 0.5rem; border-radius: 4px; margin-bottom: 0.35rem;
}
.news-date { font-size: 0.68rem; color: var(--muted); margin-bottom: 0.45rem; }
.news-headline { font-size: 0.9rem; font-weight: 700; color: #e0f0ff; margin-bottom: 0.45rem; line-height: 1.4; }
.news-excerpt { font-size: 0.76rem; color: var(--muted); line-height: 1.55; margin-bottom: 0.55rem; }
.news-read-more { color: var(--accent); font-size: 0.78rem; text-decoration: none; font-weight: 600; }
.news-read-more:hover { text-decoration: underline; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(2,8,22,0.96); border-top: 1px solid var(--border);
  display: flex; z-index: 200; backdrop-filter: blur(10px);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 0.55rem 0; text-decoration: none;
  color: var(--muted); font-size: 0.62rem; gap: 0.18rem; transition: color 0.2s;
}
.bnav-item i { font-size: 1.2rem; }
.bnav-item.active, .bnav-item:hover { color: var(--accent); }
.bnav-center {
  background: linear-gradient(135deg, rgba(0,100,200,0.28), rgba(0,200,255,0.18));
  border-radius: 12px 12px 0 0; color: var(--accent);
}

/* ── RESPONSIVE ── */

/* prevent horizontal scroll globally */
html { overflow-x: hidden; }
body { overflow-x: hidden; max-width: 100vw; }

@media (max-width: 320px) {
  body { font-size: 13px; }
  .container { padding: 0 0.5rem; }
  .topnav-inner { padding: 0.5rem 0.5rem; }
  .hero-title { font-size: 1.1rem; }
  .stat-item { padding: 0.5rem 0.4rem; gap: 0.3rem; }
  .stat-icon { width: 24px; height: 24px; font-size: 0.7rem; }
  .stat-value { font-size: 0.88rem; }
  .stat-label { font-size: 0.52rem; }
  .panel { padding: 0.6rem; }
  .bnav-item { font-size: 0.52rem; padding: 0.45rem 0; }
  .bnav-item i { font-size: 1rem; }
  .btn-trade { font-size: 0.78rem; padding: 0.5rem 1rem; }
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  .hero-title { font-size: 1.2rem; }
  .hero-sub { font-size: 0.76rem; }
  .stat-value { font-size: 1rem; }
  .stat-label { font-size: 0.58rem; }
  .stat-icon { width: 28px; height: 28px; font-size: 0.78rem; }
  .stat-item { padding: 0.7rem 0.65rem; gap: 0.45rem; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-box { align-items: center; text-align: center; }
  .feature-icon-wrap { margin: 0 auto; }
  .feature-text h4 { text-align: center; }
  .feature-text p  { text-align: center; }
  .chart-stats-grid { grid-template-columns: unset; display: flex; flex-wrap: wrap; gap: 1.8rem; }
  .market-table { font-size: 0.8rem; }
  .coin-name { font-size: 0.8rem; }
  .sparkline { width: 55px; height: 22px; }
  .panel { padding: 0.75rem; }
  .topnav-inner { padding: 0.6rem 0.75rem; }
  .container { padding: 0 0.75rem; }
  .btn-trade { font-size: 0.85rem; padding: 0.65rem 1.4rem; min-height: 44px; }
  .chart-tab { font-size: 0.75rem; padding: 0.35rem 0.65rem; min-height: 36px; }
  .time-btn { font-size: 0.7rem; padding: 0.3rem 0.5rem; min-height: 32px; }
  .cs-val { font-size: 0.75rem; }
  .cs-label { font-size: 0.6rem; }
  .deposit-btns { flex-direction: column; align-items: stretch; }
  .btn-deposit, .btn-withdraw { max-width: 100%; width: 100%; min-height: 48px; }
  .bnav-item { font-size: 0.6rem; padding: 0.6rem 0; min-height: 52px; }
  .bnav-item i { font-size: 1.2rem; }
  .icon-btn { width: 36px; height: 36px; }
  .btn-options { padding: 0.35rem 0.75rem; min-height: 32px; }
}

@media (min-width: 481px) and (max-width: 767px) {
  .stat-value { font-size: 1.1rem; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sparkline { width: 70px; }
  .btn-trade { min-height: 44px; }
  .bnav-item { min-height: 52px; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .hero-section { padding: 2rem 1rem 1.5rem; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-stats-grid { grid-template-columns: repeat(4, 1fr); }
  .news-img-wrap { height: 200px; }
  .stat-value { font-size: 1.2rem; }
  .topnav-inner { padding: 0.7rem 1.25rem; }
  .container { padding: 0 1.25rem; }
}

@media (min-width: 768px) {
  .hero-section { padding: 2.5rem 1rem 2rem; }
  .features-grid { grid-template-columns: repeat(4, 1fr); }
  .chart-stats-grid { grid-template-columns: repeat(4, 1fr); }
  .news-img-wrap { height: 220px; }
  .stat-value { font-size: 1.35rem; }
  .topnav-inner { padding: 0.7rem 1.5rem; }
  .container { padding: 0 1.5rem; }
}

/* landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section { padding: 1rem; }
  .bottom-nav { padding: 0.3rem 0; }
  .bnav-item { padding: 0.3rem 0; min-height: 44px; }
  body { padding-bottom: 56px; }
}
