/* ==================== DESIGN SYSTEM AVANÇADO ==================== */
/* Inspirado em designs modernos de fintech e trading platforms */

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

:root {
  /* ==================== PALETA DE CORES MODERNA ==================== */
  /* Cores primárias - Inspirado em Treva/fintech moderno */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --primary-950: #172554;

  /* Cores de acento - Gradientes modernos */
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-violet: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;

  /* Cores de status */
  --success-50: #ecfdf5;
  --success-500: #10b981;
  --success-600: #059669;
  --success-900: #064e3b;
  
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-900: #78350f;
  
  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-900: #7f1d1d;

  /* Cores neutras - Sistema escuro moderno */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  --neutral-950: #020617;

  /* Backgrounds com gradientes */
  --bg-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --bg-secondary: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  --bg-card: rgba(30, 41, 59, 0.8);
  --bg-glass: rgba(248, 250, 252, 0.05);
  --bg-glass-strong: rgba(248, 250, 252, 0.1);

  /* Gradientes especiais */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  --gradient-glow: linear-gradient(135deg, #3b82f6 0%, #06b6d4 50%, #8b5cf6 100%);

  /* ==================== TIPOGRAFIA ==================== */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Escala tipográfica */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */

  /* Pesos de fonte */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  --font-black: 900;

  /* ==================== ESPAÇAMENTOS ==================== */
  --space-px: 1px;
  --space-0: 0;
  --space-1: 0.25rem;     /* 4px */
  --space-2: 0.5rem;      /* 8px */
  --space-3: 0.75rem;     /* 12px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;     /* 20px */
  --space-6: 1.5rem;      /* 24px */
  --space-8: 2rem;        /* 32px */
  --space-10: 2.5rem;     /* 40px */
  --space-12: 3rem;       /* 48px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */

  /* ==================== BORDAS E RAIOS ==================== */
  --radius-none: 0;
  --radius-sm: 0.125rem;   /* 2px */
  --radius-base: 0.25rem;  /* 4px */
  --radius-md: 0.375rem;   /* 6px */
  --radius-lg: 0.5rem;     /* 8px */
  --radius-xl: 0.75rem;    /* 12px */
  --radius-2xl: 1rem;      /* 16px */
  --radius-3xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* ==================== SOMBRAS ==================== */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
  --shadow-glow-strong: 0 0 40px rgba(59, 130, 246, 0.5);

  /* ==================== TRANSIÇÕES ==================== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ==================== Z-INDEX ==================== */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;

  /* ==================== TEMA NEON (VERDE / PRETO / BRANCO) ==================== */
  /* Paleta dedicada para o tema solicitado (sem substituir as existentes) */
  --neon-green: #39ff14;               /* Verde neon principal */
  --neon-green-600: #1bff00;           /* Variante um pouco mais escura para contraste */
  --neon-glow: rgba(57, 255, 20, 0.35);/* Glow suave em torno de elementos neon */
  --neon-black: #0a0a0a;               /* Preto profundo usado em fundos e bordas */
  --neon-white: #ffffff;               /* Branco puro para textos/ícones */

  /* Gradientes e sombras para o tema neon */
  --gradient-neon: linear-gradient(135deg, #0a0a0a 0%, #111111 30%, #151515 60%, #1a1a1a 100%);
  --gradient-neon-green: linear-gradient(135deg, var(--neon-green) 0%, var(--neon-green-600) 100%);
  --shadow-neon: 0 0 24px var(--neon-glow);
}

/* ==================== TEMA NEON GLOBAL ==================== */
/* Ativa substituição dos tokens principais para o padrão verde/preto */
.theme-neon {
  /* Paleta primária assume verde neon */
  --primary-500: var(--neon-green);
  --primary-600: var(--neon-green-600);
  --primary-700: #17cc00;
  --primary-800: #119900;
  --primary-900: #0c6f00;

  /* Gradientes e sombras passam a usar neon */
  --gradient-primary: var(--gradient-neon-green);
  --shadow-glow: var(--shadow-neon);

  /* Fundos principais escurecidos com gradiente neon */
  --bg-primary: var(--gradient-neon);
  --bg-secondary: var(--gradient-neon);
}

/* Ajustes de componentes sob o tema neon */
.theme-neon .glass-card:hover {
  border-color: var(--neon-glow);
}

.theme-neon .gradient-text {
  background: var(--gradient-neon-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-neon .text-glow {
  text-shadow: 0 0 20px var(--neon-glow);
}

.theme-neon .border-glow {
  border: 1px solid var(--neon-glow);
  box-shadow: 0 0 20px var(--neon-glow);
}

@keyframes pulse-glow-neon {
  0%, 100% {
    box-shadow: 0 0 20px var(--neon-glow);
  }
  50% {
    box-shadow: 0 0 40px rgba(57, 255, 20, 0.6);
  }
}

.theme-neon .pulse-glow {
  animation: pulse-glow-neon 2s ease-in-out infinite;
}

/* ==================== RESET MODERNO ==================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-family: var(--font-sans);
  font-feature-settings: normal;
  font-variation-settings: normal;
}

body {
  line-height: inherit;
  background: var(--bg-primary);
  color: var(--neutral-50);
  font-family: var(--font-sans);
  font-weight: var(--font-normal);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== COMPONENTES BASE ==================== */

/* Glassmorphism Card */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(248, 250, 252, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  background: var(--bg-glass-strong);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* Gradient Button */
.btn-gradient {
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-weight: var(--font-semibold);
  padding: var(--space-3) var(--space-6);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.btn-gradient:hover::before {
  left: 100%;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Animated Border */
.animated-border {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  padding: var(--space-1);
}

.animated-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: var(--gradient-glow);
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

/* Floating Animation */
.floating {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Pulse Animation */
.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
  }
}

/* Gradient Text */
.gradient-text {
  background: var(--gradient-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: var(--font-bold);
}

/* Utility Classes */
.text-glow {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.backdrop-blur {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.border-glow {
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --space-4: 0.75rem;
    --space-6: 1rem;
    --space-8: 1.5rem;
  }
}

/* ==================== EFEITOS MODERNOS PARA CARDS (CSS-only) ==================== */
/* Shine Border: brilho sutil correndo pela borda usando máscara */
.effect-shine-border {
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
}
.effect-shine-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.0), rgba(255,255,255,0.25), rgba(255,255,255,0.0));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  animation: effectShine 5s linear infinite;
  pointer-events: none;
}
@keyframes effectShine {
  0% { transform: rotate(0deg); opacity: 0.8; }
  50% { opacity: 0.4; }
  100% { transform: rotate(360deg); opacity: 0.8; }
}

/* Border Beam: feixe de luz percorrendo a borda com gradiente */
.effect-border-beam {
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
}
.effect-border-beam::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from 0deg, rgba(59,130,246,0.8), rgba(16,185,129,0.8), rgba(139,92,246,0.8), rgba(236,72,153,0.8), rgba(245,158,11,0.8), rgba(59,130,246,0.8));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  filter: blur(0.6px);
  animation: beamRotate 8s linear infinite;
  opacity: 0.35;
  pointer-events: none;
}
@keyframes beamRotate { to { transform: rotate(360deg); } }

/* Glow Card: leve pulsação de glow usando box-shadow */
.effect-glow-card {
  border-radius: var(--radius-xl);
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: box-shadow var(--transition-normal), transform var(--transition-fast);
}
.effect-glow-card:hover {
  box-shadow: 0 12px 24px rgba(0,0,0,0.22), 0 0 18px rgba(59,130,246,0.25);
  transform: translateY(-2px);
}
.effect-glow-card.effect-success:hover {
  box-shadow: 0 12px 24px rgba(0,0,0,0.22), 0 0 18px rgba(16,185,129,0.25);
}

/* Meteors: linhas diagonais sutis animadas (GPU-friendly) */
.effect-meteors {
  position: relative;
  overflow: hidden;
}
.effect-meteors::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: repeating-linear-gradient(130deg,
    rgba(255,255,255,0.0) 0px,
    rgba(255,255,255,0.0) 48px,
    rgba(59,130,246,0.12) 52px,
    rgba(255,255,255,0.0) 60px
  );
  transform: translateZ(0);
  will-change: transform;
  animation: meteorDrift 18s linear infinite;
  opacity: 0.15;
  pointer-events: none;
}
@keyframes meteorDrift {
  0% { transform: translate3d(0,0,0) rotate(0.001deg); }
  100% { transform: translate3d(20px,20px,0) rotate(0.001deg); }
}

/* Respeito a usuários com movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .effect-shine-border::before,
  .effect-border-beam::after,
  .effect-meteors::before {
    animation: none !important;
  }
}

/* ==================== MICROINTERAÇÕES DISCRETAS ==================== */
@media (prefers-reduced-motion: no-preference) {
  /* Pequena ênfase quando um valor é atualizado */
  .value-tick {
    animation: valueTick 600ms ease;
  }
  @keyframes valueTick {
    0% { transform: scale(1); filter: brightness(1); }
    30% { transform: scale(1.02); filter: brightness(1.08); }
    100% { transform: scale(1); filter: brightness(1); }
  }

  /* Realce sutil ao mudar o status (Executando/Parado) */
  .status-flash {
    animation: statusFlash 500ms ease;
  }
  @keyframes statusFlash {
    0% { color: var(--accent-color); }
    100% { color: inherit; }
  }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

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