/* ==========================================================================
   TRADOPIAX — PREMIUM LEFT SLIDE-OUT DRAWERS SYSTEM (DESKTOP & LAPTOP)
   Smooth Motion Graphics, Glassmorphism, Neon Accents, Fluid Bezier Transitions
   ========================================================================== */

/* ── Active & Hover States for Left Nav Sidebar ── */
@media (min-width: 769px) {
  .left-nav {
    position: relative;
    z-index: 10005 !important;
  }

  .left-nav .nav-item {
    position: relative;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .left-nav .nav-item:hover {
    color: #38bdf8 !important;
    background: rgba(0, 149, 255, 0.1) !important;
    transform: translateX(2px);
  }

  .left-nav .nav-item.active {
    color: #38bdf8 !important;
    background: linear-gradient(135deg, rgba(0, 149, 255, 0.22), rgba(0, 229, 255, 0.12)) !important;
    box-shadow: inset 3px 0 0 #00e5ff, 0 0 16px rgba(0, 229, 255, 0.25) !important;
    transform: translateX(2px);
  }

  .left-nav .nav-item.nav-logout:hover {
    color: #ff5252 !important;
    background: rgba(255, 82, 82, 0.12) !important;
    box-shadow: inset 3px 0 0 #ff5252, 0 0 14px rgba(255, 82, 82, 0.25) !important;
  }

  .left-nav .nav-item.nav-logout:hover .nav-icon {
    filter: drop-shadow(0 0 6px rgba(255, 82, 82, 0.6)) !important;
  }

  .left-nav .nav-item.nav-logout:hover .nav-icon svg {
    stroke: #ff5252 !important;
  }

  .left-nav .nav-item.active .nav-icon {
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6));
  }
}

