/* =============================================
   FYROEXCHANGE — GLOBAL DESIGN SYSTEM
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@300;400;500;600&family=Manrope:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Backgrounds */
  --bg0: #030810;
  --bg1: #060d1a;
  --bg2: #091223;
  --bg3: #0d1830;
  --bg4: #12203b;
  --bg5: #182844;

  /* Glass */
  --glass: rgba(255,255,255,0.025);
  --glass2: rgba(255,255,255,0.05);
  --glass3: rgba(255,255,255,0.085);
  --glass4: rgba(255,255,255,0.12);

  /* Borders */
  --b1: rgba(255,255,255,0.05);
  --b2: rgba(255,255,255,0.09);
  --b3: rgba(255,255,255,0.15);
  --b4: rgba(255,255,255,0.22);

  /* Text */
  --t1: #e2eaff;
  --t2: #6b85b0;
  --t3: #304058;
  --t4: #1c2c42;

  /* Brand colors */
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --accent3: #60a5fa;
  --green: #0ecb81;
  --green2: #05a868;
  --red: #f6465d;
  --red2: #d4243a;
  --gold: #f0b90b;
  --gold2: #d4a009;
  --gold3: #ffd740;
  --purple: #8b5cf6;
  --cyan: #06b6d4;

  /* FYRO brand */
  --fyro: #f0b90b;
  --fyro-glow: rgba(240,185,11,0.15);
  --fyro-soft: rgba(240,185,11,0.06);

  /* Typography */
  --fd: 'Syne', sans-serif;
  --fm: 'IBM Plex Mono', monospace;
  --fb: 'Manrope', sans-serif;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadows */
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.6);
  --glow-gold: 0 0 24px rgba(240,185,11,0.2);
  --glow-green: 0 0 16px rgba(14,203,129,0.2);
  --glow-red: 0 0 16px rgba(246,70,93,0.2);
}

/* Light theme */
[data-theme="light"] {
  --bg0: #edf2fc;
  --bg1: #f4f7ff;
  --bg2: #ffffff;
  --bg3: #eef2fa;
  --bg4: #e5ecf8;
  --bg5: #dce5f4;
  --glass: rgba(255,255,255,0.7);
  --glass2: rgba(255,255,255,0.85);
  --glass3: rgba(255,255,255,0.95);
  --glass4: rgba(255,255,255,0.98);
  --b1: rgba(0,0,0,0.06);
  --b2: rgba(0,0,0,0.10);
  --b3: rgba(0,0,0,0.16);
  --b4: rgba(0,0,0,0.24);
  --t1: #0a1628;
  --t2: #4a5e82;
  --t3: #98adc8;
  --t4: #c8d6ec;
  --fyro-soft: rgba(240,185,11,0.08);
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--fb);
  background: var(--bg0);
  color: var(--t1);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: var(--fb); }
img { max-width: 100%; display: block; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--b3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--b4); }

/* ── Utility classes ── */
.up { color: var(--green) !important; }
.dn { color: var(--red) !important; }
.gold { color: var(--gold) !important; }
.accent { color: var(--accent3) !important; }
.mono { font-family: var(--fm) !important; }
.bold { font-weight: 700; }
.text-sm { font-size: 11px; }
.text-xs { font-size: 10px; }
.muted { color: var(--t2); }
.muted2 { color: var(--t3); }

/* ── Ambient background ── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient::before {
  content: '';
  position: absolute;
  top: -25%;
  left: -15%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(37,99,235,0.05) 0%, transparent 70%);
  animation: amb-float1 25s ease-in-out infinite alternate;
}
.ambient::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 55%;
  height: 55%;
  background: radial-gradient(ellipse, rgba(139,92,246,0.04) 0%, transparent 70%);
  animation: amb-float2 32s ease-in-out infinite alternate-reverse;
}
.ambient-3 {
  position: absolute;
  top: 35%;
  left: 35%;
  width: 40%;
  height: 40%;
  background: radial-gradient(ellipse, rgba(240,185,11,0.03) 0%, transparent 70%);
  animation: amb-float1 40s ease-in-out infinite alternate;
}
@keyframes amb-float1 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(25px,18px) scale(1.08); } }
@keyframes amb-float2 { 0% { transform: translate(0,0); } 100% { transform: translate(-18px,25px); } }

/* ── Live indicator ── */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: live-pulse 1.6s infinite;
}
@keyframes live-pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.4; transform:scale(0.75); } }

