/* ═══════════════════════════════════════════════════════════════
   EARN00 — GLOBAL UI ENHANCEMENT SYSTEM
   Modern · Premium · Responsive · Animated
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─── */
:root {
  /* Core Palette */
  --gold-100: #FFFBEB;
  --gold-200: #FEF3C7;
  --gold-400: #FBBF24;
  --gold-500: #F59E0B;
  --gold-600: #D97706;
  --gold-700: #B45309;
  --gold-glow: rgba(251,191,36,0.25);
  --gold-glow-strong: rgba(251,191,36,0.45);
  
  /* Gradients */
  --grad-gold: linear-gradient(135deg, #FFD700 0%, #FF9100 100%);
  --grad-gold-soft: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,145,0,0.08));
  --grad-page: linear-gradient(180deg, #fafbfd 0%, #f4f6fa 100%);
  
  /* Surfaces */
  --surface-0: #FFFFFF;
  --surface-1: #FAFAFA;
  --surface-2: #F4F5F7;
  --surface-border: #EAECF0;
  --surface-border-soft: #F3F4F6;
  
  /* Text */
  --text-primary: #0A0A0F;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --text-dim: #9CA3AF;
  
  /* Status */
  --green: #10B981;
  --green-glow: rgba(16,185,129,0.2);
  --red: #EF4444;
  --red-glow: rgba(239,68,68,0.2);
  --blue: #3B82F6;
  --blue-glow: rgba(59,130,246,0.2);
  
  /* Elevation */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 4px 12px rgba(0,0,0,0.06);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.12);
  --shadow-xl:  0 24px 64px rgba(0,0,0,0.16);
  --shadow-gold: 0 8px 24px rgba(251,191,36,0.25);
  
  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;
  
  /* Typography */
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 9999px;
}

/* ─── Global Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  font-family: var(--font-sans);
  background: var(--grad-page);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════════
   PAGE LOADER — EARN00 BRANDED SPLASH
   ══════════════════════════════════════════════════ */
#earn00-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

#earn00-loader.hiding {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}

#earn00-loader.hidden {
  display: none;
}

.loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: loaderFadeUp 0.5s var(--ease-out) forwards;
}

.loader-logo {
  width: 72px;
  height: 72px;
  background: var(--grad-gold);
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  font-family: var(--font-display);
  box-shadow: 0 16px 40px rgba(251,191,36,0.45),
              inset 0 -3px 0 rgba(0,0,0,0.1);
  animation: logoPulse 2s ease-in-out infinite;
  letter-spacing: -1px;
}

.loader-name {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 3px;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.loader-name .gold {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.loader-tagline {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: -8px;
}

.loader-track {
  width: 180px;
  height: 3px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-top: 28px;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: var(--grad-gold);
  border-radius: var(--r-full);
  animation: loaderProgress 1.4s var(--ease-out) forwards;
  box-shadow: 0 0 12px var(--gold-glow-strong);
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 16px 40px rgba(251,191,36,0.4), inset 0 -3px 0 rgba(0,0,0,0.1); }
  50% { box-shadow: 0 16px 48px rgba(251,191,36,0.65), inset 0 -3px 0 rgba(0,0,0,0.1); }
}

@keyframes loaderFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loaderProgress {
  0% { width: 0%; }
  30% { width: 40%; }
  70% { width: 80%; }
  100% { width: 100%; }
}

/* ══════════════════════════════════════════════════
   PAGE TRANSITION OVERLAY (link click)
   ══════════════════════════════════════════════════ */
#page-transition {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

#page-transition.active {
  opacity: 1;
  pointer-events: auto;
}

.pt-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--surface-2);
  border-top-color: #FF9100;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ══════════════════════════════════════════════════
   GLOBAL CARD COMPONENT
   ══════════════════════════════════════════════════ */
.g-card {
  background: var(--surface-0);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}

