/* ==========================================
   ArbiMax Theme - Dashboard Soft Blue
   Build: 20260201_SOFT_BLUE_THEME
   ==========================================
   GLOBAL THEME FILE - Single Source of Truth
   
   This file defines the new SOFT BLUE identity
   replacing all purple accents throughout the platform.
   ========================================== */

:root {
  /* ==========================================
     SOFT BLUE ACCENT SYSTEM (Replacing Purple)
     ========================================== */
  --am-accent: #6AAEFF;                          /* Primary soft blue */
  --am-accent-2: #86BFFF;                        /* Secondary soft blue (lighter) */
  --am-accent-strong: #2F7DFF;                   /* Active states (deeper blue) */
  --am-accent-dim: rgba(106, 174, 255, 0.15);    /* Subtle backgrounds */
  --am-accent-glow: rgba(106, 174, 255, 0.25);   /* Glow effects */
  
  /* Accent Semantic Variants */
  --am-accent-bg: rgba(106, 174, 255, 0.08);     /* Accent card backgrounds */
  --am-accent-border: rgba(106, 174, 255, 0.18); /* Accent borders */
  --am-border-accent: rgba(120, 170, 255, 0.18); /* Brand borders */
  
  /* ==========================================
     BACKGROUNDS & SURFACES (Dark Premium)
     ========================================== */
  --am-bg-0: #070A0F;                            /* Deepest background */
  --am-bg-1: #0B0F16;                            /* Primary background */
  --am-bg: #0B0C10;                              /* Legacy alias */
  --am-bg-grad-from: #070A0F;
  --am-bg-grad-via: #0B0F16;
  --am-bg-grad-to: #0D1218;
  
  /* Panel/Glass System */
  --am-panel: rgba(18, 22, 30, 0.55);            /* Glass panels */
  --am-panel-2: rgba(12, 16, 24, 0.72);          /* Stronger glass */
  --am-surface-1: rgba(14, 18, 26, 0.65);        /* Primary glass surface */
  --am-surface-2: rgba(18, 22, 30, 0.8);         /* Higher opacity */
  --am-surface-3: #141A24;                       /* Solid floating elements */
  
  /* ==========================================
     BORDER SYSTEM (Soft Blue Tinted)
     ========================================== */
  --am-border: rgba(120, 170, 255, 0.18);        /* Default border */
  --am-border-subtle: rgba(255, 255, 255, 0.06); /* Very subtle borders */
  --am-border-strong: rgba(120, 170, 255, 0.35); /* Emphasized borders */
  --am-border-focus: rgba(106, 174, 255, 0.5);   /* Focus state borders */
  
  /* ==========================================
     TYPOGRAPHY & TEXT
     ========================================== */
  --am-text: rgba(255, 255, 255, 0.92);          /* Primary text */
  --am-text-muted: rgba(255, 255, 255, 0.62);    /* Muted text */
  --am-text-dim: rgba(255, 255, 255, 0.45);      /* Dim text */
  --am-text-faint: rgba(255, 255, 255, 0.28);    /* Very faint text */
  
  /* ==========================================
     SEMANTIC COLORS (Unchanged)
     ========================================== */
  --am-profit: #10B981;                          /* Success/Profit */
  --am-loss: #EF4444;                            /* Danger/Loss */
  --am-warning: #F59E0B;                         /* Warning */
  --am-cta: #FFFFFF;                             /* CTA buttons */
  --am-cta-text: #0B0C10;                        /* Text on CTA */
  
  /* Semantic Surface Variants */
  --am-profit-bg: rgba(16, 185, 129, 0.1);
  --am-profit-border: rgba(16, 185, 129, 0.25);
  --am-loss-bg: rgba(239, 68, 68, 0.1);
  --am-loss-border: rgba(239, 68, 68, 0.25);
  --am-warning-bg: rgba(245, 158, 11, 0.1);
  --am-warning-border: rgba(245, 158, 11, 0.25);
  
  /* ==========================================
     GLOW & SHADOW SYSTEM (Subtle, Not Neon)
     ========================================== */
  --am-glow-accent: 0 0 16px rgba(106, 174, 255, 0.2);   /* Soft blue glow */
  --am-glow-white: 0 0 16px rgba(255, 255, 255, 0.12);   /* Subtle white glow */
  --am-glow-white-strong: 0 0 24px rgba(255, 255, 255, 0.25);
  --am-glow-profit: 0 0 12px rgba(16, 185, 129, 0.25);
  --am-glow-loss: 0 0 12px rgba(239, 68, 68, 0.25);
  --am-shadow-glow: 0 0 16px rgba(106, 174, 255, 0.2);
  
  /* Standard Shadows */
  --am-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --am-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
  --am-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --am-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
  
  /* ==========================================
     FOCUS RING (Soft Blue)
     ========================================== */
  --am-focus-ring: 0 0 0 3px rgba(106, 174, 255, 0.35);
  
  /* ==========================================
     INTERACTIVE STATES
     ========================================== */
  --am-hover-bg: rgba(106, 174, 255, 0.06);      /* Hover background */
  --am-active-bg: rgba(106, 174, 255, 0.12);     /* Active/pressed background */
  
  /* ==========================================
     LEGACY ALIASES (Backward Compatibility)
     ========================================== */
  --brand-primary: var(--am-accent);
  --brand-cyan: var(--am-accent-2);
  --layer-1: var(--am-surface-1);
  --layer-2: var(--am-surface-2);
  --layer-glass: var(--am-border);
  --border-subtle: var(--am-border-subtle);
  --text-primary: var(--am-text);
  --text-secondary: var(--am-text-muted);
  --danger-base: var(--am-loss);
  --success-base: var(--am-profit);
}

