/**
 * effects.css - Reusable Visual Effect Utilities
 *
 * These classes can be applied anywhere in the system for consistent
 * visual effects and animations.
 */

/* ==========================================================================
   A. ELEVATED SECTION (Solid bg sections floating above orbs)
   ========================================================================== */

/* Apply to sections with solid backgrounds to create depth over orb layer */
.section-elevated {
  box-shadow:
    0 -30px 60px -15px rgba(0, 0, 0, 0.6),
    0 30px 60px -15px rgba(0, 0, 0, 0.6);
}

/* Subtle version */
.section-elevated-subtle {
  box-shadow:
    0 -20px 40px -10px rgba(0, 0, 0, 0.4),
    0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   B. FLOATING GRADIENT ORBS (Background Decoration)
   ========================================================================== */

/* Full-page orb layer - spans entire viewport, no clipping */
.page-orbs-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Individual floating orbs */
.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  animation: float-organic 25s ease-in-out infinite;
}

.floating-orb-1 {
  width: 600px;
  height: 600px;
  background: var(--primary-500);
  top: 10%;
  right: -200px;
}

.floating-orb-2 {
  width: 500px;
  height: 500px;
  background: var(--info-500);
  top: 40%;
  left: -150px;
  animation-delay: -8s;
}

.floating-orb-3 {
  width: 400px;
  height: 400px;
  background: var(--primary-400);
  bottom: 10%;
  right: 20%;
  animation-delay: -16s;
}

/* Subtle orbs for logged-in pages (8% opacity - professional, data-focused) */
.page-orbs-container.orbs-subtle .floating-orb {
  opacity: 0.08;
}

/* DEPRECATED: Per-section orbs (kept for backwards compatibility) */
.bg-gradient-orbs {
  position: relative;
  overflow: hidden;
}

.bg-gradient-orbs::before,
.bg-gradient-orbs::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.bg-gradient-orbs::before {
  width: 400px;
  height: 400px;
  background: var(--primary-500);
  top: -200px;
  right: -100px;
  animation: float-slow 20s ease-in-out infinite;
}

.bg-gradient-orbs::after {
  width: 300px;
  height: 300px;
  background: var(--info-500);
  bottom: -150px;
  left: -100px;
  animation: float-slow 25s ease-in-out infinite reverse;
}

/* Variant: orbs positioned differently */
.bg-gradient-orbs-alt::before {
  top: 50%;
  right: -150px;
  transform: translateY(-50%);
}

.bg-gradient-orbs-alt::after {
  bottom: auto;
  top: -100px;
  left: 20%;
}

/* ==========================================================================
   B. SCROLL-TRIGGERED ANIMATIONS (Intersection Observer)
   ========================================================================== */

/* Fade in on scroll - elements start invisible */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide in from left */
.animate-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-slide-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide in from right */
.animate-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-slide-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale in */
.animate-scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-scale-in.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   C. STAGGERED GRID ANIMATIONS
   ========================================================================== */

/* Apply to grid container, children get staggered delays */
.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 100ms; }
.stagger-children > *:nth-child(3) { transition-delay: 200ms; }
.stagger-children > *:nth-child(4) { transition-delay: 300ms; }
.stagger-children > *:nth-child(5) { transition-delay: 400ms; }
.stagger-children > *:nth-child(6) { transition-delay: 500ms; }
.stagger-children > *:nth-child(7) { transition-delay: 600ms; }
.stagger-children > *:nth-child(8) { transition-delay: 700ms; }

/* Auto-animate children of stagger-animate container */
.stagger-animate > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.stagger-animate.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Reset delay after entrance animation so hover effects are instant */
.stagger-children.is-visible > *,
.stagger-animate.is-visible > * {
  transition-delay: 0ms !important;
}

/* ==========================================================================
   D. ANIMATED GRADIENT BORDERS
   ========================================================================== */

/* Gradient border with animation */
.border-gradient-animated {
  position: relative;
  background: var(--surface-raised);
  border-radius: 12px;
}

.border-gradient-animated::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary-500), var(--info-500), var(--primary-500));
  background-size: 200% 200%;
  animation: gradient-rotate 4s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

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

/* Static gradient border (no animation) */
.border-gradient {
  position: relative;
  background: var(--surface-raised);
  border-radius: 12px;
}

.border-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary-500), var(--info-500));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Gradient border on hover - apply to cards */
.hover-gradient-border {
  position: relative;
}

.hover-gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--info-500), var(--primary-500), var(--info-500));
  background-size: 200% 200%;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hover-gradient-border:hover::before {
  opacity: 1;
  animation: gradient-rotate 3s linear infinite;
}

/* ==========================================================================
   E. FLOATING/BOBBING ANIMATIONS
   ========================================================================== */

/* Gentle float for hero elements, stats cards, etc. */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 6s ease-in-out infinite;
  animation-delay: -3s;
}

.animate-float-slow {
  animation: float 8s ease-in-out infinite;
}

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

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(20px, -20px); }
  50% { transform: translate(0, -30px); }
  75% { transform: translate(-20px, -10px); }
}

/* More organic floating for full-page orbs */
@keyframes float-organic {
  0% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, -60px) scale(0.95); }
  75% { transform: translate(-40px, -20px) scale(1.02); }
  100% { transform: translate(0, 0) scale(1); }
}

