/* ==========================================================================
   JUST MARKET — Just Market-Inspired Design System
   Dark navy bg, teal/green accent, gradient cards, bottom nav, modern UI
   ========================================================================== */

:root {
  --main-bg-color: #0a0b10;
  --bg-overlay: #0f172a;
  --bg-light: #1c2230;
  --bg-card: #171d2b;
  --bg-card-hover: #1e2433;
  --header-bg: #0b0e14;

  --highlight-color: #00e6a8;
  --highlight-dark: #00b377;
  --highlight-rgba: rgba(0, 230, 168, 0.15);
  --primary-blue: #007bff;
  --primary-blue-dark: #0056b3;

  --grad-red-start: #FF3E6C;
  --grad-red-end: #DB2777;
  --grad-purple-start: #7C3AED;
  --grad-purple-end: #4F46E5;
  --grad-green-start: #00C853;
  --grad-green-end: #00774a;
  --grad-deposit-start: #6a11cb;
  --grad-deposit-end: #2575fc;

  --up-color: #00cc44;
  --down-color: #ff3333;
  --warn-color: #FF9800;
  --info-color: #33aaff;
  --accent-pink: #ff3d8b;

  --text-color: #ffffff;
  --text-dim: #9CA3AF;
  --text-faint: #6b7280;

  --font-mono: 'SF Mono', 'Courier New', Courier, monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gradient-bg: radial-gradient(circle at top left, rgba(0, 230, 168, 0.08) 0%, transparent 50%),
                 radial-gradient(circle at top right, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
                 radial-gradient(circle at bottom, rgba(0, 150, 150, 0.04) 0%, transparent 60%);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(0, 230, 168, 0.25);
}

body.light-mode {
  --main-bg-color: #f0f2f5;
  --bg-overlay: #ffffff;
  --bg-light: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f2f5;
  --header-bg: #ffffff;
  --highlight-color: #00a854;
  --highlight-dark: #007a3d;
  --highlight-rgba: rgba(0, 168, 84, 0.15);
  --text-color: #1a1a1a;
  --text-dim: #555;
  --text-faint: #888;
  --border-color: rgba(0, 0, 0, 0.08);
  --gradient-bg: none;
  --primary-blue: #007bff;
}

.page-loader {
  position: fixed; inset: 0; background: var(--main-bg-color); z-index: 9999;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  animation: loaderFade 0.4s ease-in 0.6s forwards; pointer-events: none;
}
.page-loader.hidden { display: none !important; opacity: 0 !important; visibility: hidden !important; }
.page-loader .spinner {
  width: 20px; height: 20px; border: 2px solid var(--highlight-color);
  border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite;
}
.page-loader .loader-text { font-size: 10px; color: var(--highlight-color); font-family: var(--font-mono); letter-spacing: 1px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loaderFade { to { opacity: 0; visibility: hidden; pointer-events: none; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100vh; font-family: var(--font-body);
  background-color: var(--main-bg-color); background-image: var(--gradient-bg);
  color: var(--text-color); -webkit-font-smoothing: antialiased;
}
body {
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  background-image: var(--gradient-bg);
  background-attachment: fixed;
}

a { color: var(--highlight-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Ensure all elements have proper styling */
input, select, textarea, button {
  font-family: var(--font-body);
  font-size: 14px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--highlight-color);
  box-shadow: 0 0 0 3px rgba(0, 230, 168, 0.1);
}

/* Top Announcement Bar */
.announce-bar {
  position: sticky; top: 0; z-index: 40; background: var(--highlight-color); color: #000;
  padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500;
}
.announce-bar .announce-text { display: flex; align-items: center; gap: 8px; }
.announce-bar .deposit-btn {
  background: #fff; color: #000; padding: 4px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 600; text-decoration: none; border: none; cursor: pointer;
}
.announce-bar .deposit-btn:hover { opacity: 0.9; text-decoration: none; }

/* Top Navigation - New Design */
.top-nav {
  position: sticky; top: 0; z-index: 35; background: var(--header-bg);
  border-bottom: 1px solid var(--border-color); padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; height: 56px;
  gap: 12px;
  flex-wrap: nowrap;
  overflow: visible;
}

.top-nav .nav-left {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: visible;
}
.top-nav .nav-left .greeting {
  display: flex; flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.top-nav .nav-left .greeting-text {
  font-size: 14px; font-weight: 600; color: var(--text-color);
  white-space: nowrap;
  overflow: visible;
}

.top-nav .hamburger-menu {
  background: none; border: none; cursor: pointer; display: flex;
  flex-direction: column; gap: 5px; padding: 8px; color: var(--text-color);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.top-nav .hamburger-menu:hover {
  transform: scale(1.1);
}

.top-nav .hamburger-menu span {
  width: 22px; height: 2px; background: var(--text-color);
  border-radius: 2px; transition: all 0.3s ease;
  display: block;
}

.top-nav .hamburger-menu span.broken {
  width: 16px; opacity: 0.6;
}

.top-nav .nav-logo { display: flex; align-items: center; gap: 8px; }
.top-nav .nav-logo .logo-icon {
  width: 32px; height: 32px; background: var(--highlight-color); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; color: #000; font-weight: 800; font-size: 14px;
}
.top-nav .nav-logo .logo-text { display: flex; flex-direction: column; }
.top-nav .nav-logo .logo-text .name { font-size: 14px; font-weight: 700; color: var(--text-color); line-height: 1.2; }
.top-nav .nav-logo .logo-text .tagline { font-size: 10px; color: var(--text-dim); }

.top-nav .nav-center {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
/* Greeting now in nav-left */

.top-nav .greeting {
  display: flex; flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.top-nav .greeting-text {
  font-size: 14px; font-weight: 600; color: var(--text-color);
  white-space: nowrap;
  overflow: visible;
}

.top-nav .nav-right {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.top-nav .balance-display {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  padding: 8px 12px; border-radius: 8px;
  min-width: 90px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

.top-nav .balance-label {
  font-size: 11px; color: var(--text-dim); font-weight: 500;
}

.top-nav .balance-amount {
  font-size: 14px; font-weight: 700; color: var(--highlight-color);
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  max-width: 155px;
}

/* Slide-in Menu */
.menu-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  z-index: 39; display: none; backdrop-filter: blur(2px);
}

.menu-overlay.open {
  display: block;
}

.slide-menu {
  position: fixed; left: 0; top: 0; width: 280px; height: 100vh;
  background: var(--bg-card); border-right: 1px solid var(--border-color);
  z-index: 40; transform: translateX(-100%); transition: transform 0.3s ease;
  overflow-y: auto; display: flex; flex-direction: column;
}

.slide-menu.open {
  transform: translateX(0);
}

.slide-menu .menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--border-color);
  background: var(--bg-light);
}

.slide-menu .menu-title {
  font-size: 18px; font-weight: 700; color: var(--text-color);
}

.slide-menu .close-btn {
  background: none; border: none; color: var(--text-color);
  font-size: 24px; cursor: pointer; padding: 4px 8px;
  transition: transform 0.2s;
}

.slide-menu .close-btn:hover {
  transform: rotate(90deg);
}

.slide-menu .menu-list {
  list-style: none; padding: 8px 0; flex: 1;
}

.slide-menu .menu-list li {
  margin: 0;
}

.slide-menu .menu-list a,
.slide-menu .menu-list .logout-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 16px; color: var(--text-dim);
  text-decoration: none; font-size: 14px; cursor: pointer;
  border: none; background: none; transition: all 0.2s;
  text-align: left;
}

.slide-menu .menu-list a:hover,
.slide-menu .menu-list .logout-btn:hover {
  background: var(--bg-light); color: var(--highlight-color);
  padding-left: 20px;
}

.slide-menu .menu-list i {
  width: 20px; font-size: 16px; color: var(--highlight-color);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; width: 100%; z-index: 30; background: #131722;
  border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; align-items: center; padding: 6px 0 4px;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-dim);
  font-size: 10px; text-decoration: none; padding: 4px 8px; transition: color 0.2s;
}
.bottom-nav a i { font-size: 18px; }
.bottom-nav a.active { color: #ff851b; }
.bottom-nav a.active i { color: #ff851b; }
.bottom-nav a:hover { text-decoration: none; }

/* Theme Toggle */
.theme-toggle, .theme-toggle-sm {
  background: none; border: 1px solid var(--border-color); color: var(--text-dim);
  padding: 5px 10px; cursor: pointer; border-radius: 6px; font-size: 12px;
  display: flex; align-items: center; gap: 5px; transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}
.theme-toggle:hover, .theme-toggle-sm:hover { background: var(--bg-card); color: var(--text-color); }

/* Page Container */
.page-container { flex: 1; display: flex; justify-content: center; padding: 20px 16px; padding-bottom: 80px; }

/* Header (auth pages) */
.header {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
  background: var(--header-bg); border-bottom: 1px solid var(--border-color);
}
.header .header-left a { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 14px; text-decoration: none; }
.header .header-left a:hover { color: var(--text-color); text-decoration: none; }

/* Auth Forms */
.auth-box {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px;
  padding: 28px 24px; max-width: 420px; width: 100%; margin: 40px auto;
}
.auth-box h2 { font-size: 22px; font-weight: 700; color: var(--text-color); margin-bottom: 4px; }
.auth-box .sub { font-size: 13px; color: var(--text-dim); margin-bottom: 24px; }

/* Toast */
#toast-container { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); z-index: 9000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: 90%; max-width: 400px; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-size: 12px; color: #fff; pointer-events: auto; animation: toast-in 0.2s ease-out; background: var(--bg-card); border: 1px solid var(--border-color); }
.toast.success { border-color: var(--up-color); }
.toast.error { border-color: var(--down-color); }
.toast.warning { border-color: var(--warn-color); }
.toast.info { border-color: var(--info-color); }
.toast .toast-icon { font-size: 14px; }
.toast.success .toast-icon { color: var(--up-color); }
.toast.error .toast-icon { color: var(--down-color); }
.toast.warning .toast-icon { color: var(--warn-color); }
.toast.info .toast-icon { color: var(--info-color); }
.toast .toast-close { cursor: pointer; color: var(--text-dim); font-size: 16px; margin-left: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(20px); } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 8000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; max-width: 380px; width: 90%; position: relative; }
.modal-box h3 { font-size: 16px; color: var(--text-color); margin-bottom: 8px; }
.modal-box p { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.modal-box .modal-close-x { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; }
.modal-box .modal-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-box .btn { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; }
.modal-box .btn-outline { background: var(--bg-light); color: var(--text-color); border: 1px solid var(--border-color); }
.modal-box .btn-danger { background: var(--down-color); color: #fff; }

/* Legacy compatibility */
.box { padding: 20px; }
.box h2 { font-size: 18px; color: var(--text-color); margin-bottom: 6px; }
.box h3 { font-size: 15px; color: var(--text-color); margin-bottom: 6px; }
.box .sub { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.2); border-radius: 0; padding: 10px 14px; color: var(--text-color); font-size: 14px; transition: border-color 0.2s; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-faint); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-bottom-color: var(--highlight-color); }
.password-field { position: relative; }
.password-field i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-dim); }
.btn { padding: 10px 16px; border-radius: 10px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; transition: opacity 0.2s; }
.btn:hover { opacity: 0.9; }
.btn-outline { background: var(--bg-light); color: var(--text-color); border: 1px solid var(--border-color); }
.btn-danger { background: var(--down-color); color: #fff; }

/* Trading Panel Colors */
.trading-panel {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  border-radius: 12px; padding: 20px; color: #fff;
  margin-bottom: 16px; position: relative; overflow: hidden;
}

.trading-panel::before {
  content: ''; position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  pointer-events: none;
}

.trading-panel * {
  position: relative; z-index: 1;
}

.trading-panel h3 {
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
}

.trading-panel p {
  font-size: 13px; opacity: 0.9; margin-bottom: 16px;
}

/* Trade Buttons */
.btn-trade-buy, .btn-trade-sell {
  padding: 12px 24px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; color: #fff; display: inline-flex;
  align-items: center; gap: 8px;
}

.btn-trade-buy {
  background: linear-gradient(135deg, #00c853 0%, #00774a 100%);
}

.btn-trade-buy:hover {
  transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0, 200, 83, 0.3);
}

.btn-trade-sell {
  background: linear-gradient(135deg, #ff3333 0%, #cc0000 100%);
}

.btn-trade-sell:hover {
  transform: translateY(-2px); box-shadow: 0 8px 16px rgba(255, 51, 51, 0.3);
}

.btn-trade-now {
  background: linear-gradient(135deg, #00c853 0%, #00774a 100%);
  padding: 10px 20px; border-radius: 8px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; color: #fff; text-decoration: none;
}

.btn-trade-now:hover {
  transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0, 200, 83, 0.3);
  text-decoration: none;
}

.btn-trade-now.red {
  background: linear-gradient(135deg, #ff3333 0%, #cc0000 100%);
}

.btn-trade-now.red:hover {
  box-shadow: 0 8px 16px rgba(255, 51, 51, 0.3);
}

/* TradingView Background Color */
.tradingview-bg {
  background-color: #131722 !important;
}

/* Modal Updates - Change Investments to Trade */
.modal-box h3 {
  font-size: 16px; color: var(--text-color); margin-bottom: 8px;
}

/* Mobile */
@media (max-width: 768px) {
  .top-nav { 
    padding: 0 10px; height: 56px; gap: 8px;
    flex-wrap: nowrap;
    overflow: visible;
  }
  .top-nav .nav-center {
    display: none;
  }
  .top-nav .nav-left {
    gap: 8px;
    flex: 1 1 auto;
    overflow: visible;
  }
  .top-nav .nav-right {
    gap: 8px;
  }
  .top-nav .greeting-text {
    font-size: 12px;
    max-width: none;
    overflow: visible;
  }
  .top-nav .balance-display {
    padding: 6px 8px; gap: 1px;
    min-width: 80px;
    max-width: 140px;
  }
  .top-nav .balance-label {
    font-size: 10px;
  }
  .top-nav .balance-amount {
    font-size: 12px;
    max-width: 115px;
  }
  .bottom-nav { padding: 6px 0 4px; }
  .page-container { padding: 16px 12px; padding-bottom: 80px; }
  .slide-menu { width: 100%; }
}

/* Extra Small Screens */
@media (max-width: 380px) {
  .top-nav {
    padding: 0 6px;
    gap: 6px;
  }
  .top-nav .nav-left {
    gap: 6px;
    flex: 1 1 auto;
    overflow: visible;
  }
  .top-nav .nav-right {
    gap: 6px;
  }
  .top-nav .greeting-text {
    font-size: 11px;
    max-width: none;
    overflow: visible;
  }
  .top-nav .balance-display {
    padding: 4px 6px;
    min-width: 70px;
    max-width: 110px;
  }
  .top-nav .balance-label {
    font-size: 9px;
  }
  .top-nav .balance-amount {
    font-size: 11px;
    max-width: 90px;
  }
  .top-nav .nav-logo .logo-text {
    display: none;
  }
}

/* Missing utility classes */
.form-control { width: 100%; background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 14px; color: var(--text-color); font-size: 14px; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--highlight-color); }
.form-control::placeholder { color: var(--text-faint); }

.footer { text-align: center; padding: 16px; font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--border-color); margin-top: 20px; }
.footer i { margin-right: 4px; color: var(--highlight-color); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }


/* ===== LIGHT MODE VISIBILITY FIXES ===== */
body.light-mode .top-nav { background: #fff; border-bottom-color: rgba(0,0,0,0.1); }
body.light-mode .top-nav .greeting-text { color: #1a1a1a; }
body.light-mode .top-nav .balance-display { background: #f8f9fa; border-color: rgba(0,0,0,0.1); }
body.light-mode .top-nav .balance-amount { color: #007bff; }
body.light-mode .top-nav .balance-label { color: #555; }
body.light-mode .hamburger-menu span { background: #1a1a1a; }
body.light-mode .slide-menu { background: #fff; }
body.light-mode .slide-menu .menu-list a { color: #1a1a1a; }
body.light-mode .slide-menu .menu-list a:hover { background: #f0f2f5; }
body.light-mode .slide-menu .menu-header { border-bottom-color: rgba(0,0,0,0.1); }
body.light-mode .bottom-nav { background: #fff; border-top-color: rgba(0,0,0,0.1); }
body.light-mode .bottom-nav a { color: #888; }
body.light-mode .bottom-nav a.active { color: #007bff; }
body.light-mode .announce-bar { background: #007bff; color: #fff; }
body.light-mode .dash-content { background: #f0f2f5; }
body.light-mode .section-heading { color: #1a1a1a; }
body.light-mode .page-header .left h1 { color: #1a1a1a; }
body.light-mode .page-header .left p { color: #555; }
body.light-mode .page-header .right button { background: #fff; border-color: rgba(0,0,0,0.1); color: #555; }
body.light-mode .action-row .action-btn { background: #fff; color: #1a1a1a; border-color: rgba(0,0,0,0.1); }
body.light-mode .action-row .action-btn.primary { background: #00a854; color: #fff; border: none; }
body.light-mode .footer { color: #888; border-top-color: rgba(0,0,0,0.1); }
body.light-mode .balance-card { background: linear-gradient(135deg, #FF3E6C 0%, #DB2777 100%); }
body.light-mode .referral-card { background: linear-gradient(135deg, #007bff 0%, #0056b3 100%); }
body.light-mode .package-card { color: #1a1a1a; }
body.light-mode .package-card .pkg-name { color: #1a1a1a; }
body.light-mode .package-card .pkg-price { color: #1a1a1a; }
body.light-mode .package-card .pkg-stat-value { color: #1a1a1a; }
body.light-mode .package-card .pkg-stat-label { color: #555; }
body.light-mode .package-card .pkg-symbol { color: #555; }
body.light-mode .wallet-card { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode .wallet-card .value { color: #00a854; }
body.light-mode .wallet-card .label { color: #555; }
body.light-mode .inv-item { background: #fff; border-color: rgba(0,0,0,0.1); color: #1a1a1a; }
body.light-mode .inv-item .name { color: #1a1a1a; }
body.light-mode .inv-item .amt { color: #1a1a1a; }
body.light-mode .search-bar { background: #fff; border-color: rgba(0,0,0,0.1); color: #1a1a1a; }
body.light-mode .tabs button { background: #f8f9fa; border-color: rgba(0,0,0,0.1); color: #555; }
body.light-mode .tabs button.active { background: #00a854; color: #fff; border: none; }
body.light-mode input, body.light-mode select, body.light-mode textarea { background: #fff; border-color: rgba(0,0,0,0.1); color: #1a1a1a; }
body.light-mode input::placeholder, body.light-mode textarea::placeholder { color: #888; }
body.light-mode .empty-state { color: #555; }
body.light-mode .empty-state h3 { color: #1a1a1a; }
body.light-mode .staking-modal { background: #fff; }
body.light-mode .staking-modal .modal-title { color: #1a1a1a; }
body.light-mode .modal-box { background: #fff; color: #1a1a1a; }
body.light-mode .modal-box h3 { color: #1a1a1a; }
body.light-mode .modal-summary { background: #f8f9fa; }
body.light-mode .modal-summary-row { border-bottom-color: rgba(0,0,0,0.08); }
body.light-mode .modal-close-x { color: #555; }
body.light-mode #toast-container .toast { background: #fff; color: #1a1a1a; border-color: rgba(0,0,0,0.1); }


/* ==========================================================================
   GLOBAL MISSING COMPONENTS FIX — back-btn, contact cards, notifications,
   profile avatar, secure badges, steps, T&C accordion, landing nav, etc.
   ========================================================================== */

/* Back button (dep.php, with.php, etc.) */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px; color: var(--text-color);
  font-size: 15px; font-weight: 600; margin-bottom: 20px; text-decoration: none;
}
.back-btn:hover { color: var(--highlight-color); text-decoration: none; }
.back-btn i { font-size: 13px; }

/* Contact cards (chat.php, about.php) */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.contact-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; padding: 22px; text-align: center; }
.contact-card .icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; margin: 0 auto 12px; }
.contact-card .icon.green { background: rgba(37,211,102,0.15); color: #25D366; }
.contact-card .icon.blue { background: rgba(51,170,255,0.15); color: var(--info-color); }
.contact-card h4 { font-size: 15px; font-weight: 700; color: var(--text-color); margin-bottom: 6px; }
.contact-card p { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.5; }
.contact-btn { border: none; border-radius: 10px; padding: 10px 20px; font-size: 13px; font-weight: 600; cursor: pointer; color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.contact-btn.green { background: #25D366; }
.contact-btn.blue { background: var(--info-color); }

/* Stats row (about.php) */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 20px 0 28px; }
.stats-row .stat { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; text-align: center; }

/* Chat page (user side) */
.chat-messages { scroll-behavior: smooth; }
.chat-msg { display: flex; flex-direction: column; }
.typing-indicator { font-style: italic; }

/* Notifications */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.filter-bar button { background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 16px; color: var(--text-dim); font-size: 13px; font-weight: 600; cursor: pointer; }
.filter-bar button.active { background: var(--highlight-color); color: #000; border: none; }
.notif-item { display: flex; align-items: flex-start; gap: 14px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; margin-bottom: 10px; }
.notif-item.unread { border-color: var(--highlight-color); background: var(--highlight-rgba); }
.notif-item .notif-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-light); color: var(--highlight-color); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.notif-item .notif-content h4 { font-size: 14px; color: var(--text-color); margin-bottom: 4px; font-weight: 600; }
.notif-item .notif-content p { font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.notif-item .notif-time { font-size: 11px; color: var(--text-faint); margin-top: 6px; }

/* Profile avatar (prof.php) */
.profile-avatar { width: 90px; height: 90px; border-radius: 50%; background: var(--highlight-rgba); border: 2px solid var(--highlight-color); display: flex; align-items: center; justify-content: center; margin: 0 auto; overflow: hidden; position: relative; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar .placeholder { font-size: 30px; font-weight: 700; color: var(--highlight-color); }

/* Deposit page extras */
.offer-banner { background: var(--highlight-rgba); border: 1px solid var(--border-highlight); border-radius: 10px; padding: 12px 16px; font-size: 13px; color: var(--text-color); margin-bottom: 20px; }
.payment-methods .payment-method.active { border-color: var(--up-color) !important; }
.secure-badges { display: flex; justify-content: center; gap: 20px; margin: 20px 0; flex-wrap: wrap; }
.secure-badge { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.steps-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; }
.step-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px 10px; text-align: center; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--highlight-color); color: #000; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.step-title { font-size: 12px; font-weight: 700; color: var(--text-color); margin-bottom: 4px; }
.step-desc { font-size: 11px; color: var(--text-dim); }

/* Terms & Conditions page (agreement.php) */
.tc-header-card { text-align: center; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 30px 20px; margin-bottom: 20px; }
.tc-header-card .shield-icon { font-size: 36px; color: var(--highlight-color); margin-bottom: 12px; }
.tc-header-card h2 { font-size: 20px; color: var(--text-color); margin-bottom: 10px; }
.tc-header-card .tc-desc { font-size: 13px; color: var(--text-dim); max-width: 560px; margin: 0 auto 16px; line-height: 1.6; }
.tc-badges { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tc-badge { font-size: 11px; font-weight: 700; padding: 6px 14px; border-radius: 20px; display: inline-flex; align-items: center; gap: 6px; }
.tc-badge.orange { background: rgba(255,152,0,0.15); color: var(--warn-color); }
.tc-badge.green { background: rgba(0,204,68,0.15); color: var(--up-color); }

.probability-metrics { display: flex; gap: 14px; margin-bottom: 20px; }
.probability-box { flex: 1; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 18px; text-align: center; }
.probability-box .prob-value { font-size: 26px; font-weight: 800; font-family: var(--font-mono); margin-bottom: 6px; }
.probability-box .prob-value.green { color: var(--up-color); }
.probability-box .prob-value.red { color: var(--down-color); }
.probability-box .prob-label { font-size: 12px; color: var(--text-dim); }

.faq-accordion { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.faq-item .faq-q { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-color); }
.faq-item .faq-q i.fa-chevron-down { transition: transform 0.2s; color: var(--text-dim); font-size: 12px; }
.faq-item.open .faq-q i.fa-chevron-down { transform: rotate(180deg); }
.faq-item .faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; padding: 0 18px; }
.faq-item.open .faq-a { max-height: 300px; padding: 0 18px 16px; }
.faq-item .faq-a p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* Landing page custom top nav */
.top-nav .nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.top-nav .nav-logo .logo-icon { width: 34px; height: 34px; background: var(--highlight-color); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #000; font-size: 15px; }
.top-nav .nav-logo .logo-text { display: flex; flex-direction: column; }
.top-nav .nav-logo .logo-text .name { font-size: 14px; font-weight: 800; color: var(--text-color); letter-spacing: 0.5px; }
.top-nav .nav-logo .logo-text .tagline { font-size: 10px; color: var(--text-dim); }
.top-nav .nav-links { display: flex; align-items: center; gap: 22px; }
.top-nav .nav-links a { font-size: 14px; font-weight: 600; color: var(--text-dim); text-decoration: none; }
.top-nav .nav-links a:hover, .top-nav .nav-links a.active { color: var(--highlight-color); text-decoration: none; }
.top-nav .nav-right { display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; flex-shrink: 0; }
.top-nav .balance-pill { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border-color); padding: 8px 14px; border-radius: 20px; font-size: 13px; }
.top-nav .balance-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up-color); display: inline-block; }
.top-nav .balance-pill .amount { font-family: var(--font-mono); font-weight: 700; color: var(--text-color); }
.top-nav .user-dropdown-btn { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 10px; border-radius: 20px; background: var(--bg-card); border: 1px solid var(--border-color); }
.top-nav .user-dropdown-btn .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--highlight-color); color: #000; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.top-nav .user-dropdown-btn .uname { font-size: 13px; font-weight: 600; color: var(--text-color); }
.top-nav .user-dropdown-btn .chevron { font-size: 10px; color: var(--text-dim); }
.user-dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; min-width: 200px; padding: 8px; display: none; flex-direction: column; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.user-dropdown-menu.open { display: flex; }
.user-dropdown-menu .menu-header { padding: 10px 12px; border-bottom: 1px solid var(--border-color); margin-bottom: 6px; }
.user-dropdown-menu .menu-header .name { font-size: 13px; font-weight: 700; color: var(--text-color); }
.user-dropdown-menu .menu-header .phone { font-size: 11px; color: var(--text-dim); }
.user-dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--text-color); text-decoration: none; }
.user-dropdown-menu a:hover { background: var(--bg-light); text-decoration: none; }

/* Light mode fixes for above components */
body.light-mode .contact-card { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode .contact-card h4 { color: #1a1a1a; }
body.light-mode .stats-row .stat { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode .notif-item { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode .notif-item .notif-content h4 { color: #1a1a1a; }
body.light-mode .offer-banner { background: rgba(0,168,84,0.08); }
body.light-mode .step-item { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode .step-title { color: #1a1a1a; }
body.light-mode .tc-header-card { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode .tc-header-card h2 { color: #1a1a1a; }
body.light-mode .probability-box { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode .faq-item { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode .faq-item .faq-q { color: #1a1a1a; }
body.light-mode .top-nav .nav-links a { color: #555; }
body.light-mode .top-nav .balance-pill { background: #fff; }
body.light-mode .top-nav .balance-pill .amount { color: #1a1a1a; }
body.light-mode .top-nav .user-dropdown-btn { background: #fff; }
body.light-mode .top-nav .user-dropdown-btn .uname { color: #1a1a1a; }
body.light-mode .user-dropdown-menu { background: #fff; }
body.light-mode .user-dropdown-menu .menu-header .name { color: #1a1a1a; }
body.light-mode .user-dropdown-menu a { color: #1a1a1a; }
body.light-mode .user-dropdown-menu a:hover { background: #f0f2f5; }
body.light-mode .profile-avatar { background: rgba(0,168,84,0.1); }
body.light-mode .profile-avatar .placeholder { color: #00a854; }

/* ==========================================================================
   Finance Tabs (switch between Deposit / Withdraw / Trades / History)
   ========================================================================== */
.finance-tabs { display: flex; gap: 6px; background: var(--bg-light); border-radius: 10px; padding: 4px; margin-bottom: 18px; overflow-x: auto; }
.finance-tabs a {
  flex: 1; text-align: center; white-space: nowrap; padding: 9px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-dim); text-decoration: none; transition: all 0.2s;
}
.finance-tabs a i { margin-right: 5px; }
.finance-tabs a:hover { color: var(--text-color); text-decoration: none; }
.finance-tabs a.active { background: var(--primary-blue); color: #fff; }
body.light-mode .finance-tabs { background: #f0f2f5; }
body.light-mode .finance-tabs a { color: #555; }
body.light-mode .finance-tabs a.active { background: #007bff; color: #fff; }

/* Live auto-refresh stat tiles (deposit/withdraw pages) */
.live-stats-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.live-stat-tile { flex: 1; min-width: 100px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 14px; text-align: center; }
.live-stat-tile .lst-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); margin-bottom: 4px; }
.live-stat-tile .lst-value { font-size: 18px; font-weight: 800; font-family: var(--font-mono); transition: color 0.3s; }
.live-stat-tile .lst-value.green { color: var(--up-color); }
.live-stat-tile .lst-value.orange { color: var(--warn-color); }
.live-stat-tile .lst-value.red { color: var(--down-color); }
body.light-mode .live-stat-tile { background: #fff; border-color: rgba(0,0,0,0.1); }

/* Remaining missing component styles */

/* quick-amounts buttons (dep.php) */
.quick-amounts button { cursor: pointer; }

/* withdraw-locked (with.php) */
.withdraw-locked { text-align: center; }

/* chat admin-side classes (admin/chat.php) */
.chat-user-list { font-size: 13px; }
.chat-user-list .user-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--admin-border); transition: background 0.15s; }
.chat-user-list .user-item:hover { background: var(--admin-card); }
.chat-user-list .user-item.active { background: var(--admin-card); border-left: 3px solid var(--admin-highlight); }
.chat-main { display: flex; flex-direction: column; }
.chat-messages-admin { scroll-behavior: smooth; }
.chat-input-admin { display: flex; }
.chat-input-admin .bubble { padding: 8px 12px; border-radius: 10px; font-size: 13px; max-width: 70%; }

/* disabled state for payment methods */
.payment-method.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* TradingView widget container */
.tradingview-widget-container__widget { width: 100%; height: 100%; }

/* Light mode .box fix */
body.light-mode .box { background:#fff; border:1px solid rgba(0,0,0,0.08); color:#1a1a1a; }
body.light-mode .box h3 { color:#1a1a1a; }
