/* =====================================================================
   PRØXY JOURNAL — CINEMATIC ANIMATION LAYER v3.0
   Drop AFTER style.css in index.html
   ===================================================================== */

/* ═══════════════════════════════════════════════════════════════════
   DESIGN TOKENS — Override / Extend
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --anim-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --anim-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --anim-snappy: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --glow-purple: 0 0 20px rgba(124,58,237,0.6), 0 0 60px rgba(124,58,237,0.3), 0 0 100px rgba(124,58,237,0.1);
  --glow-green:  0 0 20px rgba(16,185,129,0.5), 0 0 50px rgba(16,185,129,0.2);
  --glow-red:    0 0 20px rgba(239,68,68,0.5),  0 0 50px rgba(239,68,68,0.2);
}

/* ═══════════════════════════════════════════════════════════════════
   1. SPLASH SCREEN — Ultra-premium cinematic entrance
   ═══════════════════════════════════════════════════════════════════ */

#px-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #03030a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 1s cubic-bezier(0.16,1,0.3,1), visibility 1s ease;
  overflow: hidden;
}
#px-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Corner brackets — luxury framing device */
.splash-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(124,58,237,0.5);
  border-style: solid;
  opacity: 0;
  animation: cornerIn 0.6s ease 1.2s both;
}
.splash-corner-tl { top: 28px; left: 28px; border-width: 1.5px 0 0 1.5px; }
.splash-corner-tr { top: 28px; right: 28px; border-width: 1.5px 1.5px 0 0; animation-delay: 1.3s !important; }
.splash-corner-bl { bottom: 28px; left: 28px; border-width: 0 0 1.5px 1.5px; animation-delay: 1.4s !important; }
.splash-corner-br { bottom: 28px; right: 28px; border-width: 0 1.5px 1.5px 0; animation-delay: 1.5s !important; }
@keyframes cornerIn {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

/* Animated perspective grid — trading data aesthetic */
.splash-grid-overlay {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(124,58,237,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(900px) rotateX(12deg) translateY(10%);
  animation: gridDrift 25s linear infinite;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}
@keyframes gridDrift {
  0%   { transform: perspective(900px) rotateX(12deg) translateY(10%) translateZ(0); }
  100% { transform: perspective(900px) rotateX(12deg) translateY(15%) translateZ(20px); }
}

/* Radial vignette */
#px-splash::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 70% at 50% 50%, transparent 40%, #03030a 100%),
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(124,58,237,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Floating orbs — deeper, richer */
.splash-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform;
  z-index: 0;
}
.splash-orb1 {
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(109,40,217,0.4) 0%, transparent 65%);
  top: -300px; left: -250px;
  animation: orbFloat1 9s ease-in-out infinite;
}
.splash-orb2 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(168,85,247,0.28) 0%, transparent 65%);
  bottom: -200px; right: -200px;
  animation: orbFloat2 11s ease-in-out infinite;
}
.splash-orb3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 65%);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  animation: orbFloat3 7s ease-in-out infinite;
}
@keyframes orbFloat1 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(50px,-60px) scale(1.12);} }
@keyframes orbFloat2 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(-40px,50px) scale(1.08);} }
@keyframes orbFloat3 { 0%,100%{transform:translate(-50%,-50%) scale(1);} 50%{transform:translate(-50%,-50%) scale(1.35); opacity:0.5;} }

