/* =========================================
   variables.css - Global Variables & Resets
   ========================================= */

:root {
  /* --- Colors (Enhanced) --- */
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-tertiary: #1a1a1d;
  --bg-elevated: #222226;
  --bg-modal: rgba(10, 10, 11, 0.95);

  --text-primary: #ffffff;
  --text-secondary: #a8a8b3;
  --text-tertiary: #6b6b7c;

  --accent-primary: #00dc82;
  --accent-secondary: #00b894;
  --accent-gradient: linear-gradient(135deg, #00dc82 0%, #00b894 100%);
  --accent-gradient-hover: linear-gradient(135deg, #00f590 0%, #00c9a0 100%);

  --blue-accent: #0ea5e9;
  --purple-accent: #a855f7;
  --orange-accent: #fb923c;
  --red-accent: #f43f5e;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.12);

  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);

  --disclaimer-text: rgba(255, 255, 255, 0.45);
  --disclaimer-line: rgba(255, 255, 255, 0.15);

  /* --- Animations --- */
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Shadows & Transitions --- */
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3);
  --shadow-glow: 0 0 40px rgba(0, 220, 130, 0.3);

  --transition-fast: 150ms var(--ease-out-expo);
  --transition-base: 300ms var(--ease-out-expo);
  --transition-slow: 500ms var(--ease-out-expo);
  --transition-spring: 600ms var(--ease-spring);

  /* --- Mobile Specific Dimensions --- */
  --mobile-header-height: 60px;
  --mobile-input-height: 56px;
  --safe-area-top: env(safe-area-inset-top);
  --safe-area-bottom: env(safe-area-inset-bottom);
  --safe-area-left: env(safe-area-inset-left);
  --safe-area-right: env(safe-area-inset-right);
}

/* Light Mode Override */
body.light-mode {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f5f5f5;
  --bg-elevated: #ffffff;
  --bg-modal: rgba(255, 255, 255, 0.98);
  --text-primary: #0a0a0b;
  --text-secondary: #6b6b7c;
  --text-tertiary: #9ca3af;
  --accent-primary: #00b894;
  --accent-secondary: #00a879;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 40px rgba(0, 184, 148, 0.2);
  --disclaimer-text: rgba(0, 0, 0, 0.45);
  --disclaimer-line: rgba(0, 0, 0, 0.1);
}

/* Global Resets */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family:
    "Plus Jakarta Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  transition: background-color var(--transition-slow);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Common Keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: var(--shadow-glow);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(0, 220, 130, 0.4);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg) scale(0.95);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

@keyframes bounceIn {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.3);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

@keyframes floatBackground {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  25% {
    transform: translateY(-20px) scale(1.02);
  }
  75% {
    transform: translateY(20px) scale(0.98);
  }
}

@keyframes gradientShift {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
    filter: hue-rotate(0deg);
  }
  33% {
    transform: rotate(120deg) scale(1.1);
    filter: hue-rotate(30deg);
  }
  66% {
    transform: rotate(240deg) scale(0.95);
    filter: hue-rotate(-30deg);
  }
}

/* =========================================
   Global Loader Styles
   ========================================= */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary); /* Uses your existing variable */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999; /* Kept very high to cover all modals */
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--transition-slow),
    visibility var(--transition-slow);
}

.global-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loader-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 1px;
  animation: pulse 2s infinite ease-in-out; /* Reusing your existing pulse animation */
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary); /* Uses your existing theme green */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-text {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