/* ==========================================
   GLOBAL BODY STYLES
   ========================================== */
body {
  background: linear-gradient(135deg, var(--am-bg-0) 0%, var(--am-bg-1) 50%, var(--am-bg-grad-to) 100%);
  color: var(--am-text);
  min-height: 100vh;
}

/* ==========================================
   GLASS CARD SYSTEM
   ========================================== */
.am-glass,
.am-card,
.card {
  background: var(--am-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--am-border);
  border-radius: 16px;
  transition: all 0.25s ease;
}

.am-glass:hover,
.am-card:hover,
.card:hover {
  border-color: var(--am-border-strong);
  box-shadow: var(--am-shadow-md);
}

/* ==========================================
   BUTTON SYSTEM (Soft Blue Theme)
   ========================================== */

/* Primary Button - White CTA */
.am-btn-primary,
.btn.brand,
.btn-primary {
  background: var(--am-cta);
  color: var(--am-cta-text);
  border: none;
  font-weight: 600;
  box-shadow: var(--am-glow-white);
  transition: all 0.25s ease;
}

.am-btn-primary:hover,
.btn.brand:hover,
.btn-primary:hover {
  box-shadow: var(--am-glow-white-strong);
  transform: translateY(-2px);
}

/* Secondary Button - Soft Blue Outline */
.am-btn-secondary,
.btn-secondary {
  background: var(--am-accent-bg);
  color: var(--am-accent);
  border: 1px solid var(--am-accent-border);
  transition: all 0.25s ease;
}

.am-btn-secondary:hover,
.btn-secondary:hover {
  background: var(--am-accent-dim);
  border-color: var(--am-accent);
  box-shadow: var(--am-glow-accent);
}

/* Ghost Button */
.am-btn-ghost,
.btn-ghost {
  background: transparent;
  color: var(--am-text-muted);
  border: 1px solid var(--am-border);
  transition: all 0.25s ease;
}

.am-btn-ghost:hover,
.btn-ghost:hover {
  background: var(--am-hover-bg);
  color: var(--am-text);
  border-color: var(--am-border-strong);
}

/* Danger Button */
.am-btn-danger,
.btn-danger {
  background: var(--am-loss-bg);
  color: var(--am-loss);
  border: 1px solid var(--am-loss-border);
  transition: all 0.25s ease;
}

.am-btn-danger:hover,
.btn-danger:hover {
  background: var(--am-loss);
  color: white;
  box-shadow: var(--am-glow-loss);
}

/* ==========================================
   INPUT SYSTEM
   ========================================== */
.am-input,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
  background: var(--am-bg-0);
  color: var(--am-text);
  border: 1px solid var(--am-border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: inherit;
  transition: all 0.25s ease;
  outline: none;
}

.am-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--am-accent);
  box-shadow: var(--am-focus-ring);
}

.am-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--am-text-faint);
}

/* ==========================================
   BADGE SYSTEM (Soft Blue)
   ========================================== */
.am-badge,
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--am-accent-bg);
  color: var(--am-accent);
  border: 1px solid var(--am-accent-border);
}

.am-badge-profit,
.badge.success {
  background: var(--am-profit-bg);
  color: var(--am-profit);
  border-color: var(--am-profit-border);
}