/* Center logo wrapper */
.splash-logo-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: splashLogoIn 1s var(--anim-smooth) 0.2s both;
}
@keyframes splashLogoIn {
  0%   { opacity: 0; transform: scale(0.75) translateY(30px); filter: blur(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

/* Icon ring — premium with multi-layer glow */
.splash-icon-ring {
  width: 110px; height: 110px;
  border-radius: 32px;
  background: linear-gradient(145deg, #8b21ff, #6d28d9 40%, #5b21b6);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; color: #fff;
  box-shadow:
    0 0 0 1px rgba(139,33,255,0.5),
    0 0 30px rgba(124,58,237,0.7),
    0 0 80px rgba(124,58,237,0.35),
    0 0 160px rgba(124,58,237,0.15),
    inset 0 1px 0 rgba(255,255,255,0.15);
  margin-bottom: 36px;
  position: relative;
  animation: iconFloat 4s ease-in-out 1.4s infinite;
}
@keyframes iconFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(-1deg); }
}

/* Rotating conic ring */
.splash-icon-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 35px;
  background: conic-gradient(from 0deg, #7c3aed 0%, #a855f7 25%, #06b6d4 50%, #a855f7 75%, #7c3aed 100%);
  z-index: -1;
  animation: conicSpin 2.5s linear infinite;
  opacity: 0.9;
}
@keyframes conicSpin { to { transform: rotate(360deg); } }

/* Dark inset ring to cut the glow */
.splash-icon-ring::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 33px;
  background: linear-gradient(145deg, #1a0a2e, #0c0622);
  z-index: -1;
}

/* Pulse rings behind icon */
.splash-ring-pulse {
  position: absolute;
  inset: -20px;
  border-radius: 50px;
  border: 1px solid rgba(124,58,237,0.3);
  animation: ringPulse 2.5s ease-in-out 1.5s infinite;
}
.splash-ring-pulse::before,
.splash-ring-pulse::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 60px;
  border: 1px solid rgba(124,58,237,0.15);
  animation: ringPulse 2.5s ease-in-out 1.7s infinite;
}
.splash-ring-pulse::after {
  inset: -40px;
  border-radius: 80px;
  animation-delay: 1.9s;
}
@keyframes ringPulse {
  0%,100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.06); opacity: 0; }
}

/* Title group */
.splash-title-group {
  text-align: center;
}

.splash-title {
  font-family: 'Inter', sans-serif;
  font-size: 4.2rem;
  font-weight: 900;
  letter-spacing: 14px;
  text-transform: uppercase;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #e9d8fd 25%,
    #c4b5fd 50%,
    #a78bfa 70%,
    #7c3aed 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  animation: titleShimmer 5s ease-in-out 0.8s infinite;
}
.slash-o {
  -webkit-text-fill-color: transparent;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  font-style: normal;
}
@keyframes titleShimmer {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.splash-eyebrow {
  font-size: 0.62rem;
  color: rgba(167,139,250,0.55);
  letter-spacing: 8px;
  text-transform: uppercase;
  margin-top: 12px;
  font-weight: 600;
  animation: fadeUp 0.6s ease 1s both;
}

.splash-subtitle {
  font-size: 0.65rem;
  color: rgba(124,58,237,0.45);
  letter-spacing: 4px;
  margin-top: 8px;
  font-weight: 500;
  animation: fadeUp 0.6s ease 1.15s both;
}

/* Footer section with loader bar */
.splash-footer {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeUp 0.6s ease 0.6s both;
}

.splash-bar-wrap {
  position: relative;
  width: 240px;
  height: 2px;
  background: rgba(124,58,237,0.12);
  border-radius: 99px;
  overflow: visible;
}
.splash-bar {
  height: 100%;
  background: linear-gradient(90deg, #5b21b6, #7c3aed, #a855f7, #c084fc, #a855f7, #7c3aed);
  background-size: 300% 100%;
  border-radius: 99px;
  width: 0%;
  animation:
    splashBarFill 1.8s var(--anim-snappy) 0.5s forwards,
    barShimmer 2s linear 0.5s infinite;
  position: relative;
}
.splash-bar::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 12px #a855f7, 0 0 24px rgba(168,85,247,0.8);
}
.splash-bar-glow {
  position: absolute;
  inset: -4px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,0.3), transparent);
  filter: blur(6px);
  animation: splashBarFill 1.8s var(--anim-snappy) 0.5s forwards;
  pointer-events: none;
}
@keyframes splashBarFill {
  0%   { width: 0%; }
  50%  { width: 65%; }
  80%  { width: 88%; }
  100% { width: 100%; }
}
@keyframes barShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.splash-tagline {
  font-size: 0.65rem;
  color: rgba(124,58,237,0.45);
  letter-spacing: 5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}