/* ── Price badge ── */
.pct-badge {
  display: inline-block;
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
}
.pct-badge.up { background: rgba(14,203,129,0.1); color: var(--green); }
.pct-badge.dn { background: rgba(246,70,93,0.1); color: var(--red); }

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
  display: inline-block;
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Card ── */
.card {
  background: var(--glass);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--b3), transparent);
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--b2);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease;
  pointer-events: all;
  min-width: 250px;
  max-width: 340px;
}
.toast.out { animation: toast-out 0.25s ease forwards; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent3); }
@keyframes toast-in { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }
@keyframes toast-out { to { opacity:0; transform:translateX(20px); } }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--fb);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #e08000); color: #000; }
.btn-gold:hover { box-shadow: 0 6px 20px rgba(240,185,11,0.3); }
.btn-green { background: linear-gradient(135deg, var(--green), var(--green2)); color: #fff; }
.btn-green:hover { box-shadow: var(--glow-green); }
.btn-red { background: linear-gradient(135deg, var(--red), var(--red2)); color: #fff; }
.btn-red:hover { box-shadow: var(--glow-red); }
.btn-ghost { background: var(--glass2); border: 1px solid var(--b2); color: var(--t2); }
.btn-ghost:hover { background: var(--glass3); color: var(--t1); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent2); }
.btn-sm { font-size: 12px; padding: 6px 14px; }
.btn-lg { font-size: 15px; padding: 12px 24px; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 500;
  height: 60px;
  background: rgba(6,13,26,0.92);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
}
[data-theme="light"] .nav { background: rgba(244,247,255,0.95); }
.nav-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), #e08000);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-weight: 800; font-size: 15px; color: #000;
  flex-shrink: 0;
}
.nav-title { font-family: var(--fd); font-size: 16px; font-weight: 700; letter-spacing: -0.05em; }
.nav-title span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.nav-link { padding: 6px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; color: var(--t2); transition: all 0.2s; white-space: nowrap; }
.nav-link:hover, .nav-link.active { background: var(--glass2); color: var(--t1); }
.nav-badge { display: inline-flex; align-items: center; background: rgba(240,185,11,0.12); color: var(--gold); font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-left: 5px; border: 1px solid rgba(240,185,11,0.2); letter-spacing: 0.04em; }
.nav-spacer { flex: 1; }

/* ── Search ── */
.nav-search { position: relative; }
.nav-search input {
  background: var(--glass2);
  border: 1px solid var(--b2);
  border-radius: var(--r-md);
  padding: 7px 14px 7px 34px;
  font-size: 13px;
  color: var(--t1);
  outline: none;
  width: 220px;
  transition: all 0.2s;
}
.nav-search input::placeholder { color: var(--t3); }
.nav-search input:focus { border-color: var(--accent); width: 280px; background: var(--glass3); }
.nav-search .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--t3); pointer-events: none; }
.search-drop {
  position: absolute;
  top: calc(100% + 5px);
  left: 0; right: 0;
  background: var(--bg2);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  display: none;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 350px;
  overflow-y: auto;
}
.search-drop.open { display: block; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; transition: background 0.15s; }
.search-item:hover { background: var(--glass2); }
.search-ico { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; flex-shrink: 0; }
.search-info .name { font-weight: 600; font-size: 13px; }
.search-info .sym { color: var(--t2); font-size: 11px; font-family: var(--fm); }
.search-price { font-family: var(--fm); font-size: 12px; margin-left: auto; }

