@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --bg-deep: #070a13;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-hover: rgba(24, 34, 58, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.35);
  --primary-glow: rgba(99, 102, 241, 0.25);
  --emerald-glow: rgba(16, 185, 129, 0.25);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: #e2e8f0;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
}

.font-mono-numbers {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.07),
    0 10px 25px -5px rgba(0, 0, 0, 0.4),
    0 8px 10px -6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.glass-card-interactive:hover {
  border-color: var(--border-hover);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
    0 16px 32px -8px var(--primary-glow),
    0 10px 15px -3px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.glass-input {
  background: rgba(10, 15, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  transition: all 0.2s ease;
}

.glass-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  outline: none;
  background: rgba(13, 20, 38, 0.95);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 10, 19, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* Modern Glowing Badges */
.badge-live-pulse {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.badge-live-pulse::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: inherit;
  opacity: 0.6;
  animation: pulse-ring 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  z-index: -1;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* Modern Button Shine Effect */
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
    0 4px 12px 0 rgba(79, 70, 229, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.3),
    0 6px 20px 0 rgba(79, 70, 229, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px 0 rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Subtle Table Row Highlight */
.trade-row {
  transition: background-color 0.15s ease;
}
.trade-row:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

/* Mobile-First Optimizations & Touch Controls */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS Safari auto-zoom on form inputs by ensuring font-size is at least 16px on mobile */
@media screen and (max-width: 640px) {
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Hide scrollbar while preserving swipe navigation */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Safe Area Inset Support for Mobile Notches & Gesture Home Bars */
.safe-bottom {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.bottom-nav-safe {
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

/* Mobile Drawer Animation */
.mobile-drawer-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}
.mobile-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-content {
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-drawer-content.active {
  transform: translateX(0);
}

/* Mobile Trade Card Pulse & Transitions */
.mobile-trade-card {
  transition: all 0.2s ease;
}
.mobile-trade-card:active {
  transform: scale(0.985);
  background: rgba(30, 41, 59, 0.85);
}