.splash-tag-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(124,58,237,0.5);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}



/* ═══════════════════════════════════════════════════════════════════
   2. APP REVEAL — After splash
   ═══════════════════════════════════════════════════════════════════ */

.sidebar.px-reveal {
  animation: sidebarReveal 1.1s var(--anim-smooth) both;
}
@keyframes sidebarReveal {
  0%   { opacity: 0; transform: translateX(-56px); filter: blur(6px); }
  100% { opacity: 1; transform: translateX(0); filter: blur(0); }
}

.main-content.px-reveal {
  animation: mainReveal 1.1s var(--anim-smooth) 0.1s both;
}
@keyframes mainReveal {
  0%   { opacity: 0; transform: translateY(32px) scale(0.98); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   3. SIDEBAR — Living, breathing, magnetic
   ═══════════════════════════════════════════════════════════════════ */

.sidebar {
  background: linear-gradient(175deg,
    #0c0b18 0%,
    #0a0a0f 50%,
    #0c0a16 100%
  ) !important;
  border-right: 1px solid rgba(124,58,237,0.15) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Ambient purple nebula that floats inside the sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  top: 10%; left: -40%;
  pointer-events: none;
  animation: sidebarNebula 12s ease-in-out infinite;
  z-index: 0;
}
@keyframes sidebarNebula {
  0%,100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  33%      { transform: translate(20px, 60px) scale(1.2); opacity: 1; }
  66%      { transform: translate(-10px, 120px) scale(0.9); opacity: 0.6; }
}

/* Second nebula — lower */
.sidebar::after {
  content: '';
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, transparent 70%);
  bottom: 15%; right: -30%;
  pointer-events: none;
  animation: sidebarNebula2 15s ease-in-out infinite;
  z-index: 0;
}
@keyframes sidebarNebula2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(-15px, -40px) scale(1.15); }
}

/* All sidebar children above the nebulas */
.sidebar > * { position: relative; z-index: 1; }

/* ── Sidebar Logo ────────────────────── */
.sidebar-logo {
  border-bottom: 1px solid rgba(124,58,237,0.1) !important;
  position: relative;
}
.sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,0.6), transparent);
  animation: logoBorderGlow 3s ease-in-out infinite;
}
@keyframes logoBorderGlow {
  0%,100% { opacity: 0.4; left: 20%; right: 20%; }
  50%      { opacity: 1; left: 10%; right: 10%; }
}

.proxy-logo i {
  animation: iconPulse 3s ease-in-out infinite;
  transition: transform 0.3s var(--anim-spring);
}
.proxy-logo:hover i { transform: scale(1.3) rotate(-10deg); }
@keyframes iconPulse {
  0%,100% { filter: drop-shadow(0 0 8px rgba(124,58,237,0.5)); }
  50%      { filter: drop-shadow(0 0 24px rgba(124,58,237,1)) drop-shadow(0 0 40px rgba(168,85,247,0.5)); }
}

.logo-text {
  background: linear-gradient(135deg, #ffffff 0%, #c4b5fd 40%, #7c3aed 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  background-size: 200% 200%;
  animation: logoGradientShift 4s ease-in-out infinite;
}
@keyframes logoGradientShift {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ── Nav Items — Magnetic + Reveal ──── */
.nav-item {
  position: relative !important;
  transition: all 0.25s var(--anim-spring) !important;
  overflow: hidden !important;
  isolation: isolate;
}

/* Glowing left border stripe */
.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; bottom: 15%;
  width: 3px;
  background: linear-gradient(180deg, #7c3aed, #a855f7, #c084fc);
  border-radius: 0 4px 4px 0;
  transform: scaleY(0) scaleX(0);
  transition: transform 0.3s var(--anim-spring);
  transform-origin: center;
  box-shadow: 2px 0 12px rgba(124,58,237,0.8);
  z-index: 2;
}
.nav-item:hover::before,
.nav-item.active::before {
  transform: scaleY(1) scaleX(1);
}

/* Ripple background that sweeps in from left */
.nav-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(124,58,237,0.18) 0%,
    rgba(124,58,237,0.08) 60%,
    transparent 100%
  );
  transform: translateX(-100%);
  transition: transform 0.35s var(--anim-smooth);
  z-index: 0;
  border-radius: inherit;
}
.nav-item:hover::after,
.nav-item.active::after {
  transform: translateX(0);
}

