/* ===================================================================
   IMPORT FONTS (Ensure this matches the <link> in HTML)
=================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ===================================================================
   TAILWIND BASE, COMPONENTS, UTILITIES (Reference)
   (Not strictly needed with CDN, but good practice for build processes)
=================================================================== */
/*
@tailwind base;
@tailwind components;
@tailwind utilities;
*/

/* ===================================================================
   BASE & CUSTOM STYLES
=================================================================== */
html {
  @apply scroll-smooth;
  /* Improve scroll performance on some browsers */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Momentum scrolling on iOS */
}

body {
  /* font-family is set via Tailwind config */
  @apply bg-neutral-light text-neutral-darker font-sans antialiased;
  overscroll-behavior-y: contain; /* Prevents body scroll chaining/pull-to-refresh */
}

/* Custom Scrollbar - Elegant & Subtle */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  @apply bg-neutral/30; /* Very subtle track */
}
::-webkit-scrollbar-thumb {
  @apply bg-neutral-dark/40 rounded-full border-[2.5px] border-transparent; /* Slightly thinner border */
  background-clip: content-box;
  transition: background-color 0.2s ease-in-out;
}
::-webkit-scrollbar-thumb:hover {
  @apply bg-neutral-dark/60; /* Darker on hover */
}

/* ===================================================================
   LAYOUT & SECTION STYLING
=================================================================== */

/* Hero Background & Overlay */
.hero-bg {
  background: url('assets/images/hero.jpg') no-repeat center center;
  background-size: cover;
  background-attachment: fixed; /* Parallax-like effect */
  @apply relative;
}
/* Overlay is handled by a div with gradient in HTML */

/* Text Shadow for Readability on Images */
.shadow-text {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65); /* Enhanced shadow */
}
.shadow-text-light {
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}

/* Optional: Subtle Background Pattern for Contact Section */
.pattern-bg {
    /* Example using SVG background - uncomment and customize if desired */
    /* background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.06' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.99-7.5L26 15v18.5l-13 7.5L0 33.5V15z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); */
}

/* ===================================================================
   COMPONENT STYLING
=================================================================== */

/* Card Hover Effect - Enhanced */
.card-hover {
  /* Using a refined cubic-bezier for smoother acceleration/deceleration */
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  will-change: transform, box-shadow;
}
.card-hover:hover {
  transform: translateY(-6px) scale(1.02); /* Added subtle scale */
  /* Tailwind handles shadow change via hover:shadow-hover */
}

/* Service Card Specific Hover */
.service-card:hover h3 {
    @apply text-primary-dark; /* Ensure heading color changes */
}

/* Modern Button Shine Effect - Refined Easing */
.btn-modern {
  @apply relative overflow-hidden z-[1] transition-transform duration-300;
  will-change: transform;
}
.btn-modern::after {
  content: '';
  @apply absolute top-0 w-full h-full bg-gradient-to-r from-transparent via-white/25 to-transparent z-[-1];
  left: -150%;
  transform: skewX(-25deg);
  /* Smoother easing for the shine */
  transition: left 0.75s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: left;
}
.btn-modern:hover::after {
  left: 150%;
}

/* Mobile Menu Styling & Animation - Smoother Height Transition */
.mobile-menu {
    max-height: 0;
    @apply opacity-0 overflow-hidden;
    /* Smoother easing for height, standard ease for opacity */
    transition: max-height 0.5s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.4s ease-out;
    will-change: max-height, opacity;
}
.mobile-menu.menu-open {
    @apply opacity-100;
    /* max-height is set dynamically by JS */
}

/* Hamburger Icon Animation - Clean & Crisp */
.hamburger-icon {
  position: relative;
  width: 24px;
  height: 18px;
  cursor: pointer;
  transition: transform 0.3s ease-in-out;
}

