@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Design Tokens ───────────────────────────────────────────────── */
:root {
  --bg:     #0B0E11;
  --card:   #131920;
  --card2:  #1C2433;
  --green:  #00D897;
  --red:    #FF4757;
  --blue:   #4B9EFF;
  --gold:   #FFB347;
  --text:   #E8EDF5;
  --muted:  #8A95A3;
  --border: #1E2A38;
}

/* ── Base ────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding-bottom: 72px;
  -webkit-font-smoothing: antialiased;
}

/* ── Bootstrap Overrides ─────────────────────────────────────────── */
.navbar {
  background: var(--card) !important;
  border-bottom: 1px solid var(--border);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.form-control {
  background: var(--card2);
  color: var(--text);
  border-color: var(--border);
}

.form-control:focus {
  background: var(--card2);
  color: var(--text);
  border-color: var(--blue);
  box-shadow: none;
}

.form-control::placeholder {
  color: var(--muted);
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
}

.btn-success {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

.btn-warning {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

.btn-outline-danger {
  border-color: var(--red);
  color: var(--red);
}

.btn-outline-danger:hover {
  background: rgba(255, 71, 87, .1);
  color: var(--red);
}

.badge {
  border-radius: 100px;
}

.badge.bg-success {
  background: rgba(0, 216, 151, .2) !important;
  color: var(--green);
}

.badge.bg-danger {
  background: rgba(255, 71, 87, .2) !important;
  color: var(--red);
}

.badge.bg-secondary {
  background: var(--card2) !important;
  color: var(--muted);
}

.alert.alert-success {
  background: rgba(0, 216, 151, .12);
  border-color: rgba(0, 216, 151, .3);
  color: var(--green);
}

.alert.alert-danger {
  background: rgba(255, 71, 87, .12);
  border-color: rgba(255, 71, 87, .3);
  color: var(--red);
}

.alert.alert-warning {
  background: rgba(255, 179, 71, .12);
  border-color: rgba(255, 179, 71, .3);
  color: var(--gold);
}

.spinner-border {
  border-color: var(--blue) transparent transparent transparent;
}

code {
  background: var(--card2);
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--green);
  font-size: 13px;
  display: block;
}

/* ── Price Colors ────────────────────────────────────────────────── */
.price-up   { color: var(--green); }
.price-down { color: var(--red); }

/* ── App Bar ─────────────────────────────────────────────────────── */
.app-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
}

.page-content {
  padding-top: 64px;
}

/* ── Price Hero ──────────────────────────────────────────────────── */
.price-hero {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* ── Change Pill ─────────────────────────────────────────────────── */
.change-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
}

.pill-up   { background: rgba(0, 216, 151, .15); color: #00D897; }
.pill-down { background: rgba(255, 71, 87, .15);  color: #FF4757; }

/* ── Section Label ───────────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Stock Row ───────────────────────────────────────────────────── */
.stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity .15s;
}

.stock-row:last-child { border-bottom: none; }
.stock-row:hover      { opacity: .75; }

.symbol-text { font-size: 16px; font-weight: 700; }
.time-text   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.price-text  { font-size: 17px; font-weight: 600; }

/* Legacy stock-card alias */
.stock-card { cursor: pointer; transition: border-color .2s; }
.stock-card:hover { border-color: var(--blue); }

/* ── Tab Pills ───────────────────────────────────────────────────── */
.tab-pill {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-pill.active,
.tab-pill:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ── Input Field ─────────────────────────────────────────────────── */
.input-field {
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: border-color .2s;
}

.input-field:focus       { border-color: var(--blue); }
.input-field::placeholder { color: var(--muted); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-accent {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
  width: 100%;
  font-family: inherit;
}

.btn-accent:hover    { opacity: .85; }
.btn-accent:disabled { opacity: .5; cursor: not-allowed; }

.btn-green-solid {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 10px;
}

.btn-red-outline {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 10px;
}

/* ── News Card ───────────────────────────────────────────────────── */
.news-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.news-card:last-child { border-bottom: none; }

/* Legacy news-item alias */
.news-item { border-bottom: 1px solid var(--border); padding: 12px 0; }
.news-item:last-child { border-bottom: none; }

/* ── Premium Lock ────────────────────────────────────────────────── */
.premium-lock {
  text-align: center;
  padding: 40px 20px;
}

/* ── Stats Grid ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.stat-item {
  padding: 14px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.stat-item:last-child { border-right: none; }
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-value { font-size: 16px; font-weight: 700; }

/* ── Legacy Badges ───────────────────────────────────────────────── */
.badge-free    { background: var(--card2); color: var(--muted); }
.badge-premium { background: rgba(255, 179, 71, .15); color: var(--gold); }

/* ── Misc ────────────────────────────────────────────────────────── */
.alert-item { display: flex; justify-content: space-between; align-items: center; }

/* ── Bottom Nav ──────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 1000;
}

.bottom-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  font-size: 10px;
  font-weight: 500;
  transition: color .2s;
}

.bottom-nav a::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--blue);
  border-radius: 0 0 2px 2px;
  transition: width .2s;
}

.bottom-nav a.active,
.bottom-nav a:hover {
  color: var(--blue);
}

.bottom-nav a.active::before {
  width: 24px;
}

.bottom-nav a svg {
  width: 22px;
  height: 22px;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .container { padding: 0 12px; }
}