.nav-item > * { position: relative; z-index: 1; }

/* Icon bounce + glow on active */
.nav-item i {
  transition: transform 0.3s var(--anim-spring), filter 0.3s ease !important;
}
.nav-item:hover i {
  transform: scale(1.25) translateX(2px) !important;
  filter: drop-shadow(0 0 6px rgba(124,58,237,0.8));
}
.nav-item.active i {
  animation: navIconGlow 2s ease-in-out infinite;
}
@keyframes navIconGlow {
  0%,100% { filter: drop-shadow(0 0 4px rgba(124,58,237,0.5)); }
  50%      { filter: drop-shadow(0 0 12px rgba(124,58,237,1)) drop-shadow(0 0 20px rgba(168,85,247,0.5)); }
}

/* Text slides in slightly */
.nav-item span {
  transition: transform 0.25s var(--anim-spring), letter-spacing 0.25s ease !important;
  display: inline-block;
}
.nav-item:hover span,
.nav-item.active span {
  transform: translateX(4px);
  letter-spacing: 0.3px;
}

/* Active item: glowing card feel */
.nav-item.active {
  background: rgba(124,58,237,0.12) !important;
  border: 1px solid rgba(124,58,237,0.25) !important;
  color: #c4b5fd !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 20px rgba(124,58,237,0.1) !important;
}

