/* ==========================================================================
   120 WAVES — CUSTOMISABLE 9-THEME HOLO-GLASS UI/UX SYSTEM
   Themes: Imperial Gold, Pro Terminal, Quantum Wave, Northern Aurora,
           Liquid Prism, Velvet Crimson, Deep Nebula, Solar Ember, Pearl Daylight
   ========================================================================== */

:root,
[data-w120-theme="quantum"] {
  --w120-void: #020812;
  --w120-void-2: #04101E;
  --w120-s1: rgba(7, 22, 40, 0.36);
  --w120-s2: rgba(11, 32, 54, 0.92);
  --w120-s3: rgba(16, 42, 70, 0.42);
  --w120-rail: rgba(4, 13, 24, 0.46);
  --w120-bar: rgba(4, 13, 24, 0.46);
  --w120-primary: #00D4FF;
  --w120-primary-rgb: 0, 212, 255;
  --w120-accent: #5B82FF;
  --w120-accent-rgb: 91, 130, 255;
  --w120-on-primary: #001018;
  --w120-up: #19E39A;
  --w120-down: #FF5470;
  --w120-warn: #FFB547;
  --w120-ink: #EAF6FF;
  --w120-ink-2: #BDD0E2;
  --w120-ink-3: #8399B0;
  --w120-border: rgba(0, 212, 255, 0.20);
  --w120-border-hi: rgba(0, 212, 255, 0.52);
  --w120-input-bg: rgba(5, 16, 30, 0.48);
}

[data-w120-theme="gold"] {
  --w120-void: #050403;
  --w120-void-2: #0a0705;
  --w120-s1: rgba(18, 13, 8, 0.36);
  --w120-s2: rgba(25, 18, 11, 0.92);
  --w120-s3: rgba(33, 24, 16, 0.42);
  --w120-rail: rgba(10, 7, 5, 0.46);
  --w120-bar: rgba(10, 7, 5, 0.46);
  --w120-primary: #F1C244;
  --w120-primary-rgb: 241, 194, 68;
  --w120-accent: #E6A03A;
  --w120-accent-rgb: 230, 160, 58;
  --w120-on-primary: #1A1000;
  --w120-up: #2EBD85;
  --w120-down: #F6465D;
  --w120-warn: #F08C2E;
  --w120-ink: #F7F3EA;
  --w120-ink-2: #D8CFC0;
  --w120-ink-3: #A39784;
  --w120-border: rgba(241, 194, 68, 0.20);
  --w120-border-hi: rgba(241, 194, 68, 0.52);
  --w120-input-bg: rgba(15, 11, 7, 0.48);
}

[data-w120-theme="terminal"] {
  --w120-void: #0B0E11;
  --w120-void-2: #0F1317;
  --w120-s1: rgba(18, 23, 29, 0.36);
  --w120-s2: rgba(26, 31, 38, 0.92);
  --w120-s3: rgba(32, 38, 46, 0.42);
  --w120-rail: rgba(12, 15, 19, 0.46);
  --w120-bar: rgba(12, 15, 19, 0.46);
  --w120-primary: #2F7BFF;
  --w120-primary-rgb: 47, 123, 255;
  --w120-accent: #F0B90B;
  --w120-accent-rgb: 240, 185, 11;
  --w120-on-primary: #FFFFFF;
  --w120-up: #0ECB81;
  --w120-down: #F6465D;
  --w120-warn: #F0B90B;
  --w120-ink: #EAECEF;
  --w120-ink-2: #C8CED8;
  --w120-ink-3: #949FAF;
  --w120-border: rgba(47, 123, 255, 0.22);
  --w120-border-hi: rgba(47, 123, 255, 0.52);
  --w120-input-bg: rgba(14, 17, 21, 0.48);
}

[data-w120-theme="quantum"] {
  --w120-void: #020812;
  --w120-void-2: #04101E;
  --w120-s1: rgba(7, 22, 40, 0.36);
  --w120-s2: rgba(11, 32, 54, 0.92);
  --w120-s3: rgba(16, 42, 70, 0.42);
  --w120-rail: rgba(4, 13, 24, 0.46);
  --w120-bar: rgba(4, 13, 24, 0.46);
  --w120-primary: #00D4FF;
  --w120-primary-rgb: 0, 212, 255;
  --w120-accent: #5B82FF;
  --w120-accent-rgb: 91, 130, 255;
  --w120-on-primary: #001018;
  --w120-up: #19E39A;
  --w120-down: #FF5470;
  --w120-warn: #FFB547;
  --w120-ink: #EAF6FF;
  --w120-ink-2: #BDD0E2;
  --w120-ink-3: #8399B0;
  --w120-border: rgba(0, 212, 255, 0.20);
  --w120-border-hi: rgba(0, 212, 255, 0.52);
  --w120-input-bg: rgba(5, 16, 30, 0.48);
}