.g-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.g-card-gold {
  background: linear-gradient(135deg, #FFFDF0, #FFFBEB);
  border-color: rgba(251,191,36,0.3);
  box-shadow: var(--shadow-gold);
}

/* ══════════════════════════════════════════════════
   STAT COUNTER CARDS
   ══════════════════════════════════════════════════ */
.stat-card {
  background: var(--surface-0);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-xl);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--dur-base) var(--ease-out);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-gold);
  opacity: 0;
  transition: opacity var(--dur-base);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.stat-icon.gold {
  background: linear-gradient(135deg, rgba(255,215,0,0.18), rgba(255,145,0,0.08));
  color: #FF9100;
  border: 1px solid rgba(255,199,0,0.25);
}

.stat-icon.green {
  background: rgba(16,185,129,0.1);
  color: #10B981;
  border: 1px solid rgba(16,185,129,0.2);
}

.stat-icon.blue {
  background: rgba(59,130,246,0.1);
  color: #3B82F6;
  border: 1px solid rgba(59,130,246,0.2);
}

.stat-icon.red {
  background: rgba(239,68,68,0.1);
  color: #EF4444;
  border: 1px solid rgba(239,68,68,0.2);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  font-family: var(--font-display);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.stat-change {
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.stat-change.up { color: #10B981; }
.stat-change.dn { color: #EF4444; }

/* ══════════════════════════════════════════════════
   PILL BADGES & TAGS
   ══════════════════════════════════════════════════ */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-pill.success  { background: rgba(16,185,129,0.12); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.badge-pill.danger   { background: rgba(239,68,68,0.1); color: #DC2626; border: 1px solid rgba(239,68,68,0.2); }
.badge-pill.warning  { background: rgba(251,191,36,0.15); color: #D97706; border: 1px solid rgba(251,191,36,0.25); }
.badge-pill.info     { background: rgba(59,130,246,0.1); color: #2563EB; border: 1px solid rgba(59,130,246,0.2); }
.badge-pill.neutral  { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--surface-border); }
.badge-pill.hot      { background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.06)); color: #DC2626; border: 1px solid rgba(239,68,68,0.22); }
.badge-pill.new      { background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.06)); color: #2563EB; border: 1px solid rgba(59,130,246,0.22); }
.badge-pill.gold     { background: var(--grad-gold); color: #0A0A0F; border: none; box-shadow: 0 3px 10px var(--gold-glow); }

/* ══════════════════════════════════════════════════
   BUTTONS — UNIFIED SYSTEM
   ══════════════════════════════════════════════════ */
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--grad-gold);
  color: #0A0A0F;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  border: none;
  border-radius: var(--r-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-base) var(--ease-out);
  box-shadow: 0 6px 20px var(--gold-glow);
  position: relative;
  overflow: hidden;
}

.btn-gold::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 100%);
  pointer-events: none;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--gold-glow-strong);
  filter: brightness(1.04);
  color: #0A0A0F;
}

.btn-gold:active { transform: translateY(0); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-display);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-base) var(--ease-out);
}

.btn-outline:hover {
  border-color: rgba(251,191,36,0.5);
  background: var(--gold-100);
  color: var(--text-primary);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #EF4444;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--font-display);
  border: none;
  border-radius: var(--r-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-base) var(--ease-out);
  box-shadow: 0 6px 20px rgba(239,68,68,0.3);
}

.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(239,68,68,0.4); filter: brightness(1.05); color: #fff; }

/* ══════════════════════════════════════════════════
   INPUT FIELDS — MODERN
   ══════════════════════════════════════════════════ */
.input-modern {
  width: 100%;
  background: #FAFAFA;
  border: 1.5px solid var(--surface-border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  transition: all var(--dur-base) var(--ease-out);
  outline: none;
}

.input-modern:focus {
  border-color: #F59E0B;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(251,191,36,0.12);
}

.input-modern::placeholder {
  color: var(--text-dim);
}

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 var(--gold-glow-strong); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

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

/* Apply animation classes */
.animate-fade-up   { animation: fadeInUp   0.5s var(--ease-out) both; }
.animate-fade-in   { animation: fadeIn     0.4s ease both; }
.animate-scale-in  { animation: scaleIn    0.4s var(--ease-out) both; }
.animate-slide-left { animation: slideInLeft 0.5s var(--ease-out) both; }

/* Staggered children */
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 60ms; }
.stagger-children > *:nth-child(3) { animation-delay: 120ms; }
.stagger-children > *:nth-child(4) { animation-delay: 180ms; }
.stagger-children > *:nth-child(5) { animation-delay: 240ms; }
.stagger-children > *:nth-child(6) { animation-delay: 300ms; }

