/* ============================================================
   GLOBALS.CSS — Design System & Base Styles
   DerivPro Trading Platform
   ============================================================ */

/* ---- Google Fonts fallback ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Colors — Base */
  --bg-base:        #09090f;
  --bg-surface:     #0f0f1a;
  --bg-elevated:    #141424;
  --bg-card:        rgba(255, 255, 255, 0.030);
  --bg-card-hover:  rgba(255, 255, 255, 0.055);

  /* Colors — Accent */
  --accent-orange:  #f97316;
  --accent-orange-dim: rgba(249, 115, 22, 0.15);
  --accent-orange-glow: rgba(249, 115, 22, 0.35);
  --accent-purple:  #8b5cf6;
  --accent-purple-dim: rgba(139, 92, 246, 0.15);
  --accent-purple-glow: rgba(139, 92, 246, 0.35);
  --accent-green:   #22c55e;
  --accent-green-dim: rgba(34, 197, 94, 0.15);
  --accent-blue:    #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.15);
  --accent-red:     #ef4444;
  --accent-red-dim: rgba(239, 68, 68, 0.15);

  /* Colors — Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --text-accent:    #f97316;

  /* Colors — Border */
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-strong:  rgba(255, 255, 255, 0.18);

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #f97316 0%, #8b5cf6 100%);
  --grad-brand-subtle: linear-gradient(135deg, rgba(249,115,22,0.15) 0%, rgba(139,92,246,0.15) 100%);
  --grad-surface: linear-gradient(180deg, #0f0f1a 0%, #09090f 100%);

  /* Sidebar */
  --sidebar-width:       240px;
  --sidebar-width-collapsed: 64px;
  --sidebar-bg:          #0c0c18;
  --sidebar-border:      rgba(255, 255, 255, 0.06);

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

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  28px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow-orange: 0 0 24px rgba(249, 115, 22, 0.25);
  --shadow-glow-purple: 0 0 24px rgba(139, 92, 246, 0.25);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }
img, svg { display: block; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---- Selection ---- */
::selection { background: var(--accent-orange-dim); color: var(--accent-orange); }

/* ---- Focus visible ---- */
:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Utility: Glow text ---- */
.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse-ring {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 var(--accent-orange-glow); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 12px rgba(249,115,22,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}

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

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slide-out-right {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

@keyframes price-flash-up {
  0%   { color: var(--text-primary); }
  50%  { color: var(--accent-green); }
  100% { color: var(--text-primary); }
}

@keyframes price-flash-down {
  0%   { color: var(--text-primary); }
  50%  { color: var(--accent-red); }
  100% { color: var(--text-primary); }
}

.flash-up   { animation: price-flash-up   600ms ease; }
.flash-down { animation: price-flash-down 600ms ease; }

/* ---- Glass card mixin ---- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ---- Responsive breakpoints ---- */
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 240px; }
}