/* ==========================================================================
   F. GLOW PULSE EFFECTS
   ========================================================================== */

/* Pulsing glow for CTAs or highlights */
.glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(var(--brand-a-rgb, 121, 0, 201), 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(var(--brand-a-rgb, 121, 0, 201), 0.6);
  }
}

/* Text glow */
.text-glow {
  text-shadow: 0 0 20px rgba(var(--brand-a-rgb, 121, 0, 201), 0.5);
}

/* Icon glow on hover */
.hover-glow {
  transition: filter 0.3s ease;
}

.hover-glow:hover {
  filter: drop-shadow(0 0 10px rgba(var(--brand-a-rgb, 121, 0, 201), 0.6));
}

/* ==========================================================================
   G. PARALLAX DEPTH (CSS-only with perspective)
   ========================================================================== */

/* Apply to container */
.parallax-container {
  perspective: 1000px;
  transform-style: preserve-3d;
}

/* Elements move at different speeds on hover */
.parallax-slow {
  transition: transform 0.3s ease-out;
}

.parallax-container:hover .parallax-slow {
  transform: translateZ(20px);
}

.parallax-fast {
  transition: transform 0.3s ease-out;
}

.parallax-container:hover .parallax-fast {
  transform: translateZ(40px);
}

/* ==========================================================================
   H. GRADIENT TEXT ANIMATION
   ========================================================================== */

.gradient-text-animate {
  background: linear-gradient(90deg, var(--primary-500), var(--info-500), var(--primary-500));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 12s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

/* ==========================================================================
   I. CARD HOVER ENHANCEMENTS
   ========================================================================== */

/* Lift effect on hover */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Border glow on hover */
.hover-border-glow {
  transition: box-shadow 0.3s ease;
}

.hover-border-glow:hover {
  box-shadow: 0 0 0 1px var(--primary-500), 0 0 20px rgba(var(--brand-a-rgb, 121, 0, 201), 0.3);
}

/* ==========================================================================
   J. HERO DASHBOARD ANIMATIONS
   ========================================================================== */

/* Chart bar grow animation - bars grow from bottom */
.hero-chart-bar {
  transform: scaleY(0);
  transform-origin: bottom;
  animation: heroChartGrow 0.8s ease-out forwards;
}

@keyframes heroChartGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

/* Trade card slide-in animation */
.hero-trade-card {
  opacity: 0;
  transform: translateX(30px);
  animation: heroTradeSlide 0.5s ease-out forwards;
}

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

/* Stats card pop-in animation */
.hero-stat-card {
  animation: heroStatPop 0.6s ease-out forwards, float 6s ease-in-out infinite 0.6s;
}

@keyframes heroStatPop {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ==========================================================================
   K. ACCESSIBILITY - Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .animate-slide-left,
  .animate-slide-right,
  .animate-scale-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .animate-float,
  .animate-float-delayed,
  .animate-float-slow,
  .glow-pulse,
  .gradient-text-animate {
    animation: none;
  }

  .bg-gradient-orbs::before,
  .bg-gradient-orbs::after,
  .border-gradient-animated::before {
    animation: none;
  }

  .floating-orb {
    animation: none;
  }

  .hover-gradient-border::before {
    animation: none;
    transition: none;
  }

  .hover-lift:hover {
    transform: none;
  }

  /* Hero animations */
  .hero-chart-bar,
  .hero-trade-card,
  .hero-stat-card {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ==========================================================================
   K. CAROUSEL TRANSITIONS (Hero Stock Card)
   ========================================================================== */

/* Vue transition for carousel slide effect */
.carousel-enter-active,
.carousel-leave-active {
  transition: all 0.4s ease;
}

.carousel-enter-from {
  opacity: 0;
  transform: translateX(20px);
}

.carousel-leave-to {
  opacity: 0;
  transform: translateX(-20px);
}

/* Floating animation for glow effects */
.animate-float {
  animation: float-organic 25s ease-in-out infinite;
}

.animate-float-delay-1 {
  animation-delay: -8s;
}

/* ==========================================================================
   L. HERO FLOATING SCREENSHOTS (GitKraken-style)
   ========================================================================== */

/* Hero floating card animation - gentle bob with subtle rotation */
@keyframes heroFloat {
  0%, 100% {
    transform: translateY(0) rotate(var(--hero-rotate, 1deg));
  }
  50% {
    transform: translateY(-12px) rotate(var(--hero-rotate, 1deg));
  }
}

/* Hero card styling */
.hero-float-card {
  transition: transform 0.5s ease, box-shadow 0.3s ease;
}

.hero-float-card:hover {
  z-index: 30 !important;
}

/* Enhanced glow on hover for hero cards */
.hero-float-card:hover > div {
  box-shadow: 0 30px 100px -15px rgba(124, 77, 255, 0.35) !important;
}

/* Reduced motion - disable hero float */
@media (prefers-reduced-motion: reduce) {
  .hero-float-card {
    animation: none !important;
  }
}

/* ==========================================================================
   M. GLASS BACKGROUND EFFECT (No border override)
   ========================================================================== */

/* Glass background only - use when you want glass effect but keep existing borders */
.glass-bg {
  background: rgba(20, 20, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Glass background with subtle shadow */
.glass-bg-shadow {
  background: rgba(20, 20, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
