/**
 * Palm Travel - Animation Styles
 * Scroll animations, transitions, and interactive effects
 */

/* ============================================
   BASE ANIMATION SETUP
   ============================================ */

/* Elements start hidden/offset before animating in */
.animate-fade-up,
.animate-fade-in,
.animate-slide-left,
.animate-slide-right,
[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-up {
    transform: translateY(30px);
}

.animate-slide-left {
    transform: translateX(-30px);
}

.animate-slide-right {
    transform: translateX(30px);
}

/* Animated state */
.animate-in {
    opacity: 1 !important;
    transform: translateY(0) translateX(0) !important;
}


/* ============================================
   HOVER EFFECTS
   ============================================ */

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

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Button hover scale */
.hover-scale {
    transition: transform 0.2s ease;
}

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

/* Link underline animation */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}


/* ============================================
   CHATBOT ANIMATIONS
   ============================================ */

#chatbot-window {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

#chatbot-window:not(.hidden) {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

#chatbot-toggle button {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#chatbot-toggle button:hover {
    transform: scale(1.1);
}

/* Chatbot button pulse */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(15, 76, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(15, 76, 129, 0);
    }
}

#chatbot-toggle button {
    animation: pulse 2s infinite;
}

#chatbot-toggle button:hover {
    animation: none;
}


/* ============================================
   NAVIGATION
   ============================================ */

nav {
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Mobile menu animation */
#mobile-menu {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

#mobile-menu.hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu:not(.hidden) {
    max-height: 300px;
    opacity: 1;
}

/* Menu icon animation */
#mobile-menu-btn svg {
    transition: transform 0.3s ease;
}

#mobile-menu-btn.menu-open svg {
    transform: rotate(90deg);
}


/* ============================================
   FORM INTERACTIONS
   ============================================ */

input, textarea, select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.1);
}

/* Submit button loading */
button[type="submit"] {
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button[type="submit"]:active {
    transform: scale(0.98);
}


/* ============================================
   HERO SECTION
   ============================================ */

.hero-gradient {
    position: relative;
    overflow: hidden;
}

/* Subtle gradient animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero-animated {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}


/* ============================================
   CARDS & CONTENT
   ============================================ */

/* Service cards */
.service-card,
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover,
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Icon animations */
.service-card .w-12,
.feature-card .w-10 {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.service-card:hover .w-12,
.feature-card:hover .w-10 {
    transform: scale(1.1);
}


/* ============================================
   TIMELINE (About page)
   ============================================ */

.timeline-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Timeline dot pulse */
@keyframes dotPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(15, 76, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(15, 76, 129, 0);
    }
}

.timeline-dot {
    animation: dotPulse 2s ease-in-out infinite;
}


/* ============================================
   DESTINATION CARDS (Leisure page)
   ============================================ */

.destination-card {
    transition: transform 0.3s ease;
}

.destination-card:hover {
    transform: scale(1.02);
}

.destination-card img,
.destination-card .h-40 {
    transition: transform 0.5s ease;
}

.destination-card:hover img,
.destination-card:hover .h-40 {
    transform: scale(1.1);
}


/* ============================================
   LOADING STATES
   ============================================ */

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

.animate-spin {
    animation: spin 1s linear infinite;
}


/* ============================================
   SCROLL INDICATOR
   ============================================ */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.scroll-indicator {
    animation: bounce 2s infinite;
}


/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
