/* ============================================================
   UniTradeX — "Modern Fintech Dark" skin
   Loaded LAST on every page so it refines the look without
   touching layout. Visual surfaces only (color, border, shadow,
   radius, gradients, spacing) — no display/position/grid changes
   that could break existing layouts. Token-driven so light mode
   still works.
   ============================================================ */

:root {
  --tx-accent: #38bdf8;
  --tx-accent-2: #22c55e;
  --tx-gradient: linear-gradient(135deg, #38bdf8 0%, #22c55e 100%);
  --tx-ring: 0 0 0 3px rgba(56, 189, 248, 0.18);
  --tx-radius: 16px;
  --tx-radius-sm: 10px;
  --tx-shadow: 0 10px 30px rgba(2, 6, 23, 0.45), 0 2px 6px rgba(2, 6, 23, 0.3);
  --tx-shadow-soft: 0 6px 18px rgba(2, 6, 23, 0.25);
  --tx-card-border: 1px solid rgba(148, 163, 184, 0.14);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Ambient depth behind everything (fixed, doesn't affect flow) */
body.dark-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(34, 197, 94, 0.08), transparent 55%);
}

/* ---------- CARDS / PANELS → glassy ---------- */
section,
.trade-form,
.charts,
.bot-card,
.signal-card,
.auth-card,
.account-stats > div,
.trades-table,
.p2p-card,
.offer-card,
.wallet-box {
  border-radius: var(--tx-radius);
  border: var(--tx-card-border);
  box-shadow: var(--tx-shadow);
}

body.dark-mode section,
body.dark-mode .trade-form,
body.dark-mode .charts,
body.dark-mode .auth-card {
  background: rgba(23, 34, 56, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.light-mode section,
body.light-mode .trade-form,
body.light-mode .charts,
body.light-mode .auth-card {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Card hover lift for clickable cards */
.bot-card,
.signal-card,
.offer-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.bot-card:hover,
.signal-card:hover,
.offer-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
}

/* ---------- HEADER → sticky glass bar ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.dark-mode header { background: rgba(15, 23, 42, 0.78); }
body.light-mode header { background: rgba(255, 255, 255, 0.85); }

/* ---------- POSITIVE-ACTION BUTTONS → gradient ---------- */
.submit-btn,
.btn-primary,
.btn-subscribe,
.btn-subscribe:not(:disabled),
.login-to-trade-btn,
.auth-card button[type="submit"],
.cta-btn,
.deposit-btn {
  background: var(--tx-gradient) !important;
  color: #03121b !important;
  border: none !important;
  border-radius: var(--tx-radius-sm) !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 22px rgba(34, 197, 94, 0.28);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.submit-btn:hover,
.btn-primary:hover,
.btn-subscribe:hover,
.login-to-trade-btn:hover,
.cta-btn:hover,
.deposit-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.35);
}
.submit-btn:active,
.btn-primary:active { transform: translateY(0); filter: brightness(.96); }

/* Keep semantic buy/sell/cancel colours — do NOT gradient them,
   just round + smooth */
.btn-buy, .btn-sell, .btn-cancel, .btn-cancel-sub, .btn-pause, .btn-resume {
  border-radius: var(--tx-radius-sm) !important;
  transition: transform .15s ease, box-shadow .2s ease;
}

/* ---------- INPUTS / SELECTS → refined ---------- */
input, select, textarea {
  border-radius: var(--tx-radius-sm) !important;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--tx-accent) !important;
  box-shadow: var(--tx-ring) !important;
}

/* ---------- ASSET TABS / PILLS ---------- */
.asset-tabs button.active {
  background: var(--tx-gradient) !important;
  border-color: transparent !important;
  color: #03121b !important;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.35);
}

/* ---------- WALLET BADGE ---------- */
.wallet-btn {
  border-radius: 999px !important;
  box-shadow: var(--tx-shadow-soft);
  font-weight: 700;
}

/* ---------- HEADINGS ---------- */
h1, h2 { letter-spacing: -0.02em; }
section > h2,
.trade-form h2,
.charts h2 {
  position: relative;
}

/* ---------- SCROLLBARS ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.55); background-clip: padding-box; }

/* ---------- TEXT SELECTION ---------- */
::selection { background: rgba(56, 189, 248, 0.3); color: inherit; }

/* ---------- LINKS ---------- */
a { transition: color .15s ease; }

/* ---------- MOBILE TIGHTENING ---------- */
@media (max-width: 640px) {
  section, .trade-form, .charts, .bot-card, .signal-card, .auth-card {
    border-radius: 14px;
  }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.1rem; }
  .submit-btn, .btn-primary, .btn-subscribe { padding: 14px !important; }
  /* never let a card force horizontal scroll on phones */
  section { margin-left: .5rem; margin-right: .5rem; }
}
