/* ============================================
   MODERN ANIMATIONS & INTERACTIVE EFFECTS
   ============================================ */

/* Global Animation Setup */
@supports (animation-timeline: view()) {
  .animate-on-scroll {
    animation: fadeInUp 0.6s ease-out forwards;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right Animation */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In Animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide Down Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Glow Animation */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
  }
}

/* Shimmer Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

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

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

/* Card Hover Effects */
.card, .feature-card, .service-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideDown 0.6s ease-out;
}

.card:hover, .feature-card:hover, .service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15) !important;
}

/* Button Interactions */
button, .btn, a.btn {
  position: relative;
  overflow: hidden;
}

button::before, .btn::before, a.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  opacity: 0;
}

button:active::before, .btn:active::before, a.btn:active::before {
  width: 300px;
  height: 300px;
  opacity: 1;
}

/* Smooth Transitions */
a, button, input, select, textarea {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Link Hover Effects */
a:not(.btn):not(.no-hover) {
  position: relative;
  text-decoration: none;
}

a:not(.btn):not(.no-hover)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:not(.btn):not(.no-hover):hover::after {
  transform: scaleX(1);
}

/* Form Input Animations */
input:focus, textarea:focus, select:focus {
  animation: glow 0.6s ease-in-out;
}

/* Loading Animation */
.loading::before {
  animation: spin 1s linear infinite !important;
}

/* Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

@keyframes ripple-animation {
  0% {
    transform: scale(1, 1) translate(-50%);
    opacity: 1;
  }
  100% {
    transform: scale(30, 30) translate(-50%);
    opacity: 0;
  }
}

.ripple:active::after {
  animation: ripple-animation 0.6s ease-out;
}

/* Navbar Animations */
.navbar, nav {
  animation: slideDown 0.5s ease-out;
}

/* Tooltip Animations */
.tooltip {
  animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Animations */
.modal {
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay {
  animation: fadeIn 0.3s ease-out;
}

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

/* Parallax Effect */
.parallax {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

/* Text Selection Color */
::selection {
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  color: white;
}

::-moz-selection {
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  color: white;
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Progress Bar Animation */
.progress {
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  height: 4px;
}

.progress-bar {
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  height: 100%;
  animation: slideRight 1.5s ease-in-out;
}

@keyframes slideRight {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Badge Pulse Animation */
.badge {
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Alert Animations */
.alert {
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-close {
  cursor: pointer;
  transition: all 0.3s ease;
}

.alert-close:hover {
  color: inherit !important;
  opacity: 0.8;
}

/* Icon Animations */
i, .icon, svg {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-rotate:hover {
  transform: rotate(180deg);
}

.icon-bounce:hover {
  animation: bounce 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-scale:hover {
  transform: scale(1.2);
}

/* Image Animations */
img {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

img:hover {
  filter: brightness(1.05);
}

/* Gradient Text Animation */
.gradient-text {
  background: linear-gradient(135deg, #6366f1 0%, #0891b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite;
}

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

/* Stagger Animation for Lists */
.stagger-list li {
  animation: fadeInUp 0.6s ease-out;
}

.stagger-list li:nth-child(1) { animation-delay: 0.1s; }
.stagger-list li:nth-child(2) { animation-delay: 0.2s; }
.stagger-list li:nth-child(3) { animation-delay: 0.3s; }
.stagger-list li:nth-child(4) { animation-delay: 0.4s; }
.stagger-list li:nth-child(5) { animation-delay: 0.5s; }
.stagger-list li:nth-child(n+6) { animation-delay: 0.6s; }

/* Smooth Backdrop Blur */
.blur-bg {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Color Transition on Hover */
.color-transition {
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Transform Transitions */
.transform-transition {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Overlay on Hover */
.overlay-hover {
  position: relative;
  overflow: hidden;
}

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

.overlay-hover:hover::before {
  left: 100%;
}

/* Floating Animation */
@keyframes floating {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* Shake Animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

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

/* Responsive Animation Adjustments */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .parallax {
    background-attachment: scroll;
  }

  .animate-on-scroll {
    animation: none;
    opacity: 1;
  }
}