/* ── Common Desktop Drawer Baseline (Docked to Left Sidebar at 48px) ── */
@media (min-width: 769px) {
  /* Backdrops anchored alongside left nav */
  .ih-root,
  .lb-overlay,
  .support-overlay,
  .market-overlay,
  .an-overlay {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 48px !important;
    right: 0 !important;
    width: calc(100vw - 48px) !important;
    height: 100vh !important;
    background: rgba(4, 7, 14, 0.68) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 9900 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Right-edge luminous accent glow line for drawers */
  .ih-panel::after,
  .lb-modal::after,
  .support-container::after,
  .market-modal::after,
  .an-drawer-box::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.5) 0%, rgba(99, 102, 241, 0.3) 50%, rgba(0, 200, 83, 0.4) 100%);
    pointer-events: none;
    opacity: 0.65;
  }

  /* =========================================================================
     1. ACCOUNT DRAWER (IDENTITY HUB)
     ========================================================================= */
  .ih-root {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.32s ease, visibility 0.32s ease;
  }

  .ih-root.ih-open {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .ih-panel {
    position: relative !important;
    left: 0 !important;
    right: auto !important;
    top: 0 !important;
    width: min(880px, calc(100vw - 60px)) !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0 20px 20px 0 !important;
    box-shadow: 25px 0 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(0, 149, 255, 0.08) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
  }

  .ih-root.ih-open .ih-panel {
    transform: translateX(0) !important;
  }

  /* =========================================================================
     2. LEADERBOARD DRAWER
     ========================================================================= */
  .lb-overlay {
    display: flex !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease, visibility 0.32s ease;
  }

  .lb-overlay.show {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .lb-modal {
    position: relative !important;
    width: 480px !important;
    max-width: 480px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0 20px 20px 0 !important;
    box-shadow: 25px 0 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.08) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .lb-overlay.show .lb-modal {
    transform: translateX(0) !important;
  }

  .lb-list-section {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  /* =========================================================================
     3. SUPPORT DRAWER
     ========================================================================= */
  .support-overlay {
    display: flex !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease, visibility 0.32s ease;
  }

  .support-overlay.show {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .support-container {
    position: relative !important;
    width: min(920px, calc(100vw - 60px)) !important;
    max-width: 920px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0 20px 20px 0 !important;
    box-shadow: 25px 0 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(0, 149, 255, 0.08) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .support-overlay.show .support-container {
    transform: translateX(0) !important;
  }

  .support-body {
    flex: 1 !important;
    min-height: 0 !important;
  }

  /* =========================================================================
     4. MARKET DRAWER
     ========================================================================= */
  .market-overlay {
    display: flex !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease, visibility 0.32s ease;
  }

  .market-overlay.show {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .market-modal {
    position: relative !important;
    width: 480px !important;
    max-width: 480px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0 20px 20px 0 !important;
    box-shadow: 25px 0 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(0, 149, 255, 0.08) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .market-overlay.show .market-modal {
    transform: translateX(0) !important;
  }

  .market-list {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

}

/* =========================================================================
   6. DEDICATED ANALYTICS SLIDE DRAWER UI
   ========================================================================= */
.an-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9900;
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.an-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (min-width: 769px) {
  .an-overlay {
    left: 48px !important;
    width: calc(100vw - 48px) !important;
    align-items: stretch;
    justify-content: flex-start;
  }

  .an-drawer-box {
    position: relative;
    width: 520px;
    max-width: 520px;
    height: 100vh;
    max-height: 100vh;
    background: linear-gradient(172deg, #0d1424 0%, #080d16 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0 20px 20px 0;
    box-shadow: 25px 0 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(0, 149, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .an-overlay.show .an-drawer-box {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .an-overlay {
    align-items: flex-end;
    justify-content: center;
  }

  .an-drawer-box {
    width: 100%;
    max-height: 90vh;
    background: linear-gradient(175deg, #101827 0%, #0b0f19 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .an-overlay.show .an-drawer-box {
    transform: translateY(0);
  }
}

/* Analytics Drawer Header */
.an-drawer-head {
  padding: 18px 22px 14px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.35) 0%, rgba(15, 23, 42, 0) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.an-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.an-head-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 149, 255, 0.2), rgba(0, 229, 255, 0.1));
  border: 1px solid rgba(0, 229, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.2);
}

.an-head-titles h2 {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.an-head-titles p {
  font-size: 11px;
  color: #94a3b8;
  margin: 2px 0 0;
}

.an-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.an-action-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.an-action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.an-full-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 149, 255, 0.12);
  border: 1px solid rgba(0, 149, 255, 0.3);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.an-full-page-btn:hover {
  background: rgba(0, 149, 255, 0.25);
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(0, 149, 255, 0.3);
}

/* Analytics Drawer Body */
.an-drawer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom Scrollbar for all slide drawers */
.ih-panel::-webkit-scrollbar,
.lb-list-section::-webkit-scrollbar,
.support-body::-webkit-scrollbar,
.market-list::-webkit-scrollbar,
.settings-body::-webkit-scrollbar,
.an-drawer-scroll::-webkit-scrollbar {
  width: 5px;
}

.ih-panel::-webkit-scrollbar-track,
.lb-list-section::-webkit-scrollbar-track,
.support-body::-webkit-scrollbar-track,
.market-list::-webkit-scrollbar-track,
.settings-body::-webkit-scrollbar-track,
.an-drawer-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

.ih-panel::-webkit-scrollbar-thumb,
.lb-list-section::-webkit-scrollbar-thumb,
.support-body::-webkit-scrollbar-thumb,
.market-list::-webkit-scrollbar-thumb,
.settings-body::-webkit-scrollbar-thumb,
.an-drawer-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.ih-panel::-webkit-scrollbar-thumb:hover,
.lb-list-section::-webkit-scrollbar-thumb:hover,
.support-body::-webkit-scrollbar-thumb:hover,
.market-list::-webkit-scrollbar-thumb:hover,
.settings-body::-webkit-scrollbar-thumb:hover,
.an-drawer-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.4);
}

/* Filters Row */
.an-controls-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 12px 14px;
}

.an-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.an-filter-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.an-pill-group {
  display: flex;
  gap: 5px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.an-pill {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.an-pill:hover {
  color: #fff;
}

.an-pill.active {
  background: linear-gradient(135deg, #0095ff, #0066cc);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 149, 255, 0.35);
}

/* Primary Hero KPI Card */
.an-hero-card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.8) 0%, rgba(10, 15, 26, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.an-hero-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.an-hero-meta-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.an-hero-pnl {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 4px 0 6px;
}

.an-hero-pnl.positive {
  color: #00e676;
  text-shadow: 0 0 18px rgba(0, 230, 118, 0.3);
}

.an-hero-pnl.negative {
  color: #ff3d71;
  text-shadow: 0 0 18px rgba(255, 61, 113, 0.3);
}

.an-hero-pnl.neutral {
  color: #94a3b8;
}

.an-hero-sub {
  font-size: 11px;
  color: #64748b;
  display: flex;
  gap: 12px;
}

/* Win Rate Radial Gauge */
.an-gauge-box {
  width: 78px;
  height: 78px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.an-gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.an-gauge-bg {
  stroke: rgba(255, 255, 255, 0.06);
}

.an-gauge-bar {
  stroke: #00e676;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.4s ease;
}

.an-gauge-text {
  position: absolute;
  text-align: center;
}

.an-gauge-val {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.an-gauge-lbl {
  font-size: 8px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 2px;
}

/* 4-Item Grid for Key Stats */
.an-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.an-stat-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.an-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.an-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.an-stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.an-stat-ico {
  font-size: 13px;
  opacity: 0.8;
}

.an-stat-val {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
}

.an-stat-hint {
  font-size: 10px;
  color: #64748b;
}

/* Win vs Loss Bar */
.an-ratio-section {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.an-ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
}

.an-win-lbl {
  color: #00e676;
}

.an-loss-lbl {
  color: #ff3d71;
}

.an-ratio-track {
  height: 8px;
  background: rgba(255, 61, 113, 0.4);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.an-ratio-win {
  height: 100%;
  background: linear-gradient(90deg, #00c853, #00e676);
  border-radius: 6px;
  width: 0%;
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Recent Trades List inside Drawer */
.an-recent-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.an-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.an-recent-title {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.an-recent-count {
  font-size: 11px;
  color: #64748b;
}

.an-trades-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.an-trade-row {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.an-trade-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.an-trade-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.an-trade-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.an-trade-badge.call {
  background: rgba(0, 200, 83, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.an-trade-badge.put {
  background: rgba(255, 23, 68, 0.15);
  color: #ff3d71;
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.an-trade-meta {
  display: flex;
  flex-direction: column;
}

.an-trade-pair {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.an-trade-time {
  font-size: 10px;
  color: #64748b;
}

.an-trade-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.an-trade-profit {
  font-size: 12px;
  font-weight: 800;
}

.an-trade-profit.win {
  color: #00e676;
}

.an-trade-profit.loss {
  color: #ff3d71;
}

.an-trade-stake {
  font-size: 10px;
  color: #64748b;
}

/* Empty state */
.an-empty-state {
  text-align: center;
  padding: 30px 16px;
  color: #64748b;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.an-empty-state-icon {
  font-size: 26px;
  margin-bottom: 8px;
  opacity: 0.6;
}