[data-w120-theme="aurora"] {
  --w120-void: #03060C;
  --w120-void-2: #071222;
  --w120-s1: rgba(10, 20, 36, 0.36);
  --w120-s2: rgba(15, 27, 48, 0.92);
  --w120-s3: rgba(21, 35, 61, 0.42);
  --w120-rail: rgba(5, 10, 20, 0.46);
  --w120-bar: rgba(5, 10, 20, 0.46);
  --w120-primary: #4D8BFF;
  --w120-primary-rgb: 77, 139, 255;
  --w120-accent: #36F1CD;
  --w120-accent-rgb: 54, 241, 205;
  --w120-on-primary: #04122E;
  --w120-up: #2FE39A;
  --w120-down: #FF5C7A;
  --w120-warn: #FFB35C;
  --w120-ink: #EEF3FF;
  --w120-ink-2: #C0CCE2;
  --w120-ink-3: #8796B0;
  --w120-border: rgba(54, 241, 205, 0.20);
  --w120-border-hi: rgba(54, 241, 205, 0.52);
  --w120-input-bg: rgba(7, 14, 26, 0.48);
}

[data-w120-theme="prism"] {
  --w120-void: #0D0820;
  --w120-void-2: #120A2A;
  --w120-s1: rgba(20, 13, 44, 0.36);
  --w120-s2: rgba(28, 19, 56, 0.92);
  --w120-s3: rgba(38, 26, 72, 0.42);
  --w120-rail: rgba(12, 7, 30, 0.46);
  --w120-bar: rgba(12, 7, 30, 0.46);
  --w120-primary: #FF5FA2;
  --w120-primary-rgb: 255, 95, 162;
  --w120-accent: #3EE0FF;
  --w120-accent-rgb: 62, 224, 255;
  --w120-on-primary: #2A0614;
  --w120-up: #34E3A4;
  --w120-down: #FF5C6C;
  --w120-warn: #FFC145;
  --w120-ink: #FBF7FF;
  --w120-ink-2: #D8CFEA;
  --w120-ink-3: #A296BC;
  --w120-border: rgba(255, 95, 162, 0.22);
  --w120-border-hi: rgba(255, 95, 162, 0.55);
  --w120-input-bg: rgba(14, 9, 32, 0.48);
}

[data-w120-theme="velvet"] {
  --w120-void: #0E0507;
  --w120-void-2: #160709;
  --w120-s1: rgba(28, 11, 15, 0.36);
  --w120-s2: rgba(37, 16, 21, 0.92);
  --w120-s3: rgba(48, 21, 28, 0.42);
  --w120-rail: rgba(16, 6, 8, 0.46);
  --w120-bar: rgba(16, 6, 8, 0.46);
  --w120-primary: #FF5577;
  --w120-primary-rgb: 255, 85, 119;
  --w120-accent: #F6C1A6;
  --w120-accent-rgb: 246, 193, 166;
  --w120-on-primary: #2A040C;
  --w120-up: #34D399;
  --w120-down: #FF4D4D;
  --w120-warn: #FFB347;
  --w120-ink: #FFF1F3;
  --w120-ink-2: #E2C5CA;
  --w120-ink-3: #B08E94;
  --w120-border: rgba(255, 85, 119, 0.22);
  --w120-border-hi: rgba(255, 85, 119, 0.52);
  --w120-input-bg: rgba(18, 7, 10, 0.48);
}

