﻿/* VirtexGate — Animation System */

:root {
  --glow-blue:   0 0 20px rgba(59,130,246,0.5), 0 0 60px rgba(59,130,246,0.15);
  --glow-green:  0 0 20px rgba(34,197,94,0.5),  0 0 60px rgba(34,197,94,0.15);
  --glow-red:    0 0 20px rgba(239,68,68,0.5),   0 0 40px rgba(239,68,68,0.15);
  --glow-orange: 0 0 20px rgba(249,115,22,0.5),  0 0 40px rgba(249,115,22,0.15);
  --glow-purple: 0 0 20px rgba(168,85,247,0.5),  0 0 40px rgba(168,85,247,0.15);
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(59,130,246,0.25);
  --surface-900: #050a18;
  --surface-100: #0d1f3c;
}

/* ─── Keyframes ─────────────────────────────────────────────── */

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-8px) rotate(3deg); }
  66%       { transform: translateY(-16px) rotate(-2deg); }
}

@keyframes shimmer {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(250%) skewX(-15deg); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(59,130,246,0.3); box-shadow: 0 0 10px rgba(59,130,246,0.1); }
  50%       { border-color: rgba(59,130,246,0.7); box-shadow: 0 0 25px rgba(59,130,246,0.3); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: var(--glow-blue); }
  50%       { box-shadow: 0 0 30px rgba(59,130,246,0.8), 0 0 80px rgba(59,130,246,0.3); }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.6; }
}

@keyframes rotateGradient {
  from { --gradient-angle: 0deg; }
  to   { --gradient-angle: 360deg; }
}

@keyframes drawLine {
  from { transform: scaleY(0); transform-origin: top; }
  to   { transform: scaleY(1); transform-origin: top; }
}

@keyframes checkDraw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}

