/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, sans-serif;
  background: #0f172a; /* dark navy */
  color: #f1f5f9; /* light text */
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: #1e293b;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f1f5f9;
}

header h1 {
  font-size: 1.5rem;
}

header a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: bold;
}

/* Sections */
section {
  padding: 2rem;
  margin: 1rem auto;
  max-width: 1200px;
  background: #1e293b;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

body.light-mode section {
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15,23,42,0.12);
}

/* Wallet badge */
.wallet-point {
  position: fixed;     /* 👈 key change */
  top: 1rem;           /* distance from top */
  right: 15%;         /* distance from right */
  z-index: 10000;      /* stays above everything */
}


.wallet-btn {
  background: #22c55e;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.wallet-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: #1e293b;
  border-radius: 6px;
  display: none;
  flex-direction: column;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 9999;
}

.wallet-menu a {
  display: flex;          /* make each link block-like */
  flex-direction: column; /* stack contents inside link */
  padding: 0.75rem;
  text-decoration: none;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(255,255,255,0.1); /* optional separator */
}

.wallet-menu a:last-child {
  border-bottom: none;
}

.wallet-menu a small {
  font-size: 0.85rem;
  color: #cbd5e1; /* lighter text for balance */
  margin-top: 0.2rem;
}


.wallet-btn.live { background:#16a34a; }
.wallet-btn.demo { background:#0ea5e9; }

/* Light mode adjustments */
body.light-mode .wallet-btn {
  background: #16a34a;
}
body.light-mode .wallet-menu {
  background: #e2e8f0;
}
body.light-mode .wallet-menu a {
  color: #0f172a;
}

/* Balance pulse animation */
@keyframes balancePulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 rgba(34,197,94,0); }
  50%  { transform: scale(1.05); box-shadow: 0 0 15px rgba(34,197,94,0.8); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(34,197,94,0); }
}

.wallet-btn.pulse {
  animation: balancePulse 0.6s ease;
}

/* Losing pulse (red) */
.wallet-btn.loss {
  animation: balancePulse 0.6s ease;
  box-shadow: 0 0 15px rgba(239,68,68,0.8) !important;
}