.am-badge-loss,
.badge.danger {
  background: var(--am-loss-bg);
  color: var(--am-loss);
  border-color: var(--am-loss-border);
}

/* ==========================================
   SCROLLBAR THEMING (Soft Blue)
   ========================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--am-bg-0);
}

::-webkit-scrollbar-thumb {
  background: var(--am-border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--am-accent);
}

/* ==========================================
   TABLE SYSTEM
   ========================================== */
.am-table,
table {
  border-collapse: separate;
  border-spacing: 0;
  background: var(--am-panel);
  border: 1px solid var(--am-border);
  border-radius: 12px;
  overflow: hidden;
}

.am-table th,
table th {
  background: rgba(106, 174, 255, 0.05);
  color: var(--am-text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--am-border);
}

.am-table td,
table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--am-border-subtle);
  transition: background 0.2s ease;
}

.am-table tr:hover td,
table tr:hover td {
  background: var(--am-hover-bg);
}

/* ==========================================
   TOAST NOTIFICATIONS (Soft Blue)
   ========================================== */
.toast,
#toast {
  background: var(--am-panel-2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--am-accent-border);
  border-radius: 12px;
  box-shadow: var(--am-shadow-lg);
}

.toast.success,
#toast.success {
  border-color: var(--am-profit-border);
  background: linear-gradient(135deg, var(--am-panel-2), var(--am-profit-bg));
}

.toast.danger,
.toast.error,
#toast.danger,
#toast.error {
  border-color: var(--am-loss-border);
  background: linear-gradient(135deg, var(--am-panel-2), var(--am-loss-bg));
}

/* ==========================================
   MODAL OVERLAY
   ========================================== */
.modal-overlay {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal-content {
  background: var(--am-panel-2);
  border: 1px solid var(--am-border);
  border-radius: 16px;
  box-shadow: var(--am-shadow-xl);
}

/* ==========================================
   PILL / TAG SYSTEM
   ========================================== */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

/* Authorized (green) */
.pill.authorized {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Unauthorized (red) */
.pill.unauthorized {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Verifying (muted) */
.pill.verifying {
  background: rgba(255, 255, 255, 0.06);
  color: var(--am-text-muted);
  border: 1px solid var(--am-border);
}

/* Admin (soft blue instead of purple) */
.pill.admin {
  background: var(--am-accent-bg);
  color: var(--am-accent);
  border: 1px solid var(--am-accent-border);
}

/* Live indicator */
.pill.live {
  background: var(--am-accent-bg);
  color: var(--am-accent);
  border: 1px solid var(--am-accent-border);
}

/* ==========================================
   ROLE BADGE (Soft Blue)
   ========================================== */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--am-accent-border);
  background: var(--am-accent-bg);
  color: var(--am-accent-2);
  font-weight: 700;
  font-size: 12px;
}

.user-role-label.admin {
  background: var(--am-accent-bg);
  color: var(--am-accent);
  border: 1px solid var(--am-accent-border);
}

.user-role-label.trader {
  background: var(--am-accent-bg);
  color: var(--am-accent-2);
  border: 1px solid var(--am-accent-border);
}

/* ==========================================
   MICRO ANIMATIONS
   ========================================== */

/* Hover lift effect */
.am-lift:hover,
.card:hover,
.am-card:hover {
  transform: translateY(-2px);
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.am-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Soft pulse animation (non-intrusive) */
@keyframes softPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.am-pulse {
  animation: softPulse 2s ease-in-out infinite;
}

/* Glow pulse for indicators */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 8px var(--am-accent-glow);
  }
  50% {
    box-shadow: 0 0 16px var(--am-accent-glow);
  }
}

.am-glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.text-accent { color: var(--am-accent); }
.text-accent-2 { color: var(--am-accent-2); }
.text-profit { color: var(--am-profit); }
.text-loss { color: var(--am-loss); }
.text-muted { color: var(--am-text-muted); }

.bg-accent { background: var(--am-accent-bg); }
.bg-panel { background: var(--am-panel); }
.bg-surface { background: var(--am-surface-1); }

.border-accent { border-color: var(--am-accent-border); }
.border-strong { border-color: var(--am-border-strong); }

.glow-accent { box-shadow: var(--am-glow-accent); }
.glow-white { box-shadow: var(--am-glow-white); }

/* ==========================================
   RESPONSIVE IMPROVEMENTS
   ========================================== */
@media (max-width: 768px) {
  :root {
    --am-space-page: 16px;
    --am-space-card: 16px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
