/* ========================================
   LOADING ANIMATIONS
   ======================================== */

/* Page Load Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1D809F 0%, #0b1220 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
  visibility: visible;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Spinner Container */
.spinner-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Main Spinner */
.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Spinner Text */
.spinner-text {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 1px;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Dark mode loader styling */
.theme-dark .loading-overlay {
  background: linear-gradient(135deg, #0b1220 0%, #1D809F 100%);
}

/* ========================================
   SCROLL REVEAL ANIMATIONS
   ======================================== */

/* Fade In Animation */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Slide In From Left */
.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 From Right */
.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);
}

/* Scale In Animation */
.scale-in {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Stagger Animation for List Items */
.reveal-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay for sequential animations */
.reveal-item:nth-child(1) { transition-delay: 0.1s; }
.reveal-item:nth-child(2) { transition-delay: 0.2s; }
.reveal-item:nth-child(3) { transition-delay: 0.3s; }
.reveal-item:nth-child(4) { transition-delay: 0.4s; }
.reveal-item:nth-child(5) { transition-delay: 0.5s; }

/* ========================================
   BUTTON LOADING STATE
   ======================================== */

.btn-loading-state {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading-state::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid transparent;
  border-radius: 50%;
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
  right: 10px;
  top: 0;
  bottom: 0;
}

.btn-loading-state .btn-text {
  display: none;
}

.btn-loading-state .btn-text.loading {
  display: inline;
  margin-right: 5px;
}

/* ========================================
   FADE IN/OUT ANIMATIONS
   ======================================== */

.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

.fade-out {
  animation: fadeOut 0.6s ease-in-out;
}

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

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

/* ========================================
   MODAL/DIALOG ANIMATIONS
   ======================================== */

.modal.fade .modal-dialog {
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s ease-out;
}

.modal.show .modal-dialog {
  transform: scale(1);
  opacity: 1;
}

/* ========================================
   GALLERY CARD ANIMATIONS
   ======================================== */

.reveal-gallery-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay for gallery items */
.gallery-row .col:nth-child(1) .reveal-gallery-item { transition-delay: 0.1s; }
.gallery-row .col:nth-child(2) .reveal-gallery-item { transition-delay: 0.2s; }
.gallery-row .col:nth-child(3) .reveal-gallery-item { transition-delay: 0.3s; }

/* Carousel cards fade in */
.testimonial-card {
  opacity: 0.8;
  transition: opacity 0.3s ease-out;
}

.testimonial-card.active {
  opacity: 1;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
  .spinner {
    width: 48px;
    height: 48px;
    border-width: 3px;
  }
  
  .spinner-text {
    font-size: 1rem;
  }
  
  .reveal-on-scroll,
  .slide-in-left,
  .slide-in-right,
  .scale-in,
  .reveal-item {
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  }
}

@media (max-width: 480px) {
  .spinner {
    width: 40px;
    height: 40px;
    border-width: 2px;
  }
  
  .spinner-text {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
  }
  
  .reveal-on-scroll {
    transform: translateY(20px);
  }
  
  .slide-in-left {
    transform: translateX(-30px);
  }
  
  .slide-in-right {
    transform: translateX(30px);
  }
}
