/* ============================================================
   MultiTradingFX — Global Stylesheet
   Shared across all pages. Page-specific rules are grouped
   at the bottom under their section headers.
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --brand-400: #48be8a;
  --brand-500: #25a36e;
  --brand-600: #18845a;
  --brand-700: #156a49;

  --dark-900: #060d18;
  --dark-800: #0b1626;
  --dark-700: #101f35;
  --dark-600: #152236;

  --red-400:    #f87171;
  --red-500:    #ef4444;
  --yellow-400: #fbbf24;
  --yellow-500: #f59e0b;
  --purple-400: #c084fc;
  --blue-400:   #60a5fa;
}

/* ── Base ───────────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

*,
*::before,
*::after { box-sizing: border-box; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: var(--dark-900); }
::-webkit-scrollbar-thumb        { background: var(--dark-600); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: #1e3050; }

/* ── Typography ─────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--dark-800);
  border: 1px solid rgba(72, 190, 138, 0.1);
  border-radius: 14px;
}

.card-glow {
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card-glow:hover {
  border-color: rgba(72, 190, 138, 0.28);
  box-shadow: 0 0 22px rgba(37, 163, 110, 0.07);
}

/* ── Sidebar nav items ──────────────────────────────────────── */
.nav-item {
  transition: background 0.15s;
  border-radius: 8px;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.nav-active {
  background: rgba(37, 163, 110, 0.15);
  color: var(--brand-400);
}

/* ── Input field ────────────────────────────────────────────── */
.input-field {
  background: var(--dark-700);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(37, 163, 110, 0.14);
}
.input-field::placeholder { color: #4b5563; }
.input-field.error         { border-color: rgba(239, 68, 68, 0.55); }
.input-field:disabled      { opacity: 0.4; cursor: not-allowed; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tab-active {
  border-bottom: 2px solid var(--brand-500);
  color: #fff;
}
.tab-inactive {
  border-bottom: 2px solid transparent;
  color: #6b7280;
  transition: color 0.15s;
}
.tab-inactive:hover { color: #9ca3af; }

/* ── Badge utilities ────────────────────────────────────────── */
.badge-green  { background: rgba(37,163,110,.12);  color: var(--brand-400);  border: 1px solid rgba(37,163,110,.2); }
.badge-yellow { background: rgba(245,158,11,.12);  color: var(--yellow-400); border: 1px solid rgba(245,158,11,.2); }
.badge-gold   { background: rgba(251,191,36,.12);  color: #fbbf24;           border: 1px solid rgba(251,191,36,.2); }
.badge-red    { background: rgba(239,68,68,.12);   color: var(--red-400);    border: 1px solid rgba(239,68,68,.2); }
.badge-blue   { background: rgba(59,130,246,.12);  color: var(--blue-400);   border: 1px solid rgba(59,130,246,.2); }
.badge-purple { background: rgba(168,85,247,.12);  color: var(--purple-400); border: 1px solid rgba(168,85,247,.2); }
.badge-gray   { background: rgba(255,255,255,.06); color: #9ca3af;           border: 1px solid rgba(255,255,255,.1); }

/* ── Stat colour shortcuts ──────────────────────────────────── */
.stat-up, .up { color: var(--brand-400); }
.stat-down, .down { color: var(--red-400); }

/* ── Progress bar ───────────────────────────────────────────── */
.pbar       { height: 6px; border-radius: 3px; background: var(--dark-600); }
.pbar-fill  { height: 100%; border-radius: 3px; transition: width 0.7s ease; }
.progress-bar  { height: 6px; border-radius: 3px; background: var(--dark-600); }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }

/* ── Toggle switch ──────────────────────────────────────────── */
.toggle-track {
  width: 44px; height: 24px; border-radius: 999px;
  transition: background 0.2s; cursor: pointer;
  display: flex; align-items: center; padding: 2px;
}
.toggle-track.on  { background: var(--brand-500); }
.toggle-track.off { background: var(--dark-600); border: 1px solid rgba(255,255,255,.1); }
.toggle-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.2s; flex-shrink: 0;
}
.toggle-track.on .toggle-thumb { transform: translateX(20px); }

/* ── Amount / selection chips ───────────────────────────────── */
.amount-chip {
  background: var(--dark-700);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  padding: .5rem 1rem; font-size: .875rem; font-weight: 600;
}
.amount-chip:hover  { border-color: rgba(37,163,110,.4); color: var(--brand-400); }
.amount-chip.active { border-color: var(--brand-500); background: #0f2a1e; color: var(--brand-400); }

.chip {
  background: var(--dark-700);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  padding: .3rem .7rem; font-size: .75rem; font-weight: 600;
}
.chip:hover  { border-color: rgba(37,163,110,.4); color: var(--brand-400); }
.chip.active { border-color: var(--brand-500); background: #0f2a1e; color: var(--brand-400); }

/* ── Method / selectable cards ──────────────────────────────── */
.method-card {
  background: var(--dark-700);
  border: 2px solid transparent;
  border-radius: 12px; cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.method-card:hover  { border-color: rgba(37,163,110,.4); }
.method-card.active {
  border-color: var(--brand-500);
  background: #0f2a1e;
  box-shadow: 0 0 0 4px rgba(37,163,110,.08);
}

/* ── Sparkline / candle chart ───────────────────────────────── */
.sparkline    { overflow: visible; }
.candle-green { fill: var(--brand-500); }
.candle-red   { fill: var(--red-500); }
.wick         { stroke-width: 1.5; }
.wick-green   { stroke: var(--brand-500); }
.wick-red     { stroke: var(--red-500); }
.candle-up    { fill: var(--brand-500); }
.candle-down  { fill: var(--red-500); }
.wick-up      { stroke: var(--brand-500); stroke-width: 1.5; }
.wick-down    { stroke: var(--red-500);   stroke-width: 1.5; }

/* ── SVG rings (countdown, tier, arc) ──────────────────────── */
.ring-track  { stroke: var(--dark-600); stroke-width: 4; fill: none; }
.ring-fill   { stroke-width: 4; fill: none; stroke-linecap: round; transition: stroke-dashoffset .05s linear; }
.arc-track   { stroke: var(--dark-600); stroke-width: 10; fill: none; }
.arc-fill    { stroke-width: 10; fill: none; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.tier-ring   { stroke-width: 8; fill: none; stroke-linecap: round; }
.tier-track  { stroke: var(--dark-600); }

/* ── Strength bar (password) ────────────────────────────────── */
.str-seg { height: 4px; border-radius: 2px; flex: 1; transition: background .3s; }

/* ── Success / draw animations ──────────────────────────────── */
@keyframes checkDraw  { from { stroke-dashoffset: 60;  } to { stroke-dashoffset: 0; } }
@keyframes circleDraw { from { stroke-dashoffset: 220; } to { stroke-dashoffset: 0; } }

.check-path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: checkDraw .5s .2s ease forwards;
}
.circle-path {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: circleDraw .5s ease forwards;
}

/* ── Pop-in (result overlay, badge unlock) ──────────────────── */
@keyframes popIn {
  0%   { transform: scale(.5); opacity: 0; }
  70%  { transform: scale(1.08); }
  100% { transform: scale(1);   opacity: 1; }
}
.pop-in { animation: popIn .4s cubic-bezier(.34,1.56,.64,1) forwards; }

/* ── Toast notifications ────────────────────────────────────── */
@keyframes slideIn  { from { transform: translateX(110%); } to { transform: translateX(0); } }
@keyframes slideOut { from { transform: translateX(0); }   to { transform: translateX(110%); } }
.toast-in  { animation: slideIn  .3s ease forwards; }
.toast-out { animation: slideOut .3s ease forwards; }

/* ── Shimmer effect ─────────────────────────────────────────── */
@keyframes shimmer { 0% { left: -100%; } 100% { left: 200%; } }

.shimmer,
.shimmer-effect { position: relative; overflow: hidden; }

.shimmer::after,
.shimmer-effect::after {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
  animation: shimmer 2.5s infinite;
}

/* ── Ping / pulse live dot ──────────────────────────────────── */
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
.ping { animation: ping 1.3s cubic-bezier(0,0,.2,1) infinite; }

/* ── Price flash animations (trade page) ────────────────────── */
@keyframes flashUp   { 0%,100% { color: var(--brand-400); } 50% { color: #fff; } }
@keyframes flashDown { 0%,100% { color: var(--red-400);   } 50% { color: #fff; } }
.flash-up   { animation: flashUp   .35s ease; }
.flash-down { animation: flashDown .35s ease; }

/* ── Order book row flash ───────────────────────────────────── */
@keyframes rowFlash { 0% { background: rgba(37,163,110,.25); } 100% { background: transparent; } }
.row-flash { animation: rowFlash .6s ease; }

/* ── Count-up animation ─────────────────────────────────────── */
@keyframes countUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.count-up { animation: countUp .5s ease forwards; }

/* ── Bounce (typing indicator dots) ────────────────────────── */
@keyframes bounce { 0%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }
.dot { width:6px; height:6px; border-radius:50%; background: var(--brand-400); animation: bounce 1.2s infinite; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }

/* ── Trade buttons ──────────────────────────────────────────── */
.btn-up          { background: linear-gradient(135deg, var(--brand-500), var(--brand-600)); }
.btn-up:hover    { background: linear-gradient(135deg, var(--brand-400), var(--brand-500)); }
.btn-down        { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.btn-down:hover  { background: linear-gradient(135deg, var(--red-500), #dc2626); }

/* ── Amount stepper (trade panel) ──────────────────────────── */
.stepper-btn {
  background: var(--dark-600); border: none; color: #9ca3af;
  cursor: pointer; font-size: 1.1rem; padding: 0 .75rem; transition: color .15s;
}
.stepper-btn:hover { color: #fff; }

/* ── Digit block (countdown timer) ─────────────────────────── */
.digit-block {
  background: var(--dark-700);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; min-width: 40px;
  padding: .3rem .5rem; text-align: center;
  font-family: monospace; font-size: 1.25rem; font-weight: 700;
}

/* ── Chat bubbles ───────────────────────────────────────────── */
.bubble-user  { background: var(--brand-500); border-radius: 18px 18px 4px 18px; }
.bubble-agent { background: var(--dark-700); border: 1px solid rgba(255,255,255,.06); border-radius: 18px 18px 18px 4px; }

/* ── FAQ search highlight ───────────────────────────────────── */
mark { background: rgba(37,163,110,.3); color: var(--brand-400); border-radius: 2px; padding: 0 2px; }

/* ── Modal backdrop ─────────────────────────────────────────── */
.modal-backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }

/* ── Tutorial cards ─────────────────────────────────────────── */
.tutorial-card {
  border-radius: 14px; background: var(--dark-800);
  border: 1px solid rgba(255,255,255,.06);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.tutorial-card:hover {
  transform: translateY(-3px);
  border-color: rgba(72,190,138,.22);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

/* ── Achievement / unlock cards ─────────────────────────────── */
.ach-card        { border-radius: 14px; transition: transform .2s, box-shadow .2s; }
.ach-card:hover  { transform: translateY(-2px); }
.ach-locked      { filter: grayscale(1); opacity: .35; }

/* ── Leaderboard "you" row ──────────────────────────────────── */
.lb-me { background: rgba(37,163,110,.06); }

/* ── Rank system (CSS variables) ────────────────────────────── */
.rank-bronze   { --rc: #cd7f32; --rcl: rgba(205,127,50,.12); --rcb: rgba(205,127,50,.25); }
.rank-silver   { --rc: #c0c0c0; --rcl: rgba(192,192,192,.12); --rcb: rgba(192,192,192,.25); }
.rank-gold     { --rc: #fbbf24; --rcl: rgba(251,191,36,.12);  --rcb: rgba(251,191,36,.25); }
.rank-platinum { --rc: #e5e7eb; --rcl: rgba(229,231,235,.12); --rcb: rgba(229,231,235,.3); }
.rank-diamond  { --rc: #67e8f9; --rcl: rgba(103,232,249,.1);  --rcb: rgba(103,232,249,.25); }
.rank-elite    { --rc: #c084fc; --rcl: rgba(192,132,252,.1);  --rcb: rgba(192,132,252,.25); }
.rank-legend   { --rc: #f97316; --rcl: rgba(249,115,22,.1);   --rcb: rgba(249,115,22,.3); }

.rank-card {
  border: 1px solid var(--rcb);
  background: linear-gradient(135deg, var(--rcl), #0b1626 70%);
  border-radius: 16px; transition: transform .2s, box-shadow .2s; cursor: pointer;
}
.rank-card:hover         { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.rank-card.current       { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--rc), 0 12px 32px rgba(0,0,0,.4); }
.rank-badge              { color: var(--rc); }
.rank-bar-fill           { background: var(--rc); }

/* ── Promo card backgrounds ─────────────────────────────────── */
.promo-gold   { background: linear-gradient(135deg,#1a1400,#2a1f00); border-color: rgba(251,191,36,.2); }
.promo-blue   { background: linear-gradient(135deg,#00101f,#001a33); border-color: rgba(59,130,246,.2); }
.promo-purple { background: linear-gradient(135deg,#12001f,#1e0030); border-color: rgba(168,85,247,.2); }
.promo-green  { background: linear-gradient(135deg,#001a0d,#002b15); border-color: rgba(37,163,110,.25); }
.promo-red    { background: linear-gradient(135deg,#1f0000,#2f0808); border-color: rgba(239,68,68,.2); }

/* ── Support ticket status / priority ──────────────────────── */
.status-open      { background: rgba(37,163,110,.12);  color: var(--brand-400);  border: 1px solid rgba(37,163,110,.2); }
.status-pending   { background: rgba(245,158,11,.12);  color: var(--yellow-400); border: 1px solid rgba(245,158,11,.2); }
.status-resolved  { background: rgba(107,114,128,.12); color: #9ca3af;            border: 1px solid rgba(107,114,128,.2); }
.status-closed    { background: rgba(107,114,128,.08); color: #6b7280;            border: 1px solid rgba(107,114,128,.15); }

.priority-low    { color: var(--brand-400); }
.priority-medium { color: var(--yellow-400); }
.priority-high   { color: var(--red-400); }
.priority-urgent { color: #e879f9; }

/* ── Admin panel ─────────────────────────────────────────────── */
.snav        { transition: background .15s; border-radius: 8px; }
.snav:hover  { background: rgba(255,255,255,.04); }
.snav-active { background: rgba(99,102,241,.15); color: #818cf8; }

/* Admin status badges */
.s-active    { background: rgba(37,163,110,.12);  color: var(--brand-400);  border: 1px solid rgba(37,163,110,.2); }
.s-pending   { background: rgba(245,158,11,.12);  color: var(--yellow-400); border: 1px solid rgba(245,158,11,.2); }
.s-suspended { background: rgba(239,68,68,.12);   color: var(--red-400);    border: 1px solid rgba(239,68,68,.2); }
.s-banned    { background: rgba(107,114,128,.12); color: #6b7280;            border: 1px solid rgba(107,114,128,.2); }
.s-open      { background: rgba(59,130,246,.12);  color: var(--blue-400);   border: 1px solid rgba(59,130,246,.2); }
.s-resolved  { background: rgba(107,114,128,.12); color: #9ca3af;            border: 1px solid rgba(107,114,128,.2); }
.s-processing{ background: rgba(168,85,247,.12);  color: var(--purple-400); border: 1px solid rgba(168,85,247,.2); }

/* Admin table hover */
.trow:hover { background: rgba(255,255,255,.025); }

/* Admin mini chart bars */
.mbar { border-radius: 3px 3px 0 0; transition: height .3s ease; }

/* Admin input */
.inp { background: #121424; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; color: #fff; padding: .55rem .9rem; font-size: .8rem; outline: none; transition: border-color .2s; }
.inp:focus { border-color: #818cf8; }
.inp::placeholder { color: #4b5563; }

/* Admin tab override */
.admin-tab-active   { border-bottom: 2px solid #818cf8; color: #fff; }
.admin-tab-inactive { border-bottom: 2px solid transparent; color: #6b7280; }
.admin-tab-inactive:hover { color: #9ca3af; }

/* ── Index / landing page ────────────────────────────────────── */
.hero-glow {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37,163,110,.25) 0%, transparent 70%);
}
.card-hover {
  transition: transform .25s ease, box-shadow .25s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
}
.chart-bar {
  animation: growUp 1.4s cubic-bezier(.4,0,.2,1) forwards;
  transform-origin: bottom;
  transform: scaleY(0);
}
@keyframes growUp { to { transform: scaleY(1); } }

.pulse-dot::before {
  content: '';
  position: absolute; inset: -4px; border-radius: 50%;
  background: rgba(37,163,110,.4);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: .6; }
  50%      { transform: scale(1.5); opacity: 0; }
}

/* ── Settings page tab nav ───────────────────────────────────── */
.stab { border-left: 2px solid transparent; transition: all .15s; }
.stab:hover { background: rgba(255,255,255,.03); }
.stab.active { border-left-color: var(--brand-500); background: rgba(37,163,110,.08); color: var(--brand-400); }