@keyframes ringExpand {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes countdownPulse {
  0%, 100% { color: #f87171; text-shadow: 0 0 8px rgba(239,68,68,0.6); }
  50%       { color: #fca5a5; text-shadow: 0 0 20px rgba(239,68,68,0.9); }
}

@keyframes progressRing {
  from { stroke-dashoffset: 283; }
}

/* ─── Utility Classes ────────────────────────────────────────── */

/* Glassmorphism card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.glass-card:hover {
  border-color: rgba(59,130,246,0.5);
  box-shadow: var(--glow-blue);
  transform: translateY(-3px);
}

/* Primary CTA button with shimmer */
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2563eb, #3b82f6, #0ea5e9);
  background-size: 200% auto;
  color: #fff;
  font-weight: 600;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: box-shadow 0.3s ease, background-position 0.4s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: translateX(-100%) skewX(-15deg);
  pointer-events: none;
}
.btn-primary:hover {
  background-position: right center;
  box-shadow: var(--glow-blue);
  transform: translateY(-1px);
}
.btn-primary:hover::before {
  animation: shimmer 0.6s ease forwards;
}
.btn-primary:active {
  transform: translateY(0);
}

/* Outline button with glow border */
.btn-outline {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  color: #e2e8f0;
  font-weight: 600;
  border-radius: 0.75rem;
  border: 1px solid rgba(59,130,246,0.3);
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn-outline:hover {
  border-color: rgba(59,130,246,0.7);
  box-shadow: inset 0 0 20px rgba(59,130,246,0.05), var(--glow-blue);
  background: rgba(59,130,246,0.08);
  transform: translateY(-1px);
}

/* Glow text */
.glow-text {
  filter: drop-shadow(0 0 8px rgba(59,130,246,0.6));
}
.glow-text-green {
  filter: drop-shadow(0 0 8px rgba(34,197,94,0.6));
}

/* Scroll-reveal initial state (GSAP controls transition in) */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
}

/* Page transition overlay */
#page-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-900);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
}

/* Animated gradient border card (hero badge, etc.) */
.gradient-border {
  position: relative;
  border-radius: 9999px;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3b82f6, #0ea5e9, #22c55e, #3b82f6);
  background-size: 300% 100%;
  animation: gradientShift 3s ease infinite;
  z-index: -1;
}

/* Floating elements */
.animate-float  { animation: float 4s ease-in-out infinite; }
.animate-float-2 { animation: float 5s ease-in-out infinite 0.8s; }
.animate-float-3 { animation: float 6s ease-in-out infinite 1.6s; }
.animate-float-slow { animation: floatSlow 7s ease-in-out infinite; }

/* Background grid */
.bg-grid {
  background-image:
    linear-gradient(rgba(59,130,246,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridPulse 4s ease-in-out infinite;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #60a5fa, #0ea5e9, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Nav link hover underline slide */
.nav-link {
  position: relative;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, #3b82f6, #0ea5e9);
  transition: width 0.3s ease;
}
.nav-link:hover { color: #e2e8f0; }
.nav-link:hover::after { width: 100%; }

/* Navbar glassmorphism on scroll */
nav.scrolled {
  background: rgba(5,10,24,0.85) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-bottom-color: rgba(59,130,246,0.2) !important;
}

/* Form input glow focus */
.input-glow {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 0.5rem;
  color: #e2e8f0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}
.input-glow:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15), 0 0 12px rgba(59,130,246,0.2);
}
.input-glow::placeholder { color: #475569; }

/* Status badge glows */
.badge-paid    { box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.badge-pending { box-shadow: 0 0 8px rgba(234,179,8,0.4); }
.badge-expired { box-shadow: 0 0 8px rgba(239,68,68,0.4); }

/* Table row hover */
.table-row-hover {
  transition: background 0.2s ease, border-left-color 0.2s ease;
  border-left: 2px solid transparent;
}
.table-row-hover:hover {
  background: rgba(59,130,246,0.05);
  border-left-color: #3b82f6;
}

/* Coin card selection */
.coin-card {
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.coin-card.selected {
  border-color: #3b82f6 !important;
  box-shadow: var(--glow-blue);
  transform: translateY(-2px) scale(1.02);
}
.coin-card:hover:not(.selected) {
  border-color: rgba(59,130,246,0.4);
  transform: translateY(-2px);
}

/* QR code animated border */
.qr-container {
  position: relative;
}
.qr-container::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 1.25rem;
  background: linear-gradient(45deg, #3b82f6, #0ea5e9, #22c55e, #3b82f6);
  background-size: 400% 400%;
  animation: gradientShift 3s ease infinite;
  z-index: -1;
}

/* Countdown urgent */
.countdown-urgent {
  animation: countdownPulse 1s ease-in-out infinite;
}

/* Success checkmark */
.check-draw {
  stroke-dasharray: 100;
  animation: checkDraw 0.6s ease forwards 0.3s;
  stroke-dashoffset: 100;
}

/* Stat card accent borders */
.stat-card-blue   { border-left: 3px solid #3b82f6; }
.stat-card-green  { border-left: 3px solid #22c55e; }
.stat-card-purple { border-left: 3px solid #a855f7; }
.stat-card-orange { border-left: 3px solid #f97316; }

/* Animated timeline line */
.timeline-line {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1s ease;
}
.timeline-line.drawn {
  transform: scaleY(1);
}

/* Loading spinner ring */
.ring-spin {
  animation: spin-slow 1.5s linear infinite;
}

/* Page entrance animation */
.page-enter {
  animation: fadeInUp 0.5s ease forwards;
}

/* Spinning border ring for processing */
.processing-ring {
  border: 2px solid rgba(59,130,246,0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin-slow 1s linear infinite;
}

/* Copy button flash */
.copy-flash {
  animation: borderGlow 0.4s ease;
}

/* Hero section background */
.hero-bg {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59,130,246,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 60%, rgba(34,197,94,0.08) 0%, transparent 60%),
    #050a18;
}

/* Auth split panel gradient */
.auth-panel-bg {
  background:
    radial-gradient(ellipse 70% 60% at 30% 40%, rgba(59,130,246,0.2) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 70% 70%, rgba(34,197,94,0.1) 0%, transparent 60%),
    linear-gradient(135deg, #050a18 0%, #0a1628 100%);
}

/* Confetti particle container */
#success-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* ─── Mobile & Touch Improvements ───────────────────────────── */

/* Minimum 44 × 44 px touch targets (WCAG 2.5.8) */
.btn-primary,
.btn-outline {
  min-height: 44px;
  min-width: 44px;
}

/* Disable hover transforms on touch-only screens — prevents stuck hover */
@media (hover: none) and (pointer: coarse) {
  .glass-card:hover {
    transform: none;
    border-color: var(--glass-border);
    box-shadow: none;
  }
  .btn-primary:hover,
  .btn-outline:hover,
  .coin-card:hover:not(.selected) {
    transform: none;
  }
}

/* Scrollable table wrapper for mobile */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Safe-area bottom padding (iPhone notch / home bar) */
@supports (padding: max(0px)) {
  .safe-pb {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* On very small screens, reduce hero badge overflow */
@media (max-width: 480px) {
  .hero-badge-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }
  .hero-badge-coins {
    display: none;
  }
}

/* Mobile nav items need larger tap area */
#mobileMenu a,
#mobileMenu button {
  min-height: 44px;
}

/* Prevent horizontal overflow on narrow screens */
body {
  overflow-x: hidden;
}