[data-w120-theme="nebula"] {
  --w120-void: #06030F;
  --w120-void-2: #0C0619;
  --w120-s1: rgba(20, 12, 36, 0.36);
  --w120-s2: rgba(27, 18, 48, 0.92);
  --w120-s3: rgba(36, 24, 64, 0.42);
  --w120-rail: rgba(10, 5, 22, 0.46);
  --w120-bar: rgba(10, 5, 22, 0.46);
  --w120-primary: #8B5CFF;
  --w120-primary-rgb: 139, 92, 255;
  --w120-accent: #FF4FD8;
  --w120-accent-rgb: 255, 79, 216;
  --w120-on-primary: #FFFFFF;
  --w120-up: #2FE3A0;
  --w120-down: #FF5C7A;
  --w120-warn: #FFB35C;
  --w120-ink: #F4F0FF;
  --w120-ink-2: #C9C0DE;
  --w120-ink-3: #9388AB;
  --w120-border: rgba(139, 92, 255, 0.22);
  --w120-border-hi: rgba(139, 92, 255, 0.55);
  --w120-input-bg: rgba(12, 7, 25, 0.48);
}

[data-w120-theme="ember"] {
  --w120-void: #080404;
  --w120-void-2: #110807;
  --w120-s1: rgba(26, 13, 10, 0.36);
  --w120-s2: rgba(34, 18, 14, 0.92);
  --w120-s3: rgba(45, 24, 18, 0.42);
  --w120-rail: rgba(14, 6, 5, 0.46);
  --w120-bar: rgba(14, 6, 5, 0.46);
  --w120-primary: #FF7A3D;
  --w120-primary-rgb: 255, 122, 61;
  --w120-accent: #FFC94D;
  --w120-accent-rgb: 255, 201, 77;
  --w120-on-primary: #1A0600;
  --w120-up: #3DDC97;
  --w120-down: #FF4D5E;
  --w120-warn: #FFB02E;
  --w120-ink: #FFF3EE;
  --w120-ink-2: #DBC6BE;
  --w120-ink-3: #A68D83;
  --w120-border: rgba(255, 122, 61, 0.22);
  --w120-border-hi: rgba(255, 122, 61, 0.52);
  --w120-input-bg: rgba(16, 8, 6, 0.48);
}

[data-w120-theme="daylight"] {
  color-scheme: light;
  --w120-void: #EEF2FB;
  --w120-void-2: #F5F7FD;
  --w120-s1: rgba(255, 255, 255, 0.56);
  --w120-s2: rgba(248, 250, 255, 0.95);
  --w120-s3: rgba(232, 236, 247, 0.60);
  --w120-rail: rgba(255, 255, 255, 0.65);
  --w120-bar: rgba(255, 255, 255, 0.65);
  --w120-primary: #5B5BF6;
  --w120-primary-rgb: 91, 91, 246;
  --w120-accent: #0D9488;
  --w120-accent-rgb: 13, 148, 136;
  --w120-on-primary: #FFFFFF;
  --w120-up: #059669;
  --w120-down: #E11D48;
  --w120-warn: #D97706;
  --w120-ink: #0F172A;
  --w120-ink-2: #334155;
  --w120-ink-3: #64748B;
  --w120-border: rgba(91, 91, 246, 0.18);
  --w120-border-hi: rgba(91, 91, 246, 0.45);
  --w120-input-bg: rgba(255, 255, 255, 0.72);
}

/* ==========================================================================
   PROCEDURAL BACKGROUND CANVAS FIELD
   ========================================================================== */
html {
  background-color: var(--w120-void) !important;
}

#w120BgCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1 !important;
  display: block;
}