.wallet-menu {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.wallet-menu.show {
  visibility: visible;
  opacity: 1;
  display: flex;
}


/* ===============================
   ACCOUNT STATS (THEME AWARE)
================================ */

.account-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

/* Card */
.account-stats > div {
  padding: 14px 10px;
  border-radius: 14px;
  text-align: center;
  transition: background 0.2s ease, border 0.2s ease;
}

/* Label */
.account-stats span {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 6px;
  opacity: 0.75;
}

/* Value */
.account-stats strong {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ===============================
   DARK MODE
================================ */

body.dark-mode .account-stats > div {
  background: #020617;
  border: 1px solid #1e293b;
}

body.dark-mode .account-stats span {
  color: #94a3b8;
}

body.dark-mode .account-stats strong {
  color: #e5e7eb;
}

/* ===============================
   LIGHT MODE
================================ */

body.light-mode .account-stats > div {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

body.light-mode .account-stats span {
  color: #64748b;
}

body.light-mode .account-stats strong {
  color: #0f172a;
}

/* ===============================
   PROFIT / LOSS
================================ */

.profit {
  color: #16a34a;
}

.loss {
  color: #dc2626;
}

/* ===============================
   RESPONSIVE
================================ */

/* Tablets */
@media (max-width: 1024px) {
  .account-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile */
@media (max-width: 480px) {
  .account-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .account-stats strong {
    font-size: 1rem;
  }
}


/* Referral */
.referral code {
  display: block;
  background: #0f172a;
  padding: 0.75rem;
  border-radius: 6px;
  font-family: monospace;
  color: #22c55e;
  margin-top: 0.5rem;
  word-break: break-all;
}

/* Charts */
.charts select {
  padding: 0.5rem;
  border-radius: 6px;
  border: none;
  margin-bottom: 1rem;
  background: #334155;
  color: #f1f5f9;
}

/* --- CONTAINER --- */
.trade-form {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  margin-top: 2rem;
}

.trade-form h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--primary);
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}

/* --- GRID LAYOUT --- */
.trade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #94a3b8;
}

/* --- INPUTS & SELECTS --- */
input, select {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #020617;
  color: #fff;
  font-weight: 600;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* --- TRADE TYPE TOGGLE --- */
.trade-type {
  display: flex;
  gap: 8px;
}

.trade-type input { display: none; }

.trade-type label {
  flex: 1;
  padding: 14px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: 0.3s;
  border: 2px solid transparent;
}

.btn-buy { background: rgba(34, 197, 94, 0.1); color: #22c55e; border-color: rgba(34, 197, 94, 0.2) !important; }
.btn-sell { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-color: rgba(239, 68, 68, 0.2) !important; }

#buy:checked + .btn-buy { background: #22c55e; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3); }
#sell:checked + .btn-sell { background: #ef4444; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }

/* --- LOT CONTROL --- */
.lot-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: #020617;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
}

.lot-control button {
  padding: 12px 18px;
  background: #1e293b;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.2s;
}

.lot-control button:hover { background: #334155; }
.lot-control input { border: none; text-align: center; border-radius: 0; }

.lot-presets {
  display: flex;
  gap: 6px;
}

.lot-presets button {
  flex: 1;
  padding: 6px;
  font-size: 0.7rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
}

/* ===============================
   EXECUTION BUTTON & ZONE
================================ */

.execution-zone {
  margin-top: auto; 
  padding-top: 1rem;
  width: 100%;
}

.submit-btn {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* Dark Mode Appearance */
body.dark-mode .submit-btn {
  background: #22c55e; /* Vibrant Green */
  color: #052e16;       /* Deep Forest Green text */
}

body.dark-mode .submit-btn:hover {
  background: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
}

/* Light Mode Appearance */
body.light-mode .submit-btn {
  background: #10b981; /* Emerald */
  color: #ffffff;
}

body.light-mode .submit-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

/* Active State (Click) */
.submit-btn:active {
  transform: translateY(0);
  filter: brightness(0.9);
}

/* ===============================
   LOGIN BUTTON (LOGGED OUT STATE)
================================ */

.login-to-trade-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 2px dashed;
}

body.dark-mode .login-to-trade-btn {
  background: rgba(56, 189, 248, 0.05);
  border-color: #38bdf8;
  color: #38bdf8;
}

body.light-mode .login-to-trade-btn {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0284c7;
}

/* ===============================
   RESPONSIVE FIXES
================================ */

@media (max-width: 768px) {
  .execution-zone {
    padding-top: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
  }
  
  .submit-btn {
    padding: 14px;
    font-size: 0.95rem;
  }
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .trade-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .right-col {
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
  }
}

/* ===============================
   LOGIN TO TRADE (LOGGED OUT)
================================ */

.login-to-trade-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  padding: 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

body.dark-mode .login-to-trade-btn {
  background: #020617;
  border: 1px dashed #38bdf8;
  color: #38bdf8;
}

body.dark-mode .login-to-trade-btn:hover {
  background: rgba(56,189,248,0.1);
}

body.light-mode .login-to-trade-btn {
  background: #ffffff;
  border: 1px dashed #0284c7;
  color: #0284c7;
}

body.light-mode .login-to-trade-btn:hover {
  background: rgba(2,132,199,0.08);
}

/* ===============================
   MOBILE
================================ */

@media (max-width: 768px) {
  .trade-form form {
    max-width: 100%;
  }

  .lot-control input {
    width: 70px;
  }
}



/* ===============================
   TRADES SECTION
================================ */

.trades {
  margin-top: 28px;
}

.trades h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

/* Wrapper */
.trades-table {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
}

/* Table */
.trades table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

/* Cells */
.trades th,
.trades td {
  padding: 12px 10px;
  text-align: center;
  white-space: nowrap;
}

/* ===============================
   DARK MODE
================================ */

body.dark-mode .trades-table {
  border: 1px solid #1e293b;
}

body.dark-mode .trades table {
  background: #020617;
}

body.dark-mode .trades th {
  background: #020617;
  color: #38bdf8;
  border-bottom: 1px solid #1e293b;
}

body.dark-mode .trades td {
  border-bottom: 1px solid #1e293b;
  color: #e5e7eb;
}

/* Row hover */
body.dark-mode .trades tbody tr:hover {
  background: rgba(56,189,248,0.06);
}

/* ===============================
   LIGHT MODE
================================ */

body.light-mode .trades-table {
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

body.light-mode .trades table {
  background: #ffffff;
}

body.light-mode .trades th {
  background: #f8fafc;
  color: #0284c7;
  border-bottom: 1px solid #e2e8f0;
}

body.light-mode .trades td {
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

body.light-mode .trades tbody tr:hover {
  background: rgba(2,132,199,0.06);
}

/* ===============================
   STATUS / PROFIT COLORS
================================ */

.trades .profit {
  color: #16a34a;
  font-weight: 600;
}

.trades .loss {
  color: #dc2626;
  font-weight: 600;
}

/* ===============================
   ACTION BUTTON
================================ */

.trades td button {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.dark-mode .trades td button {
  background: #22c55e;
  color: #052e16;
}

body.dark-mode .trades td button:hover {
  background: #16a34a;
}

body.light-mode .trades td button {
  background: #16a34a;
  color: #ffffff;
}

body.light-mode .trades td button:hover {
  background: #15803d;
}

/* ===============================
   MOBILE IMPROVEMENTS
================================ */

@media (max-width: 600px) {
  .trades h2 {
    font-size: 1rem;
  }

  .trades-table {
    border-radius: 10px;
  }
}


/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
  }

  section {
    padding: 1rem;
  }

  .trade-form form {
    max-width: 100%;
  }
}


/* Sidebar base */
.sidebar {
  width: 220px;
  background: #0f172a; /* dark mode base */
  color: #f1f5f9;
  min-height: 100vh;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  left: 0;
}

.sidebar h2 {
  margin-bottom: 2rem;
  color: #38bdf8;
  font-size: 1.25rem;
  text-align: center;
}

.sidebar nav a {
  display: block;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: #f1f5f9;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Hover effect */
.sidebar nav a:hover {
  background: #1e293b;
  color: #38bdf8;
}

/* Active link */
.sidebar nav a.active {
  background: #38bdf8;
  color: #0f172a;
  font-weight: bold;
}

/* Light mode overrides */
body.light-mode .sidebar {
  background: #f8fafc;
  color: #0f172a;
}

body.light-mode .sidebar h2 {
  color: #0ea5e9;
}

body.light-mode .sidebar nav a {
  color: #0f172a;
}

body.light-mode .sidebar nav a:hover {
  background: #e2e8f0;
  color: #0ea5e9;
}

body.light-mode .sidebar nav a.active {
  background: #0ea5e9;
  color: #fff;
  font-weight: bold;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 220px;
  height: 100%;
  background: #1e293b;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.sidebar h2 {
  color: #38bdf8;
  margin-bottom: 1rem;
}

.sidebar nav a {
  display: block;
  padding: 0.75rem;
  color: #f1f5f9;
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.sidebar nav a:hover {
  background: #334155;
}

.wallet-health.healthy { color:#22c55e; }
.wallet-health.danger { color:#ef4444; }

/* Main content shifts right */
.main-content {
  margin-left: 240px;
  padding: 1rem;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Profile dropdown */
.profile-dropdown {
  position: relative;
}

.profile-btn {
  background: #334155;
  border: none;
  border-radius: 50%;
  padding: 0.5rem;
  cursor: pointer;
  color: #f1f5f9;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 120%;
  background: #092552;
  border-radius: 6px;
  display: none;
  flex-direction: column;
  z-index: 999;
}

.dropdown-menu a {
  padding: 0.75rem;
  color: #f1f5f9;
  text-decoration: none;
}

.dropdown-menu a:hover {
  background: #334155;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 18px;
  border-radius: 6px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 999999;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.notification.success { background: #16a34a; color: #fff; }
.notification.error   { background: #dc2626; color: #fff; }
.notification.info    { background: #2563eb; color: #fff; }


.lot-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lot-control button {
  width: 36px;
  height: 36px;
  background: #334155;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
}

.lot-control input {
  width: 80px;
  text-align: center;
  font-weight: bold;
  background: #0f172a;
  color: #fff;
  border: 1px solid #334155;
  border-radius: 4px;
}

.lot-presets {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

.lot-presets button {
  background: #1e293b;
  color: #e5e7eb;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}


/* Dark/Light mode */
body.dark-mode {
  background: #0f172a;
  color: #f1f5f9;
}

body.light-mode {
  background: #f1f5f9;
  color: #0f172a;
}

body.light-mode .sidebar {
  background: #e2e8f0;
}

body.light-mode .sidebar nav a {
  color: #0f172a;
}



.chart-wrapper {
  position: relative;
  height: 500px;
}

.chart-wrapper::after {
  content: "UniTradeX";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 900;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.045);
  pointer-events: none;
  z-index: 10;
}



.chart-wrapper {
  position: relative;
  height: 500px;
  overflow: hidden;
}

.chart-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  opacity: 0.05;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}


#active_chart iframe {
  position: relative;
  z-index: 1;
}

#active_chart,
#active_chart iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 100%;
}



.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.chart-grid > div {
  height: 300px;
}




.coin-card img {
  width: 36px;
  height: 36px;
  margin-bottom: 6px;
}

.badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 6px;
  background: #333;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  margin-bottom: 24px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.9),
    rgba(2, 6, 23, 0.95)
  );
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* BACK BUTTON */
.back-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all .25s ease;
}

.back-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateX(-2px);
}

/* TITLE */
.page-title h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .3px;
  color: #e5e7eb;
}

.page-title span {
  display: block;
  font-size: .75rem;
  color: #94a3b8;
  margin-top: 2px;
}


/* ===============================
   RESPONSIVE LAYOUT ENHANCEMENTS
================================ */

/* Large screens */
@media (min-width: 1440px) {
  .main-content {
    max-width: 1400px;
    margin-left: 260px;
    margin-right: auto;
  }

  section {
    padding: 2.5rem;
  }

  .account-stats {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .account-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .chart-wrapper {
    height: 420px;
  }
}

/* Mobile sidebar behavior */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    width: 200px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 99999;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
}

/* Mobile header */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  header h1 {
    font-size: 1.1rem;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .wallet-point {
    position: static;
  }

  .wallet-btn {
    width: 100%;
    text-align: center;
  }
}

/* Account stats */
@media (max-width: 768px) {
  .account-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .account-stats strong {
    font-size: 1rem;
  }
}

/* Charts */
@media (max-width: 768px) {
  .chart-wrapper {
    height: 65vh;   
    min-height: 380px;
  }

  .chart-wrapper::after {
    font-size: 2.8rem;
  }
}

/* Trade form */
@media (max-width: 768px) {
  .trade-form form {
    max-width: 100%;
  }

  .lot-control {
    justify-content: space-between;
  }

  .lot-control input {
    width: 70px;
  }
}

/* Tables */
@media (max-width: 900px) {
  .trades {
    overflow-x: auto;
  }

  .trades table {
    min-width: 900px;
  }
}

/* Wallet menu */
@media (max-width: 768px) {
  .wallet-menu {
    width: 100%;
    right: auto;
    left: 0;
  }
}

/* Buttons */
@media (max-width: 600px) {
  button {
    font-size: 0.95rem;
  }
}

/* Ultra small screens */
@media (max-width: 420px) {
  .account-stats {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 1rem;
  }

    .chart-wrapper {
    height: 75vh;
    min-height: 420px;
  }
}


@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100%;
    width: 260px;
    transition: left 0.3s ease;
    z-index: 1000;
  }

  .sidebar.open {
    left: 0;
  }

  .main-content {
    margin-left: 0;
  }
}


/* ===========================
   Login to Trade CTA (Guest)
=========================== */

.login-to-trade-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  width: 100%;
  max-width: 320px;

  padding: 14px 18px;
  margin-top: 12px;

  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;

  color: #fff;
  text-decoration: none;

  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 12px;

  box-shadow:
    0 10px 30px rgba(59,130,246,0.35),
    inset 0 1px 0 rgba(255,255,255,0.15);

  transition: all 0.25s ease;
}

/* Hover */
.login-to-trade-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 40px rgba(59,130,246,0.45),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Active (click) */
.login-to-trade-btn:active {
  transform: translateY(0);
  box-shadow:
    0 8px 18px rgba(59,130,246,0.35),
    inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Optional: focus accessibility */
.login-to-trade-btn:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}



/* ===============================
   BACK LINK
================================ */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: .7;
  margin-bottom: 1rem;
  padding: 8px 14px;

  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;

  color: #94a3b8;
  background: rgba(26, 56, 127, 0.6);

  border: 1px solid #1e293b;
  border-radius: 10px;

  transition: all 0.2s ease;
}

.back-link:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
  transform: translateX(-2px);
  opacity: 1;
}

/* ===============================
   LIGHT MODE
================================ */

body.light-mode .back-link {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}

body.light-mode .back-link:hover {
  color: #0284c7;
  background: #e0f2fe;
  border-color: #0284c7;
}

/* ===============================
   MOBILE
================================ */

@media (max-width: 480px) {
  .back-link {
    width: 100%;
    justify-content: center;
    font-size: 14px;
  }
}

:root {
  --sidebar-text: #f7f8f8;
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-border: rgba(255,255,255,.08);
  --sidebar-sub-hover: rgba(59,130,246,.15);
}

body.light-mode {
  --sidebar-text: #111827;
  --sidebar-hover: rgba(0,0,0,.06);
  --sidebar-border: rgba(0,0,0,.1);
  --sidebar-sub-hover: rgba(59,130,246,.12);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* MAIN LINKS + DROPDOWN TOGGLE */
.sidebar-nav a,
.nav-dropdown-toggle {
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  background: transparent;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
  border: none;
  text-align: left;
}

/* HOVER */
.sidebar-nav a:hover,
.nav-dropdown-toggle:hover {
  background: var(--sidebar-hover);
}

/* DROPDOWN WRAPPER */
.nav-dropdown {
  display: flex;
  flex-direction: column;
}

/* DROPDOWN TOGGLE */
.nav-dropdown-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* CARET */
.caret {
  font-size: 12px;
  opacity: .6;
  color: var(--sidebar-text);
}

/* DROPDOWN MENU */
.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  margin-left: 12px;
  padding-left: 8px;
  border-left: 1px solid var(--sidebar-border);
}

/* DROPDOWN LINKS */
.nav-dropdown-menu a {
  font-size: 14px;
  padding: 8px 12px;
  opacity: .85;
  color: var(--sidebar-text);
}

/* DROPDOWN HOVER */
.nav-dropdown-menu a:hover {
  opacity: 1;
  background: var(--sidebar-sub-hover);
}

/* FORCE SIDEBAR BUTTON TO RESPECT THEME */
.nav-dropdown-toggle {
  background: transparent;
}

/* ALSO FIX EMOJI + TEXT INSIDE BUTTON */
.nav-dropdown-toggle * {
  color: inherit;
}

.price-up {
  color: #22c55e;
  transition: color 0.3s;
}

.price-down {
  color: #e7c4c4;
  transition: color 0.3s;
}



.trade-type label.disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(100%);
  cursor: not-allowed;
}

.trade-type label.stale::after {
  content: " WAIT…";
  font-size: 11px;
  color: #ffb300;
  margin-left: 6px;
}


/* ================================
   🎛 ASSET TABS (MARKET TYPES)
================================ */
.asset-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.asset-tabs button {
  appearance: none;
  border: 1px solid #2a2f3a;
  background: #121722;
  color: #9aa4b2;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.4px;
}

/* Hover */
.asset-tabs button:hover:not(:disabled) {
  color: #fff;
  background: #1a2130;
  border-color: #3b82f6;
}

/* Active */
.asset-tabs button.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

/* Disabled (Coming Soon) */
.asset-tabs button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}

/* "Coming Soon" badge */
.asset-tabs button:disabled::after {
  content: "SOON";
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 9px;
  background: #ef4444;
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* ================================
   🎯 SYMBOL SELECT POLISH
================================ */
select {
  background: #121722;
  border: 1px solid #2a2f3a;
  color: #e5e7eb;
  padding: 8px 10px;
  border-radius: 8px;
}

select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
