/* ==========================================================================
   Animations and Keyframes
   ========================================================================== */

/* Core Keyframe Animations */
@keyframes backgroundSlide {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

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

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

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

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

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(2deg); }
  50% { transform: translateY(-10px) rotate(-1deg); }
  75% { transform: translateY(-20px) rotate(1deg); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-8px) rotate(1deg); }
  66% { transform: translateY(-12px) rotate(-0.5deg); }
}

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

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

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

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

.floating-element:nth-child(even) {
  animation: floatSlow 8s ease-in-out infinite;
  animation-delay: 2s;
}

/* Text animations */
.text-shimmer {
  animation: backgroundSlide 3s ease-in-out infinite;
}

.gradient-animated {
  background-size: 200% 200%;
  animation: backgroundSlide 4s ease infinite;
}

/* Hero animations - content visible by default for instant first paint */
.hero-title,
.hero-subtitle,
.hero-description,
.hero-buttons {
  opacity: 1;
  transform: translateY(0);
}

/* Apply animations only after page load to avoid blank screen on first load */
@media (prefers-reduced-motion: no-preference) {
  .hero-title {
    animation: backgroundSlide 4s ease-in-out infinite;
  }
}

/* Enhanced background pulse */
.hero-background::after {
  animation: pulse 4s ease-in-out infinite;
}

/* Animation utility classes - Service cards excluded to prevent hover conflicts */
.fade-in-up:not(.service-card) {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

/* Service cards maintain normal visibility (no entrance animation) */
.service-card {
  opacity: 1;
  transform: none;
}

/* Scroll-triggered animations */
.section-animated {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--transition-slow);
}

.section-animated.animate {
  opacity: 1;
  transform: translateY(0);
}

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

@media (prefers-reduced-motion: reduce) {
  .floating-element,
  .gradient-animated,
  .text-shimmer,
  .hero-background::after {
    animation: none;
  }
  
  .hero-title,
  .hero-subtitle,
  .hero-description,
  .hero-buttons {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .section-animated {
    opacity: 1;
    transform: none;
    transition: none;
  }
  
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Enhanced Service Page Specific Animations and Effects
   ========================================================================== */

/* Service card enhanced animations */
@keyframes service-card-glow {
  0% { box-shadow: var(--shadow-lg); }
  50% { box-shadow: var(--shadow-glow); }
  100% { box-shadow: var(--shadow-lg); }
}

/* Service card enhanced animations - constant glow on hover instead of pulsing */
.service-card:hover {
  box-shadow: var(--shadow-glow);
}

/* Process step floating animation */
@keyframes process-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.process-step:hover .process-number {
  animation: process-float 2s ease-in-out infinite;
}

/* Specialty item pulse effect */
@keyframes specialty-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.specialty-item:hover {
  animation: specialty-pulse 1.5s ease-in-out infinite;
}

/* Service icon rotation effect */
@keyframes service-icon-rotate {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(5deg) scale(1.05); }
  75% { transform: rotate(-5deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

.service-card:hover .service-icon {
  animation: service-icon-rotate 0.6s ease-in-out;
}

/* Enhanced button hover effects */
.btn-secondary:hover {
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.3);
  transform: translateY(-2px);
}

/* Card gradient overlay animation for better visual depth */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(217, 119, 6, 0.02) 50%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

/* ==========================================================================
   Contact Page Specific Animations and Interactions
   ========================================================================== */

.consultation-card {
  transition: all var(--transition-normal);
  transform-style: preserve-3d;
}

.consultation-card:hover {
  transform: translateY(-8px) rotateX(5deg);
}

.contact-form {
  transition: all var(--transition-normal);
}

.contact-form:hover {
  transform: translateY(-2px);
}

.contact-info-card {
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.contact-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.1), transparent);
  transition: left var(--transition-slow);
}

.contact-info-card:hover::before {
  left: 100%;
}

.contact-info-highlight {
  position: relative;
  overflow: hidden;
}

.contact-info-highlight::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(217, 119, 6, 0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.contact-info-highlight:hover::after {
  opacity: 1;
}

/* Form interaction enhancements */
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  transform: scale(1.02);
}

.contact-form label {
  transition: all var(--transition-fast);
}

.contact-form input:focus + label,
.contact-form textarea:focus + label,
.contact-form select:focus + label {
  color: var(--accent-color);
  transform: translateY(-2px);
}

/* ==========================================================================
   Logo Carousel Animation
   ========================================================================== */

/* Manual carousel - no auto-animation */
.animate-scroll {
  /* Removed automatic animation - now controlled by JavaScript */
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active dot indicator styling */
.carousel-dot.active {
  background-color: #f59e0b; /* amber-500 */
  transform: scale(1.2);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .animate-scroll {
    transition: none;
  }

  .carousel-dot {
    transition: none;
  }
}