.hamburger-icon span {
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.hamburger-icon span:nth-child(1) {
  top: 0;
}

.hamburger-icon span:nth-child(2) {
  top: 8px;
  width: 80%;
}

.hamburger-icon span:nth-child(3) {
  top: 16px;
}

/* Hamburger open state */
.hamburger-icon.open {
  transform: rotate(90deg);
}

.hamburger-icon.open span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.hamburger-icon.open span:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

/* Hamburger closing animation */
.hamburger-icon.closing span {
  transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

/* Mobile menu animations */
#mobileMenu {
  transition: max-height 0.4s cubic-bezier(0.19, 1, 0.22, 1), 
              opacity 0.3s ease-in-out;
  overflow: hidden;
}

#mobileMenu.menu-open {
  animation: slideDown 0.4s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

#mobileMenu.menu-closing {
  animation: slideUp 0.3s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* Menu item animations */
.menu-item-animate {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s ease forwards;
}

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

@keyframes slideDown {
  from {
    max-height: 0;
    opacity: 0;
  }
  to {
    max-height: 500px;
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    max-height: 500px;
    opacity: 1;
  }
  to {
    max-height: 0;
    opacity: 0;
  }
}

/* Mobile menu item hover effects */
#mobileMenu a {
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

#mobileMenu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  transition: width 0.3s ease;
}

#mobileMenu a:hover::after,
#mobileMenu a.active::after {
  width: 100%;
}

/* Pulse animation for active menu items */
#mobileMenu a.bg-primary\/10 {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

/* ===================================================================
   FLOATING BUTTONS & ANIMATIONS
=================================================================== */

/* Back-to-Top Button - Enhanced Transition */
#backToTop {
    @apply fixed bottom-20 right-5 md:right-6 z-40 opacity-0 invisible;
    transform: translateY(10px); /* Start slightly lower */
    /* Smoother easing for transform */
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out, transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: opacity, transform, visibility;
}
#backToTop.visible { /* Class added by JS */
    @apply opacity-100 visible translate-y-0; /* End at normal position */
}
#backToTop:hover {
    @apply scale-110; /* Keep the scale on hover */
}

/* Floating WhatsApp Button */
.whatsapp-button {
    /* Tailwind handles positioning, z-index, bg, text, dimensions, rounded, shadow, hover, focus, animation */
    /* The 'animate-pulse-slow' class provides the gentle pulse */
    will-change: transform, opacity; /* Hint for the pulse animation */
}

/* Scroll Animation Classes - Enhanced */
.scroll-animate {
    @apply opacity-0 transition-all duration-700; /* Slightly longer duration */
    /* Smoother, slightly anticipating ease-out */
    transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: opacity, transform;
}
.scroll-animate.fade-in-up {
    @apply translate-y-5; /* Slightly less initial translation */
}
/* Add more specific animation starting states if needed */
/* .scroll-animate.fade-in-left { @apply -translate-x-5; } */

.scroll-animate.is-visible { /* Class added by JS */
    @apply opacity-100 translate-y-0; /* Reset to normal position */
}

/* Add delays using inline style in HTML: style="transition-delay: 0.1s;" */
/* Note: Use transition-delay for scroll animations, not animation-delay,
   as we are using the transition property here. */

/* ===================================================================
   INSTAGRAM GALLERY STYLING & ANIMATIONS
=================================================================== */