/* Ensure main layout shells & sections sit above the canvas and let it shine through */
body {
  background-color: transparent !important;
  color: var(--w120-ink) !important;
  position: relative;
  z-index: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

section,
footer,
main,
nav,
.top-strip {
  position: relative;
  z-index: 1;
}

.app-layout,
.app-main-wrapper,
.admin-layout,
.admin-main,
.admin-stage-body,
.app-container,
.trading-container {
  background-color: transparent !important;
  background-image: none !important;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   SIDEBAR RAIL & NAVIGATION UPGRADES (TRANSLUCENT GLASS)
   ========================================================================== */
.app-sidebar,
.admin-sidebar {
  background: var(--w120-rail) !important;
  backdrop-filter: blur(10px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(140%) !important;
  border-right: 1px solid var(--w120-border) !important;
  box-shadow: 8px 0 32px -12px rgba(0, 0, 0, 0.45) !important;
}

.sidebar-user-card,
.admin-sidebar-footer {
  background: rgba(var(--w120-primary-rgb), 0.06) !important;
  border-color: var(--w120-border) !important;
}

.sidebar-link,
.admin-nav-item {
  color: var(--w120-ink-2) !important;
  border-radius: 12px !important;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.sidebar-link:hover,
.admin-nav-item:hover {
  background: rgba(var(--w120-primary-rgb), 0.12) !important;
  color: var(--w120-ink) !important;
  transform: translateX(3px);
}

.sidebar-link.active,
.admin-nav-item.active {
  background: linear-gradient(90deg, rgba(var(--w120-primary-rgb), 0.24) 0%, rgba(var(--w120-accent-rgb), 0.08) 100%) !important;
  color: var(--w120-primary) !important;
  border-color: var(--w120-border-hi) !important;
  box-shadow: 0 8px 22px -10px rgba(var(--w120-primary-rgb), 0.45) !important;
}

.sidebar-link.active::before,
.admin-nav-item.active::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 8px;
  bottom: 8px;
  width: 3.5px;
  border-radius: 99px;
  background: var(--w120-primary);
  box-shadow: 0 0 12px var(--w120-primary);
}

/* ==========================================================================
   TOPBAR / HEADER GLASS UPGRADE
   ========================================================================== */
.v2-topbar,
.admin-main-header,
.top-header,
.live-topbar,
.navbar-custom,
.ticker-bar,
header {
  background: var(--w120-bar) !important;
  backdrop-filter: blur(10px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(140%) !important;
  border-bottom: 1px solid var(--w120-border) !important;
}

/* ==========================================================================
   CRYSTAL-TRANSLUCENT HOLO-GLASS CARDS & PANELS
   ========================================================================== */
.glass-card:not(.epin-card-red):not(.epin-card-green),
#overviewWithdrawalCard,
.kpi-card,
.v2-card,
.adm-card,
.stat-card,
.manager-card,
.personal-share-card,
.ledger-card,
.trading-hero,
.tree-panel,
.controls-bar,
.journey-step-card,
.feature-card,
.level-card,
.onchain-box {
  background: radial-gradient(120% 70% at 0% 0%, rgba(var(--w120-primary-rgb), 0.11), transparent 65%),
              var(--w120-s1) !important;
  backdrop-filter: blur(6px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(6px) saturate(140%) !important;
  border: 1px solid var(--w120-border) !important;
  box-shadow: 0 14px 36px -16px rgba(0, 0, 0, 0.45) !important;
  color: var(--w120-ink) !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease !important;
}

.glass-card:not(.epin-card-red):not(.epin-card-green):hover,
.kpi-card:hover,
.adm-card:hover,
.stat-card:hover,
.manager-card:hover,
.feature-card:hover,
.level-card:hover {
  border-color: var(--w120-border-hi) !important;
  box-shadow: 0 18px 42px -14px rgba(0, 0, 0, 0.55),
              0 0 28px -10px rgba(var(--w120-primary-rgb), 0.40) !important;
}

/* Make inner containers, tables & form inputs translucent so motion graphics show through */
.tbl-box,
.v2-table-wrapper,
.data-table-wrapper,
.epin-ledger-scroll-container,
.tree-canvas-viewport {
  background: var(--w120-s1) !important;
  backdrop-filter: blur(6px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(6px) saturate(140%) !important;
  border-color: var(--w120-border) !important;
  position: relative;
  z-index: 1;
}

.tbl-box th,
.v2-table th,
.data-table th,
.epin-ledger-scroll-container table thead th {
  background: rgba(var(--w120-primary-rgb), 0.12) !important;
}

.v2-input,
.v2-select,
.v2-textarea,
.multi-id-select,
.form-input {
  background: var(--w120-input-bg) !important;
  backdrop-filter: blur(4px) !important;
  border-color: var(--w120-border) !important;
  color: var(--w120-ink) !important;
}

/* Top Holo Scan-Line on Glass Panels */
.glass-card:not(.epin-card-red):not(.epin-card-green)::before,
.adm-card::before,
.manager-card::before,
.ledger-card::before,
.trading-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--w120-primary-rgb), 0.85), rgba(var(--w120-accent-rgb), 0.75), transparent);
  pointer-events: none;
  z-index: 2;
}

/* Bottom Glowing Charge Meter on KPI Cards */
.kpi-card::after,
.stat-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: linear-gradient(90deg, var(--w120-primary), var(--w120-accent), transparent 88%);
  opacity: 0.85;
  pointer-events: none;
}

/* Light-Mode Readability Overrides for Pearl Daylight */
[data-w120-theme="daylight"] h1,
[data-w120-theme="daylight"] h2,
[data-w120-theme="daylight"] h3,
[data-w120-theme="daylight"] h4,
[data-w120-theme="daylight"] h5,
[data-w120-theme="daylight"] h6,
[data-w120-theme="daylight"] .kpi-value,
[data-w120-theme="daylight"] .kpi-val,
[data-w120-theme="daylight"] .adm-card-val,
[data-w120-theme="daylight"] .sidebar-user-name,
[data-w120-theme="daylight"] .adm-prof-name,
[data-w120-theme="daylight"] .v2-label,
[data-w120-theme="daylight"] .v2-table td {
  color: #0F172A !important;
}

[data-w120-theme="daylight"] p,
[data-w120-theme="daylight"] .subtext,
[data-w120-theme="daylight"] .kpi-label,
[data-w120-theme="daylight"] .kpi-sub,
[data-w120-theme="daylight"] .adm-card-title,
[data-w120-theme="daylight"] .adm-card-sub,
[data-w120-theme="daylight"] .v2-table th {
  color: #475569 !important;
}

[data-w120-theme="daylight"] .v2-input,
[data-w120-theme="daylight"] .v2-select,
[data-w120-theme="daylight"] .v2-textarea,
[data-w120-theme="daylight"] .multi-id-select,
[data-w120-theme="daylight"] .form-input {
  background-color: rgba(255, 255, 255, 0.75) !important;
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}

[data-w120-theme="daylight"] .hero-content-right {
  background: rgba(255, 255, 255, 0.72) !important;
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

[data-w120-theme="daylight"] .hero-content-right h1,
[data-w120-theme="daylight"] .hero-content-right p {
  color: #0F172A !important;
  text-shadow: none !important;
}

/* ==========================================================================
   SINGLE-ICON THEME SWITCHER BUTTON & DROPDOWN MENU
   ========================================================================== */
.w120-theme-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1100;
}

.w120-theme-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(var(--w120-primary-rgb), 0.15);
  border: 1px solid var(--w120-border-hi);
  color: var(--w120-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: 0 4px 14px -4px rgba(var(--w120-primary-rgb), 0.40);
}

.w120-theme-btn:hover {
  transform: translateY(-1px);
  background: rgba(var(--w120-primary-rgb), 0.25);
  border-color: var(--w120-primary);
}

.w120-theme-btn-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--w120-primary);
  border: 1.5px solid var(--w120-void);
  box-shadow: 0 0 8px var(--w120-primary);
}

