/* Digital Wealth PRO — Theme System (mature navy + gold palette) */

:root {
  --glox-navy: #0f1b2d;
  --glox-navy-mid: #1a2f4a;
  --glox-navy-soft: #243b53;
  --glox-gold: #c4a035;
  --glox-gold-dark: #9a7b1a;
  --glox-gold-glow: rgba(196, 160, 53, 0.25);
  --glox-teal: #0e7490;
  --glox-blue: #1e4976;

  --surface-bg: #0b1120;
  --surface-card: #151d2e;
  --surface-elevated: #1a2438;
  --surface-muted: #121a2b;
  --surface-header: rgba(11, 17, 32, 0.94);
  --border: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  --gradient-brand: linear-gradient(135deg, #1a2f4a 0%, #1e4976 45%, #0e7490 100%);
  --gradient-accent: linear-gradient(135deg, #9a7b1a 0%, #c4a035 50%, #d4b84a 100%);
  --gradient-hero: linear-gradient(160deg, #0b1120 0%, #0f172a 40%, #111827 100%);
  --gradient-text: linear-gradient(135deg, #e8d5a3 0%, #c4a035 40%, #7dd3fc 100%);
  --scrollbar-track: #151d2e;
  --scrollbar-thumb: #475569;
  --overlay: rgba(0, 0, 0, 0.65);
  --input-bg: #1a2438;
  --input-border: rgba(255, 255, 255, 0.12);
  --success: #059669;
  --danger: #dc2626;
  --sidebar-bg: #070d18;
  --sidebar-border: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] {
  --surface-bg: #f0f3f7;
  --surface-card: #ffffff;
  --surface-elevated: #ffffff;
  --surface-muted: #f8fafc;
  --surface-header: rgba(255, 255, 255, 0.88);
  --border: #dde3ea;
  --border-subtle: #eef2f6;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;
  --shadow-sm: 0 1px 3px rgba(15, 27, 45, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 27, 45, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 27, 45, 0.12);
  --gradient-hero: linear-gradient(160deg, #f0f3f7 0%, #e8eef5 35%, #edf4f8 70%, #f5f7fa 100%);
  --gradient-text: linear-gradient(135deg, #1a2f4a 0%, #1e4976 40%, #0e7490 100%);
  --scrollbar-track: #e8eef5;
  --scrollbar-thumb: #94a3b8;
  --overlay: rgba(15, 27, 45, 0.5);
  --input-bg: #ffffff;
  --input-border: #dde3ea;
  --sidebar-bg: #0f1b2d;
}

/* Scrollbar */
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); }

/* Mature brand accents (shared) */
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-gradient { background: var(--gradient-hero); }

.section-badge {
  background: rgba(196, 160, 53, 0.12);
  color: var(--glox-gold);
  border-color: rgba(196, 160, 53, 0.25);
}

[data-theme="light"] .section-badge {
  background: rgba(30, 73, 118, 0.08);
  color: var(--glox-blue);
  border-color: rgba(30, 73, 118, 0.15);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 3.25rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.25s, border-color 0.25s;
}

.theme-toggle:hover .theme-toggle-track {
  border-color: var(--glox-gold);
  box-shadow: 0 0 0 3px var(--glox-gold-glow);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--gradient-accent);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.theme-toggle.is-dark .theme-toggle-thumb {
  transform: translateX(1.55rem);
}

.theme-icon {
  width: 0.85rem;
  height: 0.85rem;
  color: var(--text-muted);
  z-index: 1;
  transition: color 0.2s;
}

.theme-toggle:not(.is-dark) .theme-icon-sun { color: var(--glox-gold-dark); }
.theme-toggle.is-dark .theme-icon-moon { color: var(--glox-gold); }

/* Header placement */
.udash-header .theme-toggle { margin-right: 0.15rem; }
.site-nav-actions .theme-toggle { margin-right: 0.25rem; }

/* ─── User dashboard ─── */
.udash-body {
  background: var(--surface-bg) !important;
  color: var(--text-primary) !important;
}

.udash-header {
  background: var(--surface-header) !important;
  border-bottom-color: var(--border) !important;
  backdrop-filter: blur(12px);
}

.udash-title { color: var(--text-primary) !important; }
.udash-greeting { color: var(--text-muted) !important; }
.udash-header-date { color: var(--text-muted) !important; }

.udash-balance-pill {
  background: var(--surface-muted) !important;
  border-color: var(--border) !important;
}
.udash-balance-pill-label { color: var(--text-muted) !important; }
.udash-balance-pill-value { color: var(--text-primary) !important; }

.udash-menu-btn {
  background: var(--surface-muted) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

.udash-notif-btn {
  background: var(--surface-muted) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

.udash-notif-panel {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
}
.udash-notif-head { color: var(--text-primary) !important; border-color: var(--border-subtle) !important; }
.udash-notif-item { color: var(--text-secondary) !important; }
.udash-notif-item:hover { background: var(--surface-muted) !important; }

.udash-sidebar {
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--sidebar-border);
}

.udash-brand-icon {
  background: var(--gradient-brand) !important;
  box-shadow: 0 4px 14px rgba(14, 116, 144, 0.35);
}

.udash-btn-deposit {
  background: var(--gradient-accent) !important;
  color: #1a1205 !important;
  border: none !important;
  font-weight: 800 !important;
}
.udash-btn-deposit:hover { filter: brightness(1.06); }

.dash-stat-card,
.dash-card,
.trader-card,
.featured-trader-card,
.portfolio-panel,
.stock-chart-card,
.stock-sidebar-card,
.crypto-quick-trade,
.crypto-holding-item,
.ihub-plan-card,
.ihub-invest-panel,
.ihub-insight-card {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
  color: var(--text-primary);
}

.dash-card-header {
  background: var(--surface-muted) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

.dash-stat-label,
.dash-label,
.udash-section-title {
  color: var(--text-muted) !important;
}

.dash-stat-value { color: var(--text-primary) !important; }

.dash-input,
.dash-select,
.stock-search-input {
  background: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}

.dash-input:focus,
.dash-select:focus,
.stock-search-input:focus {
  border-color: var(--glox-gold) !important;
  box-shadow: 0 0 0 3px var(--glox-gold-glow) !important;
}

.dash-btn-primary {
  background: var(--gradient-brand) !important;
  border: none !important;
}
.dash-btn-primary:hover { filter: brightness(1.08); }

.dash-btn-secondary {
  background: var(--surface-muted) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

.dash-link { color: var(--glox-teal) !important; }
[data-theme="dark"] .dash-link { color: #5eead4 !important; }

.invest-modal { background: var(--overlay) !important; }
.invest-modal-box {
  background: var(--surface-card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}
.invest-modal-head { border-color: var(--border-subtle) !important; }
.invest-modal-head h3 { color: var(--text-primary) !important; }
.invest-modal-desc { color: var(--text-muted) !important; }
.invest-modal-close { color: var(--text-muted) !important; }

.payment-tab {
  background: var(--surface-muted) !important;
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}
.payment-tab.active {
  background: var(--surface-card) !important;
  color: var(--glox-blue) !important;
  border-color: var(--glox-gold) !important;
}
[data-theme="dark"] .payment-tab.active { color: var(--glox-gold) !important; }

.preset-btn {
  background: var(--surface-muted) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}
.preset-btn:hover {
  border-color: var(--glox-gold) !important;
  color: var(--glox-gold-dark) !important;
}

/* Stock / crypto trading */
.stock-portfolio-bar,
.crypto-portfolio-bar {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}

.stock-stat span { color: var(--text-muted) !important; }
.stock-stat strong { color: var(--text-primary) !important; }

.stock-row,
.crypto-row {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}
.stock-row:hover,
.crypto-row:hover {
  border-color: rgba(196, 160, 53, 0.45) !important;
  box-shadow: var(--shadow-md) !important;
}

.stock-watch-card,
.crypto-watch-card {
  background: var(--surface-muted) !important;
  border-color: var(--border) !important;
}

.stock-section-head h3,
.crypto-quick-head h3 {
  color: var(--text-primary) !important;
}

.stock-trades-table th {
  color: var(--text-muted) !important;
  border-color: var(--border-subtle) !important;
}
.stock-trades-table td {
  color: var(--text-secondary) !important;
  border-color: var(--border-subtle) !important;
}

.crypto-holding-item { background: var(--surface-muted) !important; }

/* Auth */
.auth-page { background: var(--gradient-hero) !important; }
.auth-card {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
}

[data-theme="dark"] .auth-card h1,
[data-theme="dark"] .auth-page .text-slate-800 { color: var(--text-primary) !important; }
[data-theme="dark"] .auth-page .text-slate-500,
[data-theme="dark"] .auth-page .text-slate-600 { color: var(--text-muted) !important; }

.auth-logo-icon { background: var(--gradient-brand) !important; }

/* Register page */
[data-theme="dark"] .register-page { background: var(--surface-bg) !important; color: var(--text-primary); }
[data-theme="dark"] .register-form-card {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .register-page input,
[data-theme="dark"] .register-page select {
  background: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}

/* Live support */
[data-theme="dark"] .live-support-panel {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .live-support-header {
  background: var(--gradient-brand) !important;
}
[data-theme="dark"] .live-support-messages { background: var(--surface-muted) !important; }
[data-theme="dark"] .live-support-msg.bot .live-support-bubble {
  background: var(--surface-elevated) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .live-support-input-wrap {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .live-support-input {
  background: var(--input-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--input-border) !important;
}

.live-support-fab {
  background: var(--gradient-brand) !important;
  box-shadow: 0 8px 28px rgba(30, 73, 118, 0.45) !important;
}

/* ─── Homepage (index.php) — dark by default ─── */
html:not([data-theme="light"]) body.font-sans.text-slate-800,
[data-theme="dark"] body.font-sans.text-slate-800 {
  background: var(--surface-bg) !important;
  color: var(--text-primary) !important;
}

html:not([data-theme="light"]) #main-nav,
[data-theme="dark"] #main-nav {
  background: var(--surface-header) !important;
  border-bottom: 1px solid var(--border);
}

html:not([data-theme="light"]) #main-nav .text-slate-600,
html:not([data-theme="light"]) #main-nav a.text-sm,
[data-theme="dark"] #main-nav .text-slate-600,
[data-theme="dark"] #main-nav a.text-sm {
  color: var(--text-muted) !important;
}

html:not([data-theme="light"]) #main-nav a.text-sm:hover,
[data-theme="dark"] #main-nav a.text-sm:hover { color: var(--glox-gold) !important; }

html:not([data-theme="light"]) section.bg-white,
html:not([data-theme="light"]) .bg-white,
[data-theme="dark"] section.bg-white,
[data-theme="dark"] .bg-white {
  background: var(--surface-card) !important;
}

html:not([data-theme="light"]) section.bg-slate-50,
html:not([data-theme="light"]) .bg-slate-50,
[data-theme="dark"] section.bg-slate-50,
[data-theme="dark"] .bg-slate-50 {
  background: var(--surface-muted) !important;
}

html:not([data-theme="light"]) .bg-slate-100,
[data-theme="dark"] .bg-slate-100 {
  background: var(--surface-elevated) !important;
}

html:not([data-theme="light"]) .text-slate-800,
[data-theme="dark"] .text-slate-800 { color: var(--text-primary) !important; }
html:not([data-theme="light"]) .text-slate-700,
[data-theme="dark"] .text-slate-700 { color: var(--text-secondary) !important; }
html:not([data-theme="light"]) .text-slate-600,
[data-theme="dark"] .text-slate-600 { color: var(--text-muted) !important; }
html:not([data-theme="light"]) .text-slate-500,
[data-theme="dark"] .text-slate-500 { color: var(--text-muted) !important; }

html:not([data-theme="light"]) .border-slate-100,
html:not([data-theme="light"]) .border-slate-200,
[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-slate-200 {
  border-color: var(--border) !important;
}

html:not([data-theme="light"]) .converter-input,
html:not([data-theme="light"]) .converter-select,
[data-theme="dark"] .converter-input,
[data-theme="dark"] .converter-select {
  background: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}

html:not([data-theme="light"]) .converter-result,
[data-theme="dark"] .converter-result {
  background: rgba(196, 160, 53, 0.1) !important;
  border-color: rgba(196, 160, 53, 0.22) !important;
  color: var(--glox-gold) !important;
}

html:not([data-theme="light"]) .service-card,
html:not([data-theme="light"]) .plan-card:not(.plan-featured),
[data-theme="dark"] .crypto-card {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}

html:not([data-theme="light"]) .crypto-card:hover,
[data-theme="dark"] .crypto-card:hover {
  border-color: rgba(196, 160, 53, 0.4) !important;
}

html:not([data-theme="light"]) .modal-content,
[data-theme="dark"] .modal-content {
  background: var(--surface-card) !important;
  color: var(--text-primary) !important;
}

html:not([data-theme="light"]) .modal-content input,
[data-theme="dark"] .modal-content input {
  background: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}

html:not([data-theme="light"]) .modal-content label,
[data-theme="dark"] .modal-content label { color: var(--text-secondary) !important; }

html:not([data-theme="light"]) #mobile-menu,
[data-theme="dark"] #mobile-menu {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}

html:not([data-theme="light"]) .hamburger:hover,
[data-theme="dark"] .hamburger:hover { background: var(--surface-muted) !important; }

html:not([data-theme="light"]) .hamburger-line,
[data-theme="dark"] .hamburger-line { background: #cbd5e1 !important; }

/* Light mode restores Tailwind utility backgrounds on homepage */
[data-theme="light"] section.bg-white,
[data-theme="light"] .bg-white { background: #ffffff !important; }
[data-theme="light"] section.bg-slate-50,
[data-theme="light"] .bg-slate-50 { background: #f8fafc !important; }
[data-theme="light"] .bg-slate-100 { background: #f1f5f9 !important; }
[data-theme="light"] #main-nav { background: rgba(255, 255, 255, 0.8) !important; }

/* Homepage light refinements */
body.font-sans.text-slate-800 {
  background: var(--surface-bg);
}

#main-nav {
  border-bottom: 1px solid var(--border-subtle);
}

#main-nav.nav-scrolled {
  background: var(--surface-header) !important;
  box-shadow: var(--shadow-sm);
}

/* Admin panel light mode */
[data-theme="light"] .admin-body,
[data-theme="light"] .admin-auth-body {
  background: var(--surface-bg) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] .admin-sidebar {
  background: var(--glox-navy) !important;
}

[data-theme="light"] .admin-main { background: var(--surface-bg) !important; }
[data-theme="light"] .admin-header {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}
[data-theme="light"] .admin-header h1 { color: var(--text-primary) !important; }
[data-theme="light"] .admin-card {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}
[data-theme="light"] .admin-card-head { border-color: var(--border-subtle) !important; color: var(--text-primary) !important; }
[data-theme="light"] .admin-input {
  background: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .admin-table th { color: var(--text-muted) !important; }
[data-theme="light"] .admin-table td { color: var(--text-secondary) !important; border-color: var(--border-subtle) !important; }
[data-theme="light"] .admin-stat-card {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}
[data-theme="light"] .admin-stat-card strong { color: var(--text-primary) !important; }

/* Dark admin stays default; light toggle on admin when dark theme selected keeps admin dark aesthetic */
[data-theme="dark"] .admin-body { background: #0a0f18 !important; }
[data-theme="dark"] .admin-sidebar { background: #070d18 !important; }
[data-theme="dark"] .admin-card { background: #151d2e !important; border-color: rgba(255,255,255,0.08) !important; }

/* Utility: tailwind slate overrides in dark for dashboard pages using tailwind classes */
[data-theme="dark"] .text-slate-400 { color: #94a3b8 !important; }
[data-theme="dark"] .bg-slate-50 { background: var(--surface-muted) !important; }
[data-theme="dark"] .border-brand-200 { border-color: rgba(196, 160, 53, 0.3) !important; }
[data-theme="dark"] .bg-brand-50\/30 { background: rgba(196, 160, 53, 0.08) !important; }

/* Investment hub */
[data-theme="dark"] .ihub-hero { filter: brightness(0.92); }
[data-theme="dark"] .ihub-plan-card.featured { border-color: var(--glox-gold) !important; }

/* Mature gold accent on active nav */
.udash-nav-item.is-active {
  background: rgba(196, 160, 53, 0.12) !important;
  color: #f8fafc !important;
}
.udash-nav-item.is-active .udash-nav-icon-wrap {
  background: rgba(196, 160, 53, 0.2) !important;
  color: var(--glox-gold) !important;
}

.udash-help-btn {
  background: var(--gradient-accent) !important;
  color: #1a1205 !important;
}

@media (max-width: 768px) {
  .udash-header-right .theme-toggle { order: -1; }
}

/* Auth / register theme toggle placement */
.auth-theme-bar,
.register-theme-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

.register-theme-bar { top: 4.5rem; }

[data-theme="dark"] .udash-btn-withdraw {
  background: var(--surface-muted) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .udash-btn-support {
  background: var(--surface-muted) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .featured-trader-card,
[data-theme="dark"] .portfolio-panel.pro {
  background: var(--surface-card) !important;
}

[data-theme="dark"] .featured-trader-stats div,
[data-theme="dark"] .trader-card .bg-slate-50 {
  background: var(--surface-muted) !important;
}

[data-theme="dark"] .dash-toast {
  background: var(--surface-elevated) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border);
}

[data-theme="dark"] .bot-stats-bar,
[data-theme="dark"] .bot-strategy-card,
[data-theme="dark"] .bot-active-card {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .bot-stat strong,
[data-theme="dark"] .bot-active-stats strong,
[data-theme="dark"] .bot-how-list li strong { color: var(--text-primary) !important; }

[data-theme="dark"] .wc-word-input {
  background: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .wc-security-note {
  background: rgba(146, 64, 14, 0.15) !important;
  border-color: rgba(217, 119, 6, 0.3) !important;
  color: #fde68a !important;
}

/* Gold CTA shimmer on homepage */
.btn-shimmer::after {
  background: linear-gradient(90deg, transparent, rgba(196, 160, 53, 0.15), transparent) !important;
}