/* Instagram Gallery Item Styling */
.instagram-gallery-item {
    @apply overflow-hidden relative shadow-custom;
    will-change: transform, box-shadow;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.instagram-gallery-item:hover {
    @apply shadow-hover transform;
    transform: translateY(-5px);
}

/* Smooth transition for image zoom effect */
.instagram-gallery-item img {
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Custom easing for smoother animations */
.ease-out-expo {
    transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Instagram button gradient hover effect */
.instagram-gallery-item .overlay {
    transition: opacity 0.3s ease-in-out;
}

/* Instagram button styling */
a[href*="instagram.com"] {
    position: relative;
    overflow: hidden;
}

/* Enhanced animation for Instagram icon */
a[href*="instagram.com"] svg {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

a[href*="instagram.com"]:hover svg {
    transform: scale(1.15);
}

/* Custom animation for the Instagram follow button */
.from-\[\#833AB4\] {
    position: relative;
    overflow: hidden;
    background-size: 200% 200%;
}

.from-\[\#833AB4\]:hover {
    animation: instagram-pulse 2s infinite;
}

@keyframes instagram-pulse {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Add ripple effect for buttons */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Add scale utility if not already defined in Tailwind config */
.scale-115 {
    transform: scale(1.15);
}

/* ===================================================================
   ENHANCED ANIMATIONS FOR EXISTING ELEMENTS
=================================================================== */

/* Improved fade-in-up animation with staggered delays */
.scroll-animate.fade-in-up {
    animation-fill-mode: both;
}

.scroll-animate.fade-in-up.is-visible {
    animation: enhancedFadeInUp 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes enhancedFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(25px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced hover effects for buttons */
.btn-modern {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-modern:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Improved card hover animations */
.card-hover {
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-hover:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Hover state for touch devices */
.hover-active {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

/* ===================================================================
   MOBILE MENU ANIMATIONS
=================================================================== */

/* 3D button effect */
.btn-3d {
  transform-style: preserve-3d;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-3d:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
              0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-3d:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Magnetic button effect (requires JS) */
.btn-magnetic {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Gradient border animation */
.gradient-border {
  position: relative;
  border: none;
  z-index: 0;
}

.gradient-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #4CAF50, #FFC107, #4CAF50);
  background-size: 400% 400%;
  z-index: -1;
  border-radius: inherit;
  animation: gradientBorder 3s ease infinite;
}

@keyframes gradientBorder {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Shiny button effect */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  transition: transform 0.7s;
}

.btn-shine:hover::after {
  transform: rotate(30deg) translate(100%, 100%);
}

/* ===================================================================
   PARTICLE ANIMATIONS & TOUCH EFFECTS
=================================================================== */

/* Menu particle animation */
.menu-particle {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  opacity: 1;
  z-index: 9999;
  transition: transform 1s cubic-bezier(0.23, 1, 0.32, 1), opacity 1s ease;
}

/* Touch-specific animations */
.touch-device .btn-modern:active,
.touch-device .instagram-gallery-item:active {
  transform: scale(0.97) !important;
  transition: transform 0.2s ease !important;
}

.touch-scale {
  transform: scale(0.95) !important;
  transition: transform 0.2s ease !important;
}

.touch-pulse {
  animation: touchPulse 0.3s ease-out;
}

@keyframes touchPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

.touch-active {
  background-color: rgba(76, 175, 80, 0.1) !important;
  color: var(--color-primary-dark) !important;
}

/* Enhanced Instagram gallery animations */
.instagram-gallery-item.is-visible {
  animation: bounceIn 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

@keyframes bounceIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }
  40% {
    transform: scale3d(0.9, 0.9, 0.9);
  }
  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }
  80% {
    transform: scale3d(0.97, 0.97, 0.97);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

/* Pulsing animation for Instagram button */
.pulsing {
  animation: buttonPulse 1s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite alternate;
}

@keyframes buttonPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(131, 58, 180, 0.5);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 0 20px 5px rgba(131, 58, 180, 0.3);
  }
}

/* Define CSS variables for colors */
:root {
  --color-primary: #4CAF50;
  --color-primary-light: #81C784;
  --color-primary-dark: #388E3C;
  --color-primary-darker: #2E7D32;
  --color-secondary: #FFC107;
  --color-secondary-light: #FFD54F;
  --color-secondary-dark: #FFA000;
}

/* Enhanced mobile menu animations */
#mobileMenu a {
  position: relative;
  z-index: 1;
}

#mobileMenu a::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s ease-out;
  border-radius: 0.375rem;
  opacity: 0.1;
}

#mobileMenu a:hover::before {
  transform: scaleX(1);
}

/* Floating animation for important elements */
.floating {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Add neon glow effect for emphasis */
.neon-glow {
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5),
              0 0 20px rgba(76, 175, 80, 0.3),
              0 0 30px rgba(76, 175, 80, 0.1);
  transition: box-shadow 0.3s ease;
}

.neon-glow:hover {
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.7),
              0 0 30px rgba(76, 175, 80, 0.5),
              0 0 45px rgba(76, 175, 80, 0.3);
}