/* ==========================================================================
   IGIT Website - Animations CSS
   ========================================================================== */

/* Fade In Animations
   ========================================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

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

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

.slide-in-bottom {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-bottom.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Animation Delays
   ========================================================================== */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

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

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

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

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

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

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

/* Image Overlay Hover
   ========================================================================== */
.img-overlay-container {
  position: relative;
  overflow: hidden;
}

.img-overlay-container img {
  transition: transform 0.5s ease;
}

.img-overlay-container:hover img {
  transform: scale(1.1);
}

.img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(30, 66, 103, 0.9), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.img-overlay-container:hover .img-overlay {
  opacity: 1;
}

/* Loading Animation
   ========================================================================== */
.loader {
  width: 50px;
  height: 50px;
  border: 4px solid var(--background-light);
  border-top-color: var(--secondary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Counter Animation (Handled via JavaScript)
   ========================================================================== */
.counter {
  font-size: 3rem;
  font-weight: 700;
  color: var(--secondary-color);
}

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

/* Pulse Animation
   ========================================================================== */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

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

.animate-on-load {
  animation: fadeInUp 0.8s ease-out;
}

/* Slide Down (For Dropdowns)
   ========================================================================== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-down {
  animation: slideDown 0.3s ease-out;
}

/* Progress Bar Animation
   ========================================================================== */
.progress-bar {
  height: 4px;
  background-color: var(--background-light);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--secondary-color);
  width: 0;
  transition: width 1s ease-out;
}

.progress-fill.animate {
  width: 100%;
}

/* Lightbox Animation
   ========================================================================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: var(--text-light);
  cursor: pointer;
  z-index: 10000;
  transition: var(--transition);
}

.lightbox-close:hover {
  color: var(--secondary-color);
  transform: rotate(90deg);
}

/* Button Ripple Effect
   ========================================================================== */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

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

.btn-ripple:hover::before {
  width: 300px;
  height: 300px;
}

/* Shimmer Effect (For Loading States)
   ========================================================================== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    to right,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

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

  .counter {
    font-size: 2.5rem;
  }

  .lightbox-content {
    max-width: 95%;
    max-height: 95%;
  }

  .lightbox-close {
    top: 10px;
    right: 15px;
    font-size: 2rem;
  }
}

/* Reduced Motion for Accessibility
   ========================================================================== */
@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;
  }
}