/* ── Ticker ── */
.ticker-bar {
  position: relative;
  z-index: 10;
  background: var(--bg1);
  border-bottom: 1px solid var(--b1);
  height: 32px;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.ticker-fade { position: absolute; top: 0; bottom: 0; width: 60px; z-index: 2; pointer-events: none; }
.ticker-fade-l { left: 0; background: linear-gradient(to right, var(--bg1), transparent); }
.ticker-fade-r { right: 0; background: linear-gradient(to left, var(--bg1), transparent); }
.ticker-track { display: flex; white-space: nowrap; animation: ticker-scroll 100s linear infinite; }
@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  font-size: 11px;
  font-family: var(--fm);
  color: var(--t2);
  border-right: 1px solid var(--b1);
  cursor: pointer;
  transition: color 0.2s;
}
.ticker-item:hover { color: var(--t1); }
.ticker-item .sym { color: var(--t1); font-weight: 600; }
.ticker-item.fyro { background: var(--fyro-soft); }
.ticker-item.fyro .sym { color: var(--gold); }

/* ── Wallet button ── */
.wallet-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--glass2);
  border: 1px solid var(--b2);
  border-radius: var(--r-md);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  transition: all 0.2s;
  flex-shrink: 0;
}
.wallet-btn:hover { background: var(--glass3); color: var(--t1); border-color: var(--b3); }
.wallet-btn.connected { border-color: rgba(14,203,129,0.3); color: var(--green); background: rgba(14,203,129,0.05); }
.wallet-btn .w-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--t3); flex-shrink: 0; }
.wallet-btn.connected .w-dot { background: var(--green); animation: live-pulse 2s infinite; }
.wallet-btn .w-addr { font-family: var(--fm); font-size: 11px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--b2);
  border-radius: var(--r-xl);
  padding: 28px;
  width: 440px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modal-enter 0.22s ease;
}
@keyframes modal-enter { from { opacity:0; transform:scale(0.95) translateY(12px); } to { opacity:1; transform:none; } }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--glass2);
  border: 1px solid var(--b1);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--t2); cursor: pointer;
}
.modal-close:hover { background: var(--glass3); color: var(--t1); }
.modal-title { font-family: var(--fd); font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 12.5px; color: var(--t2); margin-bottom: 20px; }

/* ── Form fields ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 10.5px; font-weight: 700; color: var(--t2); margin-bottom: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.field-wrap { position: relative; }
.field input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--b2);
  border-radius: var(--r-md);
  padding: 10px 44px 10px 14px;
  font-size: 14px;
  color: var(--t1);
  outline: none;
  font-family: var(--fm);
  transition: border 0.2s, background 0.2s;
}
.field input:focus { border-color: var(--accent); background: var(--bg4); }
.field input[readonly] { background: var(--bg4); color: var(--t2); cursor: not-allowed; }
.field .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--t2); font-family: var(--fm); pointer-events: none; }
.field-info { display: flex; flex-direction: column; gap: 5px; background: var(--bg3); border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 14px; }
.fi-row { display: flex; justify-content: space-between; font-size: 12px; }
.fi-row span:first-child { color: var(--t2); }
.fi-row span:last-child { font-family: var(--fm); }

/* ── Trade modal tabs ── */
.trade-tabs { display: flex; background: var(--bg3); border-radius: var(--r-md); padding: 3px; margin-bottom: 18px; gap: 3px; }
.trade-tab { flex: 1; padding: 8px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; text-align: center; cursor: pointer; transition: all 0.2s; color: var(--t2); }
.trade-tab.buy-active { background: var(--green); color: #fff; }
.trade-tab.sell-active { background: var(--red); color: #fff; }

/* ── Page wrapper ── */
.page { position: relative; z-index: 1; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-search input { width: 160px; }
  .nav-search input:focus { width: 200px; }
}
@media (max-width: 480px) {
  .nav { padding: 0 14px; gap: 8px; }
  .nav-search { display: none; }
}
