/* ============================================================
   Zelentio — Main Design System CSS
   Professional crypto exchange aesthetic
   ============================================================ */

/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── CSS Variables (Dark Theme default) ────────────────────── */
:root {
  --bg:       #060b14;
  --surface:  #0d1624;
  --card:     #111e2e;
  --border:   #1a2d44;
  --text:     #e8f4fd;
  --muted:    #6b8aad;
  --primary:  #00d4ff;
  --primary2: #0099cc;
  --green:    #00e896;
  --red:      #ff4b6e;
  --warn:     #ffb547;
  --purple:   #7c3aed;

  --font-head: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(0,212,255,0.15);

  --nav-h: 68px;
  --ticker-h: 40px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dim"] {
  --bg:      #0e1621;
  --surface: #16202e;
  --card:    #1c2b3a;
  --border:  #243447;
  --text:    #d4e8f8;
  --muted:   #7a9ab8;
  --primary: #00d4ff;
}

[data-theme="light"] {
  --bg:      #f0f4f8;
  --surface: #ffffff;
  --card:    #ffffff;
  --border:  #dce6f0;
  --text:    #0d1624;
  --muted:   #5a7a99;
  --primary: #0099cc;
  --primary2: #007aab;
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 40px rgba(0,153,204,0.1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
ul, ol { list-style: none; }
input, textarea, select { font-family: var(--font-body); }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }

.text-primary  { color: var(--primary); }
.text-green    { color: var(--green); }
.text-red      { color: var(--red); }
.text-muted    { color: var(--muted); }
.text-warn     { color: var(--warn); }

/* ── Layout ─────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 900px; }
.container-xs { max-width: 600px; }

.page-wrap { min-height: 100vh; padding-top: calc(var(--nav-h) + var(--ticker-h)); }
.page-wrap-no-ticker { padding-top: var(--nav-h); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}
.btn:hover::after { background: rgba(255,255,255,0.06); }

.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 4px 20px rgba(0,212,255,0.3);
}
.btn-primary:hover {
  background: #00eaff;
  box-shadow: 0 6px 28px rgba(0,212,255,0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: rgba(0,212,255,0.08);
  color: var(--primary);
  border: 1px solid rgba(0,212,255,0.2);
}
.btn-ghost:hover {
  background: rgba(0,212,255,0.15);
  border-color: var(--primary);
}

.btn-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-surface:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }

/* ── Form Elements ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.12);
}
.form-input::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%236b8aad'%3E%3Cpath d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-body { padding: 24px; }
.card-hover {
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(0,212,255,0.3);
  box-shadow: var(--shadow-glow);
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-green  { background: rgba(0,232,150,0.12); color: var(--green); }
.badge-red    { background: rgba(255,75,110,0.12); color: var(--red); }
.badge-blue   { background: rgba(0,212,255,0.12); color: var(--primary); }
.badge-warn   { background: rgba(255,181,71,0.12); color: var(--warn); }
.badge-new    { background: linear-gradient(135deg, #00d4ff, #00e896); color: #000; }
.badge-hot    { background: linear-gradient(135deg, #ff4b6e, #ffb547); color: #fff; }

/* ── Section Headers ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.5px;
}
.section-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); width: 100%; }

/* ── Loading Spinner ─────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast Notifications ─────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  pointer-events: all;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.hide { animation: toastOut 0.3s 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(--primary); }
.toast.warn    { border-left: 3px solid var(--warn); }
@keyframes toastIn  { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to   { transform: translateX(120%); opacity: 0; } }

/* ── Price change colors ─────────────────────────────────────── */
.price-up   { color: var(--green); }
.price-down { color: var(--red); }
.price-neu  { color: var(--muted); }

.pnl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  min-width: 68px;
}
.pnl-badge.up   { background: rgba(0,232,150,0.15); color: var(--green); }
.pnl-badge.down { background: rgba(255,75,110,0.15); color: var(--red); }

/* ── Scrollbar styling ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Utility ─────────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }

/* ── Page transition ─────────────────────────────────────────── */
.page-enter {
  animation: pageFadeIn 0.4s ease;
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