/* Sidebar footer buttons */
.sidebar-footer button {
  transition: all 0.25s var(--anim-spring) !important;
  position: relative;
  overflow: hidden;
}
.sidebar-footer button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}
.sidebar-footer button:hover::before { transform: translateX(100%); }
.sidebar-footer button:hover {
  transform: translateY(-2px) scale(1.02) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   4. TOPBAR
   ═══════════════════════════════════════════════════════════════════ */

.topbar {
  animation: topbarIn 0.6s var(--anim-smooth) 0.25s both;
  backdrop-filter: blur(20px) saturate(180%) !important;
  background: rgba(10, 10, 20, 0.75) !important;
  border-bottom: 1px solid rgba(124,58,237,0.12) !important;
  position: relative;
}
.topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(124,58,237,0.4) 30%,
    rgba(168,85,247,0.6) 50%,
    rgba(124,58,237,0.4) 70%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: topbarLine 4s linear infinite;
}
@keyframes topbarIn {
  0%   { opacity: 0; transform: translateY(-16px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes topbarLine {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

#topbarTitle {
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #f0f0f8 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

/* ═══════════════════════════════════════════════════════════════════
   5. PAGE TRANSITIONS
   ═══════════════════════════════════════════════════════════════════ */

.page { animation: none; }
.page.active {
  animation: pageEnter 0.5s var(--anim-smooth) both;
}
@keyframes pageEnter {
  0%   { opacity: 0; transform: translateY(20px); filter: blur(4px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   6. STAT CARDS — Cinematic cascade
   ═══════════════════════════════════════════════════════════════════ */

.stat-card {
  animation: statCardIn 0.6s var(--anim-smooth) both;
  opacity: 0;
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate;
  transition:
    transform 0.3s var(--anim-spring),
    border-color 0.3s ease,
    box-shadow 0.3s ease !important;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.10s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.20s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.25s; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 0.30s; }
@keyframes statCardIn {
  0%   { opacity: 0; transform: translateY(30px) scale(0.95); filter: blur(4px); }
  70%  { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* Shimmer sweep on load */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; bottom: 0;
  width: 60%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.04) 50%,
    transparent 100%
  );
  animation: cardShimmer 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes cardShimmer {
  0%,100% { left: -100%; }
  50%      { left: 150%; }
}

/* Glow gradient on hover */
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at var(--mx,50%) var(--my,50%), rgba(124,58,237,0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}
.stat-card:hover::after { opacity: 1; }

.stat-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  border-color: rgba(124,58,237,0.5) !important;
  box-shadow:
    0 20px 40px rgba(124,58,237,0.2),
    0 0 0 1px rgba(124,58,237,0.2),
    inset 0 1px 0 rgba(255,255,255,0.06) !important;
}

.stat-value {
  display: inline-block;
  transition: transform 0.3s var(--anim-spring) !important;
  font-size: 2.1rem !important;
  font-weight: 900 !important;
  letter-spacing: -1px;
}
.stat-card:hover .stat-value { transform: scale(1.06); }

/* Coloured bottom glow bar per icon type */
.stat-card:has(.stat-icon.green):hover { border-color: rgba(16,185,129,0.4) !important; box-shadow: 0 20px 40px rgba(16,185,129,0.15), 0 0 0 1px rgba(16,185,129,0.15) !important; }
.stat-card:has(.stat-icon.red):hover   { border-color: rgba(239,68,68,0.4) !important;  box-shadow: 0 20px 40px rgba(239,68,68,0.15),  0 0 0 1px rgba(239,68,68,0.15)  !important; }
.stat-card:has(.stat-icon.blue):hover  { border-color: rgba(59,130,246,0.4) !important; box-shadow: 0 20px 40px rgba(59,130,246,0.15), 0 0 0 1px rgba(59,130,246,0.15) !important; }
.stat-card:has(.stat-icon.yellow):hover{ border-color: rgba(245,158,11,0.4) !important; box-shadow: 0 20px 40px rgba(245,158,11,0.15), 0 0 0 1px rgba(245,158,11,0.15) !important; }

/* Stat icons float */
.stat-icon {
  transition: transform 0.3s var(--anim-spring) !important;
}
.stat-card:hover .stat-icon { transform: scale(1.15) rotate(-5deg); }

/* ═══════════════════════════════════════════════════════════════════
   7. CARDS (general)
   ═══════════════════════════════════════════════════════════════════ */

.card {
  animation: cardIn 0.5s var(--anim-smooth) both;
  transition:
    transform 0.3s var(--anim-spring),
    border-color 0.3s ease,
    box-shadow 0.3s ease !important;
  position: relative;
  overflow: hidden;
}
@keyframes cardIn {
  0%   { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}
.card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(124,58,237,0.35) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35), 0 0 0 1px rgba(124,58,237,0.15) !important;
}

/* Card header gradient line */
.card-header {
  position: relative;
}
.card-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,0.3), transparent);
}

/* ═══════════════════════════════════════════════════════════════════
   8. BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn-primary {
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.3s var(--anim-spring) !important;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%) !important;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.2) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  transition: transform 0s;
}
.btn-primary:hover::before {
  transform: translateX(100%);
  transition: transform 0.5s ease;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.04) !important;
  box-shadow: 0 12px 35px rgba(124,58,237,0.55), 0 0 0 1px rgba(168,85,247,0.3) !important;
}
.btn-primary:active {
  transform: scale(0.96) !important;
  transition-duration: 0.1s !important;
}

/* Ghost button */
.btn-ghost {
  transition: all 0.25s var(--anim-spring) !important;
  position: relative;
  overflow: hidden;
}
.btn-ghost:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(124,58,237,0.5) !important;
  color: #c4b5fd !important;
}

/* ═══════════════════════════════════════════════════════════════════
   9. TABLE ROWS
   ═══════════════════════════════════════════════════════════════════ */

.trades-table tbody tr {
  animation: rowIn 0.4s var(--anim-smooth) both;
  opacity: 0;
  transition: background 0.2s ease, transform 0.2s var(--anim-spring) !important;
}
.trades-table tbody tr:nth-child(1)  { animation-delay: 0.02s; }
.trades-table tbody tr:nth-child(2)  { animation-delay: 0.05s; }
.trades-table tbody tr:nth-child(3)  { animation-delay: 0.08s; }
.trades-table tbody tr:nth-child(4)  { animation-delay: 0.11s; }
.trades-table tbody tr:nth-child(5)  { animation-delay: 0.14s; }
.trades-table tbody tr:nth-child(6)  { animation-delay: 0.17s; }
.trades-table tbody tr:nth-child(7)  { animation-delay: 0.20s; }
.trades-table tbody tr:nth-child(8)  { animation-delay: 0.23s; }
.trades-table tbody tr:nth-child(9)  { animation-delay: 0.26s; }
.trades-table tbody tr:nth-child(10) { animation-delay: 0.29s; }
@keyframes rowIn {
  0%   { opacity: 0; transform: translateX(-16px); }
  100% { opacity: 1; transform: translateX(0); }
}
.trades-table tbody tr:hover {
  transform: translateX(6px) !important;
  background: rgba(124,58,237,0.08) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   10. WIN RATIO CIRCLE
   ═══════════════════════════════════════════════════════════════════ */

#winCircle {
  transition: stroke-dashoffset 1.2s var(--anim-smooth) !important;
  filter: drop-shadow(0 0 6px rgba(16,185,129,0.6));
}

/* ═══════════════════════════════════════════════════════════════════
   11. MODAL
   ═══════════════════════════════════════════════════════════════════ */

.modal {
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
  backdrop-filter: blur(8px) !important;
}
.modal-content, .modal-box {
  animation: modalPop 0.4s var(--anim-spring) both;
}
@keyframes modalPop {
  0%   { opacity: 0; transform: scale(0.88) translateY(24px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   12. PERIOD BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.period-btn {
  transition: all 0.2s var(--anim-spring) !important;
  position: relative;
}
.period-btn.active {
  box-shadow: 0 4px 16px rgba(124,58,237,0.5), 0 0 0 1px rgba(124,58,237,0.3) !important;
  transform: scale(1.06);
}
.period-btn:hover:not(.active) { transform: scale(1.04); color: #c4b5fd !important; }

/* ═══════════════════════════════════════════════════════════════════
   13. CALENDAR CELLS
   ═══════════════════════════════════════════════════════════════════ */

.cal-day {
  transition:
    transform 0.2s var(--anim-spring),
    border-color 0.2s ease,
    box-shadow 0.2s ease !important;
}
.cal-day:hover {
  transform: scale(1.05) translateY(-2px) !important;
  border-color: rgba(124,58,237,0.45) !important;
  box-shadow: 0 8px 24px rgba(124,58,237,0.2) !important;
  z-index: 2;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════════
   14. FILTER & FORM INPUTS
   ═══════════════════════════════════════════════════════════════════ */

.filter-group {
  transition: all 0.25s var(--anim-spring) !important;
}
.filter-group:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(124,58,237,0.4) !important;
}
.filter-group:focus-within {
  border-color: rgba(124,58,237,0.65) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15) !important;
}

.form-input, .form-select, .form-textarea,
input[type="text"]:not([readonly]),
input[type="number"], input[type="email"],
select, textarea {
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}
.form-input:focus, .form-select:focus, .form-textarea:focus,
input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus,
select:focus, textarea:focus {
  border-color: rgba(124,58,237,0.65) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15) !important;
  outline: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   15. ACCOUNT & BACKTEST CARDS
   ═══════════════════════════════════════════════════════════════════ */

.account-card {
  transition:
    transform 0.3s var(--anim-spring),
    border-color 0.3s ease,
    box-shadow 0.3s ease !important;
  animation: cardIn 0.5s var(--anim-smooth) both;
}
.account-card:hover {
  transform: translateY(-6px) scale(1.01) !important;
  box-shadow: 0 24px 48px rgba(0,0,0,0.35), 0 0 0 1px rgba(124,58,237,0.25) !important;
}

.bt-stat-card, .backtest-stat {
  transition: transform 0.3s var(--anim-spring), border-color 0.3s ease !important;
  animation: statCardIn 0.5s var(--anim-smooth) both;
}
.bt-stat-card:hover, .backtest-stat:hover {
  transform: translateY(-5px) !important;
  border-color: rgba(124,58,237,0.4) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   16. DRAWDOWN WARNING
   ═══════════════════════════════════════════════════════════════════ */

#drawdownWarning {
  animation: warningSlide 0.5s var(--anim-smooth) both !important;
  position: relative;
  overflow: hidden;
}
#drawdownWarning::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #f59e0b, #ef4444);
  box-shadow: 0 0 12px rgba(245,158,11,0.8);
}
@keyframes warningSlide {
  0%   { opacity: 0; transform: translateY(-24px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   17. SCROLLBAR
   ═══════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(124,58,237,0.35);
  border-radius: 99px;
  transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.7); }

/* ═══════════════════════════════════════════════════════════════════
   18. PROGRESS BARS
   ═══════════════════════════════════════════════════════════════════ */

.progress-win, .progress-loss {
  transition: width 1s var(--anim-smooth) !important;
  position: relative;
  overflow: hidden;
}
.progress-win::after, .progress-loss::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: progressShimmer 2s ease-in-out infinite;
}
@keyframes progressShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ═══════════════════════════════════════════════════════════════════
   19. NOTIFICATION / BADGE PULSE
   ═══════════════════════════════════════════════════════════════════ */

.badge, [class*="badge"] {
  animation: badgePop 0.4s var(--anim-spring) both;
}
@keyframes badgePop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════
   20. CHARTS — Stagger reveal
   ═══════════════════════════════════════════════════════════════════ */

.charts-row .card, .charts-row-two .card {
  animation-delay: 0.2s !important;
}
.charts-row .card:last-child,
.charts-row-two .card:last-child {
  animation-delay: 0.35s !important;
}

/* ═══════════════════════════════════════════════════════════════════
   21. TEXT HIERARCHY
   ═══════════════════════════════════════════════════════════════════ */

.stat-label {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 1.4px !important;
  color: rgba(160,160,210,0.85) !important;
  text-transform: uppercase !important;
}
.card-header h3 {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.2px;
}
.card-header h3 i { opacity: 0.85; margin-right: 4px; }
.trades-table th {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  color: rgba(160,160,210,0.65) !important;
}
.nav-item span { font-weight: 600 !important; }
.nav-item.active span { font-weight: 700 !important; }
.logo-text { font-size: 1.5rem !important; font-weight: 900 !important; letter-spacing: 3px !important; }
.logo-subtitle { font-size: 0.62rem !important; letter-spacing: 4px !important; font-weight: 600 !important; }

/* ═══════════════════════════════════════════════════════════════════
   22. GLOBAL CURSOR GLOW (ambient light follows mouse)
   ═══════════════════════════════════════════════════════════════════ */

#px-cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.06) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9998;
  transition: opacity 0.4s ease;
  will-change: left, top;
  mix-blend-mode: screen;
}

/* ═══════════════════════════════════════════════════════════════════
   23. FLOATING PARTICLE SPARKS (on sidebar hover)
   ═══════════════════════════════════════════════════════════════════ */

.px-spark {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a855f7;
  pointer-events: none;
  z-index: 9997;
  box-shadow: 0 0 6px rgba(168,85,247,0.9);
  animation: sparkFly var(--dur, 0.8s) ease-out forwards;
}
@keyframes sparkFly {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx,0px), var(--dy,-60px)) scale(0); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   24. SELECT / DROPDOWN ENHANCED
   ═══════════════════════════════════════════════════════════════════ */

.modern-filter-select {
  transition: all 0.25s var(--anim-spring) !important;
}
.modern-filter-select:hover {
  border-color: rgba(124,58,237,0.45) !important;
  transform: translateY(-1px);
}
.modern-filter-select:focus {
  border-color: rgba(124,58,237,0.65) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15), 0 8px 20px rgba(0,0,0,0.2) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   25. REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #px-splash, #px-cursor-glow { display: none !important; }
}