/* ══════════════════════════════════════════════════
   SKELETON LOADING
   ══════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 0px,
    #fff 40%,
    var(--surface-2) 80%
  );
  background-size: 1000px 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--r-md);
}

/* ══════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════ */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: #D1D5DB; }

/* ══════════════════════════════════════════════════
   GLASS MORPHISM PANELS
   ══════════════════════════════════════════════════ */
.glass-panel {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
}

/* ══════════════════════════════════════════════════
   GAME CONTAINER — AVIATOR + QUICK TRADE ENHANCED
   ══════════════════════════════════════════════════ */
.game-shell {
  background: #0A0A0F;
  border-radius: var(--r-2xl);
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  box-shadow: 
    0 32px 80px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.game-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 14px 20px;
}

/* ══════════════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════════════ */
.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--grad-gold);
  border-radius: var(--r-full);
  transition: width 0.3s var(--ease-out);
  box-shadow: 0 0 10px var(--gold-glow);
}

.progress-bar-fill.green {
  background: linear-gradient(90deg, #10B981, #059669);
  box-shadow: 0 0 10px var(--green-glow);
}

.progress-bar-fill.red {
  background: linear-gradient(90deg, #EF4444, #DC2626);
  box-shadow: 0 0 10px var(--red-glow);
}

/* ══════════════════════════════════════════════════
   TABLE MODERN
   ══════════════════════════════════════════════════ */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-sans);
}

.table-modern thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-border);
  white-space: nowrap;
  background: var(--surface-1);
}

.table-modern tbody td {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-border-soft);
  transition: background var(--dur-fast);
}

.table-modern tbody tr:hover td {
  background: var(--gold-100);
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

/* ══════════════════════════════════════════════════
   NOTIFICATION TOASTS
   ══════════════════════════════════════════════════ */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.g-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #0A0A0F;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-lg);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  min-width: 260px;
  max-width: 360px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation: slideInRight 0.35s var(--ease-out) both,
             fadeOut 0.35s var(--ease-out) forwards;
  animation-delay: 0s, 3.5s;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

.g-toast-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.g-toast.success .g-toast-icon { background: rgba(16,185,129,0.2); color: #10B981; }
.g-toast.error   .g-toast-icon { background: rgba(239,68,68,0.2);  color: #EF4444; }
.g-toast.info    .g-toast-icon { background: rgba(59,130,246,0.2); color: #60A5FA; }
.g-toast.warn    .g-toast-icon { background: rgba(251,191,36,0.2); color: #FBBF24; }

/* ══════════════════════════════════════════════════
   RESPONSIVE UTILITY
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .toast-stack { bottom: 16px; right: 12px; left: 12px; }
  .g-toast { min-width: unset; max-width: 100%; }
}

@media (max-width: 576px) {
  .stat-value { font-size: 1.35rem; }
}

/* ══════════════════════════════════════════════════
   TRADING PAGE SPECIFIC ENHANCEMENTS
   ══════════════════════════════════════════════════ */
.trade-win-flash {
  animation: winFlash 0.8s var(--ease-out);
}

.trade-loss-flash {
  animation: lossFlash 0.8s var(--ease-out);
}

@keyframes winFlash {
  0%   { background: rgba(16,185,129,0.3); }
  100% { background: transparent; }
}

@keyframes lossFlash {
  0%   { background: rgba(239,68,68,0.3); }
  100% { background: transparent; }
}

/* Candlestick / price ticker glow effects */
.price-up { color: #10B981 !important; text-shadow: 0 0 20px rgba(16,185,129,0.5); }
.price-dn { color: #EF4444 !important; text-shadow: 0 0 20px rgba(239,68,68,0.5); }

/* Live dot */
.live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 0 rgba(16,185,129,0.4);
  animation: livePulse 2s ease-in-out infinite;
  display: inline-block;
}

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  70%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

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