/**
 * Hotel InSitu - Animation & Interaction Enhancements
 * Version: 1.0
 * 
 * This CSS file adds modern animations and interactive effects
 * while preserving the existing color palette and design.
 */

/* ============================================
   SMOOTH SCROLL & BASE ANIMATIONS
   ============================================ */

html {
  scroll-behavior: smooth;
}

/* Respect user preferences for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@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 pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   HERO SECTION ENHANCEMENTS
   ============================================ */

/* Hero heading animation */
.hero-section h1,
.elementor-heading-title,
h1:first-of-type {
  animation: fadeInUp 1s ease-out;
}

/* Hero subtitle/description */
.hero-section p,
.elementor-widget-text-editor p:first-of-type {
  animation: fadeInUp 1.2s ease-out;
}

/* CTA Button pulse animation */
a[href*="whatsapp"],
.booking-button,
.cta-button,
a[href*="Booking"] {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  animation: pulse 2s ease-in-out infinite;
}

a[href*="whatsapp"]:hover,
.booking-button:hover,
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: none;
}

/* Button ripple effect */
a[href*="whatsapp"]::before,
.booking-button::before,
.cta-button::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;
}

a[href*="whatsapp"]:active::before,
.booking-button:active::before,
.cta-button:active::before {
  width: 300px;
  height: 300px;
}

/* ============================================
   NAVIGATION ENHANCEMENTS
   ============================================ */

/* Navigation menu items */
nav a,
.menu-item a,
header a {
  position: relative;
  transition: all 0.3s ease;
}

/* Animated underline effect */
nav a::after,
.menu-item a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}

nav a:hover::after,
.menu-item a:hover::after {
  width: 100%;
}

/* Sticky header shadow transition */
header,
.site-header,
.main-navigation {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

header.scrolled,
.site-header.scrolled,
.main-navigation.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ============================================
   SECTION ENTRANCE ANIMATIONS
   ============================================ */

/* Sections fade in when visible */
section,
.elementor-section,
.content-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible,
.elementor-section.visible,
.content-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   CARD & IMAGE ENHANCEMENTS
   ============================================ */

/* Room cards, facility cards, destination cards */
.card,
.room-card,
.facility-card,
.destination-card,
.elementor-widget-container > div,
article {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.card:hover,
.room-card:hover,
.facility-card:hover,
.destination-card:hover,
article:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Image zoom effect on hover */
.card img,
.room-card img,
.facility-card img,
.destination-card img,
article img {
  transition: transform 0.5s ease;
  will-change: transform;
}

.card:hover img,
.room-card:hover img,
.facility-card:hover img,
.destination-card:hover img,
article:hover img {
  transform: scale(1.1);
}

/* Image container overflow hidden for zoom effect */
.card-image,
.image-wrapper,
.thumbnail,
figure {
  overflow: hidden;
  border-radius: inherit;
}

/* Shimmer effect on images while loading */
img {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 50%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

img.loaded {
  animation: none;
  background: none;
}

/* ============================================
   ICON ANIMATIONS
   ============================================ */

/* Icons float on hover */
.icon,
.facility-icon,
.feature-icon,
i[class*="fa-"],
svg {
  transition: transform 0.3s ease;
}

.icon:hover,
.facility-icon:hover,
.feature-icon:hover,
.card:hover .icon,
.card:hover i[class*="fa-"],
.card:hover svg {
  transform: translateY(-5px);
  animation: float 2s ease-in-out infinite;
}

/* ============================================
   TESTIMONIAL / REVIEW SECTION
   ============================================ */

.testimonial,
.review-card,
.testimonial-item {
  animation: fadeIn 0.8s ease;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial:hover,
.review-card:hover,
.testimonial-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Quote icon animation */
.quote-icon,
.testimonial::before {
  animation: scaleIn 0.6s ease;
}

/* ============================================
   LIST ITEMS & FEATURES
   ============================================ */

/* Stagger animation for list items */
ul li,
.feature-list li,
.facility-list li {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

ul li:nth-child(1) { animation-delay: 0.1s; }
ul li:nth-child(2) { animation-delay: 0.2s; }
ul li:nth-child(3) { animation-delay: 0.3s; }
ul li:nth-child(4) { animation-delay: 0.4s; }
ul li:nth-child(5) { animation-delay: 0.5s; }
ul li:nth-child(6) { animation-delay: 0.6s; }
ul li:nth-child(7) { animation-delay: 0.7s; }

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */

button,
.button,
.btn,
input[type="submit"],
a.button {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

button:hover,
.button:hover,
.btn:hover,
input[type="submit"]:hover,
a.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

button:active,
.button:active,
.btn:active,
input[type="submit"]:active,
a.button:active {
  transform: translateY(0);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

input,
textarea,
select {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* ============================================
   SCROLL PROGRESS INDICATOR
   ============================================ */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #4CAF50, #2196F3);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.fade-in {
  animation: fadeIn 0.6s ease;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease;
}

.slide-in-left {
  animation: slideInLeft 0.6s ease;
}

.slide-in-right {
  animation: slideInRight 0.6s ease;
}

.scale-in {
  animation: scaleIn 0.6s ease;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  /* Reduce animation intensity on mobile */
  .card:hover,
  .room-card:hover,
  .facility-card:hover,
  .destination-card:hover {
    transform: translateY(-4px);
  }
  
  /* Disable parallax on mobile for performance */
  .parallax {
    background-attachment: scroll !important;
  }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU acceleration for frequently animated elements */
.card,
.room-card,
.facility-card,
.destination-card,
button,
.button,
a[href*="whatsapp"] {
  transform: translateZ(0);
  backface-visibility: hidden;
}
