/* Excalibur Data Solutions - Animations & Visual Effects */

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

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

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

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

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(218, 165, 32, 0.6), 0 0 30px rgba(218, 165, 32, 0.4);
  }
}

@keyframes titleGlow {
  0%, 100% {
    text-shadow: 0 0 10px rgba(240, 230, 140, 0.3);
  }
  50% {
    text-shadow: 0 0 20px rgba(240, 230, 140, 0.5), 0 0 30px rgba(240, 230, 140, 0.3);
  }
}

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

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

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

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation Classes */
.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

.animate-bounce-in {
  animation: bounceIn 0.8s ease-out forwards;
}

.animate-slide-in-top {
  animation: slideInFromTop 0.6s ease-out forwards;
}

/* Continuous Animations */
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

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

.animate-rotate {
  animation: rotate 2s linear infinite;
}

/* Hover Effects */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(218, 165, 32, 0.4);
}

.hover-shimmer {
  position: relative;
  overflow: hidden;
}

.hover-shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.hover-shimmer:hover::before {
  transform: translateX(100%);
}

/* Loading Animations */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-gold);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-gold);
  animation: pulse 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

/* Stagger Animation Delays */
.stagger-1 {
  animation-delay: 0.1s;
}

.stagger-2 {
  animation-delay: 0.2s;
}

.stagger-3 {
  animation-delay: 0.3s;
}

.stagger-4 {
  animation-delay: 0.4s;
}

.stagger-5 {
  animation-delay: 0.5s;
}

/* Reactive Visual Effects */
.reactive-bg {
  position: relative;
  overflow: hidden;
}

.reactive-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(218, 165, 32, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.reactive-bg:hover::before {
  opacity: 1;
}

/* Parallax Effect */
.parallax-element {
  transform: translateZ(0);
  transition: transform 0.1s ease-out;
}

/* Scroll Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Text Effects */
.text-gradient {
  background: linear-gradient(45deg, var(--primary-gold), var(--secondary-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--text-primary) 0%,
    var(--primary-gold) 50%,
    var(--text-primary) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2s ease-in-out infinite;
}

/* Button Animations */
.btn-animated {
  position: relative;
  overflow: hidden;
}

.btn-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-animated:hover::before {
  left: 100%;
}

/* Card Animations */
.card-flip {
  perspective: 1000px;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
  transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
}

.card-flip-back {
  transform: rotateY(180deg);
}

/* Navigation Animations */
.nav-slide-in {
  transform: translateY(-100%);
  animation: slideInFromTop 0.5s ease-out forwards;
}

/* Form Animations */
.form-focus-effect {
  position: relative;
}

.form-focus-effect::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-gold);
  transition: width 0.3s ease, left 0.3s ease;
}

.form-focus-effect:focus-within::after {
  width: 100%;
  left: 0;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .animate-fade-in-up,
  .animate-fade-in-left,
  .animate-fade-in-right,
  .animate-scale-in,
  .animate-bounce-in {
    animation-duration: 0.6s;
  }
  
  .hover-lift:hover {
    transform: translateY(-2px);
  }
  
  .hover-scale:hover {
    transform: scale(1.02);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .animate-pulse,
  .animate-glow,
  .animate-float,
  .animate-rotate,
  .loading-spinner,
  .loading-dots span {
    animation: none;
  }
  
  .hover-lift,
  .hover-scale,
  .parallax-element {
    transition: none;
  }
  
  .scroll-reveal {
    opacity: 1;
    transform: none;
  }
}

/* Performance Optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.animate-fade-in-up,
.animate-fade-in-left,
.animate-fade-in-right,
.animate-scale-in,
.animate-bounce-in,
.animate-slide-in-top {
  will-change: opacity, transform;
}

.animate-fade-in-up.animation-complete,
.animate-fade-in-left.animation-complete,
.animate-fade-in-right.animation-complete,
.animate-scale-in.animation-complete,
.animate-bounce-in.animation-complete,
.animate-slide-in-top.animation-complete {
  will-change: auto;
}