/* ===================================
   Quadracom Animations CSS
   GSAP & CSS Animation Styles
   =================================== */

/* ===================================
   Base Animation Classes
   =================================== */

/* Elements to be animated by GSAP */
/* Content is visible by default - JavaScript will handle hiding/animating */
.animate-fade-in {
  /* Visible by default - JS will animate if available */
}

.animate-slide-up {
  /* Visible by default - JS will animate if available */
}

.animate-slide-down {
  /* Visible by default - JS will animate if available */
}

.animate-slide-left {
  /* Visible by default - JS will animate if available */
}

.animate-slide-right {
  /* Visible by default - JS will animate if available */
}

.animate-scale-in {
  /* Visible by default - JS will animate if available */
}

.animate-rotate-in {
  /* Visible by default - JS will animate if available */
}

/* Stagger animations for children */
.stagger-children > * {
  /* Visible by default - JS will animate if available */
}

/* ===================================
   Hover Animations
   =================================== */

.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-8px);
}

.hover-scale {
  transition: transform var(--transition-base);
}

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

.hover-tilt {
  transition: transform var(--transition-base);
}

.hover-tilt:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.hover-glow {
  position: relative;
  transition: all var(--transition-base);
}

.hover-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-accent);
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
  filter: blur(10px);
}

.hover-glow:hover::before {
  opacity: 0.7;
}

/* Underline animation for links */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: width var(--transition-base);
}

.link-underline:hover::after {
  width: 100%;
}

/* Icon animations on hover */
.icon-rotate:hover {
  animation: rotate 0.6s ease-in-out;
}

.icon-bounce:hover {
  animation: bounce 0.6s ease-in-out;
}

.icon-pulse:hover {
  animation: pulse 0.6s ease-in-out;
}

.icon-shake:hover {
  animation: shake 0.5s ease-in-out;
}

/* ===================================
   Keyframe Animations
   =================================== */

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

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

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

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

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

@keyframes slideInRight {
  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 float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

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

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

/* ===================================
   Loading Animations
   =================================== */

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

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

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

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

@keyframes loading-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--neutral-light);
  border-top-color: var(--primary-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===================================
   Parallax Effects
   =================================== */

.parallax {
  position: relative;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.parallax-layer {
  position: relative;
  will-change: transform;
}

/* ===================================
   Hero Section Animations
   =================================== */

.hero-content {
  animation: fadeIn 1s ease-out;
}

.hero-title {
  animation: slideInUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
  animation: slideInUp 0.8s ease-out 0.4s both;
}

.hero-cta {
  animation: slideInUp 0.8s ease-out 0.6s both;
}

.hero-image {
  animation: scaleIn 1s ease-out 0.3s both;
}

/* Floating animation for hero elements */
.floating {
  animation: float 6s ease-in-out infinite;
}

/* Gradient animation for backgrounds */
.animated-gradient {
  background: linear-gradient(270deg, var(--primary-deep-blue), var(--primary-bright-blue), var(--primary-teal));
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

/* ===================================
   Scroll Progress Bar
   =================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--gradient-accent);
  z-index: var(--z-fixed);
  transition: width 0.1s linear;
}

/* ===================================
   Page Transitions
   =================================== */

.page-transition {
  animation: fadeIn 0.5s ease-out;
}

/* ===================================
   Counter Animation Classes
   =================================== */

.counter {
  display: inline-block;
  animation: count-up 0.6s ease-out;
}

/* ===================================
   Reveal On Scroll (for GSAP)
   =================================== */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(50px);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===================================
   Stagger Animation Delays
   =================================== */

.stagger-delay-1 {
  animation-delay: 0.1s;
}

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

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

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

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

/* ===================================
   Form Field Animations
   =================================== */

.form-field-animate {
  position: relative;
}

.form-field-animate input:focus,
.form-field-animate textarea:focus {
  animation: field-focus 0.3s ease-out;
}

@keyframes field-focus {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Success/Error message animations */
.message-slide-in {
  animation: slideInDown 0.4s ease-out;
}

/* ===================================
   Image Reveal Animations
   =================================== */

.image-reveal {
  position: relative;
  overflow: hidden;
}

.image-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-deep-blue);
  transform: translateX(-100%);
}

.image-reveal.active::after {
  animation: reveal-slide 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

@keyframes reveal-slide {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Grayscale to color on hover */
.img-grayscale {
  filter: grayscale(100%);
  transition: filter var(--transition-base);
}

.img-grayscale:hover {
  filter: grayscale(0%);
}

/* Ken Burns effect */
.ken-burns {
  overflow: hidden;
}

.ken-burns img {
  animation: ken-burns-zoom 20s ease-in-out infinite alternate;
}

@keyframes ken-burns-zoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

/* ===================================
   Card Flip Animation
   =================================== */

.card-flip {
  perspective: 1000px;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  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);
}

/* ===================================
   Ripple Effect
   =================================== */

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* ===================================
   Performance Optimizations
   =================================== */

/* GPU acceleration for smooth animations */
.gpu-accelerate {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ===================================
   Reduced Motion Support
   =================================== */

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

  .parallax {
    background-attachment: scroll;
  }

  .floating,
  .animated-gradient,
  .ken-burns img {
    animation: none;
  }
}

/* ===================================
   Mobile Animation Adjustments
   =================================== */

@media (max-width: 768px) {
  /* Simplify animations on mobile for better performance */
  .hover-tilt:hover {
    transform: none;
  }

  .parallax {
    background-attachment: scroll;
  }

  .card-flip:hover .card-flip-inner {
    transform: none;
  }

  /* Reduce floating effect on mobile */
  .floating {
    animation: none;
  }
}