.w120-theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 292px;
  max-width: calc(100vw - 24px);
  background: var(--w120-s2);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--w120-border-hi);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 99999;
}

.w120-theme-menu.open {
  display: flex;
  animation: w120MenuFade 0.18s ease-out;
}

@keyframes w120MenuFade {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.w120-theme-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--w120-border);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--w120-ink-2);
}

.w120-motion-btn,
.w120-motion-toggle {
  background: rgba(var(--w120-primary-rgb), 0.14);
  border: 1px solid var(--w120-border-hi);
  color: var(--w120-primary);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  font-family: monospace;
}

.w120-theme-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 2px;
}

.w120-theme-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 11px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--w120-ink);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.w120-theme-item:hover {
  background: rgba(var(--w120-primary-rgb), 0.12);
}

.w120-theme-item.active {
  background: rgba(var(--w120-primary-rgb), 0.18);
  border-color: var(--w120-primary);
}

.w120-theme-swatches {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  flex-shrink: 0;
}

.w120-theme-swatches span,
.w120-theme-swatches i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.w120-theme-meta,
.w120-theme-info {
  flex: 1;
  min-width: 0;
}

.w120-theme-name {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--w120-ink);
}

.w120-theme-blurb {
  display: block;
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--w120-ink-2);
  margin-top: 2px;
}

.w120-theme-check {
  color: var(--w120-primary);
  font-weight: 900;
  font-size: 13px;
  align-self: center;
}

/* Keep Dashboard Topbar items aligned on a single line on desktop */
@media (min-width: 1100px) {
  .v2-topbar {
    padding: 10px 18px !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
  }
  .topbar-left-cluster,
  .topbar-multi-id-bar,
  .v2-topbar-actions,
  .topbar-quick-actions,
  .topbar-user-cluster {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
  }
}
