/* ===================================
   Apple-Inspired Smooth Animations
   Butter Smooth 60fps Performance
   =================================== */

/* ===== Core Apple Principles ===== */
:root {
    --apple-ease: cubic-bezier(0.28, 0.11, 0.32, 1);
    --apple-ease-in: cubic-bezier(0.42, 0, 1, 1);
    --apple-ease-out: cubic-bezier(0, 0, 0.58, 1);
    --apple-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 0.3s;
    --duration-medium: 0.6s;
    --duration-slow: 0.9s;
}

/* ===== Smooth Scroll Behavior ===== */
html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== Apple-Style Scroll Snap ===== */
.section {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

/* ===== Hero Section - Scale & Fade ===== */
.hero {
    opacity: 0;
    transform: scale(0.95) translateZ(0);
    animation: appleHeroEntry 1.2s var(--apple-ease) forwards;
    will-change: opacity, transform;
}

@keyframes appleHeroEntry {
    0% {
        opacity: 0;
        transform: scale(0.95) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

/* ===== Hero Text - Elegant Stagger ===== */
.hero-content h1,
.hero-content .hero-title {
    opacity: 0;
    transform: translateY(30px) translateZ(0);
    animation: appleTextUp 0.9s var(--apple-ease) 0.3s forwards;
}

.hero-content p,
.hero-content .hero-subtitle {
    opacity: 0;
    transform: translateY(30px) translateZ(0);
    animation: appleTextUp 0.9s var(--apple-ease) 0.5s forwards;
}

.hero-content .btn,
.hero-content .cta-buttons {
    opacity: 0;
    transform: translateY(30px) translateZ(0);
    animation: appleTextUp 0.9s var(--apple-ease) 0.7s forwards;
}

@keyframes appleTextUp {
    0% {
        opacity: 0;
        transform: translateY(30px) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

/* ===== Parallax Scroll Effect ===== */
.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
    will-change: transform;
    transition: transform 0.3s var(--apple-ease);
}

/* ===== Section Fade-In on Scroll ===== */
.fade-in-section {
    opacity: 0;
    transform: translateY(60px) translateZ(0);
    transition: opacity 0.9s var(--apple-ease), 
                transform 0.9s var(--apple-ease);
    will-change: opacity, transform;
}

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

/* ===== Apple-Style Cards - Scale on Scroll ===== */
.apple-card {
    opacity: 0;
    transform: scale(0.9) translateY(40px) translateZ(0);
    transition: opacity 0.8s var(--apple-ease),
                transform 0.8s var(--apple-ease);
    will-change: opacity, transform;
}

.apple-card.visible {
    opacity: 1;
    transform: scale(1) translateY(0) translateZ(0);
}

/* ===== Card Hover - Elegant Lift ===== */
.service-card,
.destination-card,
.package-card,
.corporate-service-card {
    transition: transform 0.4s var(--apple-spring),
                box-shadow 0.4s var(--apple-spring);
    will-change: transform, box-shadow;
}

.service-card:hover,
.destination-card:hover,
.package-card:hover,
.corporate-service-card:hover {
    transform: translateY(-8px) scale(1.02) translateZ(0);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ===== Image Hover - Smooth Scale ===== */
.service-card img,
.destination-card img,
.package-card img,
.package-image img,
.destination-image img {
    transition: transform 0.6s var(--apple-ease);
    will-change: transform;
}

.service-card:hover img,
.destination-card:hover img,
.package-card:hover img,
.package-image:hover img,
.destination-image:hover img {
    transform: scale(1.08) translateZ(0);
}

/* ===== Button - Apple-Style Interactions ===== */
.btn,
.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s var(--apple-spring),
                box-shadow 0.3s var(--apple-spring),
                background 0.3s var(--apple-ease);
    will-change: transform, box-shadow;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px) scale(1.03) translateZ(0);
    box-shadow: 0 10px 30px rgba(201, 169, 97, 0.3);
}

.btn:active,
.btn-primary:active,
.btn-secondary:active {
    transform: translateY(0) scale(0.98) translateZ(0);
    box-shadow: 0 5px 15px rgba(201, 169, 97, 0.2);
}

/* ===== Apple Ripple Effect ===== */
.btn::before,
.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s var(--apple-ease), 
                height 0.5s var(--apple-ease);
}

.btn:active::before,
.btn-primary:active::before,
.btn-secondary:active::before {
    width: 300px;
    height: 300px;
}

/* ===== Navigation - Smooth Background ===== */
.navbar {
    transition: background 0.4s var(--apple-ease),
                backdrop-filter 0.4s var(--apple-ease),
                box-shadow 0.4s var(--apple-ease);
    will-change: background, backdrop-filter;
}

.navbar.scrolled {
    background: rgba(250, 249, 246, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* ===== Nav Links - Subtle Hover ===== */
.nav-link {
    position: relative;
    transition: color 0.3s var(--apple-ease);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-champagne);
    transform: translateX(-50%);
    transition: width 0.3s var(--apple-ease);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ===== Statistics Counter - Smooth Count ===== */
.stat-number {
    transition: transform 0.3s var(--apple-spring);
    will-change: transform;
}

.trust-stat:hover .stat-number {
    transform: scale(1.1) translateZ(0);
}

/* ===== Image Loading - Apple Fade ===== */
img {
    opacity: 0;
    transition: opacity 0.6s var(--apple-ease);
}

img.loaded,
img[src] {
    opacity: 1;
}

/* ===== Form Inputs - Smooth Focus ===== */
.form-input,
.form-textarea,
.form-select {
    transition: border-color 0.3s var(--apple-ease),
                box-shadow 0.3s var(--apple-ease),
                transform 0.3s var(--apple-ease);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--color-champagne);
    box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.1);
    transform: translateY(-2px) translateZ(0);
}

/* ===== Testimonial Card - Elegant Entry ===== */
.testimonial-card {
    opacity: 0;
    transform: scale(0.95) translateY(30px) translateZ(0);
    transition: opacity 0.8s var(--apple-ease),
                transform 0.8s var(--apple-ease);
}

.testimonial-card.visible {
    opacity: 1;
    transform: scale(1) translateY(0) translateZ(0);
}

/* ===== CTA Section - Zoom Effect ===== */
.cta-section {
    opacity: 0;
    transform: scale(0.97) translateZ(0);
    transition: opacity 0.9s var(--apple-ease),
                transform 0.9s var(--apple-ease);
}

.cta-section.visible {
    opacity: 1;
    transform: scale(1) translateZ(0);
}

/* ===== Footer - Smooth Entry ===== */
.footer {
    opacity: 0;
    transform: translateY(40px) translateZ(0);
    transition: opacity 0.8s var(--apple-ease),
                transform 0.8s var(--apple-ease);
}

.footer.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

/* ===== Staggered Grid Animation ===== */
.services-grid > *,
.packages-grid > *,
.destinations-grid > * {
    opacity: 0;
    transform: translateY(40px) scale(0.95) translateZ(0);
    transition: opacity 0.7s var(--apple-ease),
                transform 0.7s var(--apple-ease);
}

.services-grid.visible > *:nth-child(1),
.packages-grid.visible > *:nth-child(1),
.destinations-grid.visible > *:nth-child(1) {
    transition-delay: 0.1s;
}

.services-grid.visible > *:nth-child(2),
.packages-grid.visible > *:nth-child(2),
.destinations-grid.visible > *:nth-child(2) {
    transition-delay: 0.2s;
}

.services-grid.visible > *:nth-child(3),
.packages-grid.visible > *:nth-child(3),
.destinations-grid.visible > *:nth-child(3) {
    transition-delay: 0.3s;
}

.services-grid.visible > *:nth-child(4),
.packages-grid.visible > *:nth-child(4),
.destinations-grid.visible > *:nth-child(4) {
    transition-delay: 0.4s;
}

.services-grid.visible > *:nth-child(5),
.packages-grid.visible > *:nth-child(5),
.destinations-grid.visible > *:nth-child(5) {
    transition-delay: 0.5s;
}

.services-grid.visible > *:nth-child(6),
.packages-grid.visible > *:nth-child(6),
.destinations-grid.visible > *:nth-child(6) {
    transition-delay: 0.6s;
}

.services-grid.visible > *,
.packages-grid.visible > *,
.destinations-grid.visible > * {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
}

/* ===== Icon Animations ===== */
.service-icon i,
.corporate-service-icon i {
    transition: transform 0.5s var(--apple-spring),
                color 0.3s var(--apple-ease);
}

.service-card:hover .service-icon i,
.corporate-service-card:hover .corporate-service-icon i {
    transform: scale(1.15) rotate(5deg) translateZ(0);
    color: var(--color-champagne);
}

/* ===== Back to Top - Apple Style ===== */
.back-to-top {
    transition: all 0.4s var(--apple-spring);
    will-change: transform, opacity;
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.1) translateZ(0);
    box-shadow: 0 8px 24px rgba(201, 169, 97, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px) scale(1.05) translateZ(0);
}

/* ===== Smooth Section Transitions ===== */
section {
    transition: opacity 0.6s var(--apple-ease);
}

/* ===== Link Hover - Subtle Color ===== */
a {
    transition: color 0.3s var(--apple-ease),
                opacity 0.3s var(--apple-ease);
}

/* ===== Mobile Menu - Smooth Slide ===== */
.nav-menu {
    transition: transform 0.4s var(--apple-spring),
                opacity 0.4s var(--apple-ease);
    will-change: transform, opacity;
}

.nav-menu.active {
    transform: translateX(0) translateZ(0);
}

/* ===== Destination Overlay - Smooth Reveal ===== */
.destination-overlay,
.package-overlay {
    transition: opacity 0.4s var(--apple-ease),
                transform 0.4s var(--apple-ease);
    will-change: opacity, transform;
}

.destination-card:hover .destination-overlay,
.package-card:hover .package-overlay {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

/* ===== FAQ Items - Smooth Expand ===== */
.faq-item {
    transition: background 0.3s var(--apple-ease),
                box-shadow 0.3s var(--apple-ease);
}

.faq-item:hover {
    background: rgba(201, 169, 97, 0.05);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* ===== Logo Animation ===== */
.logo img {
    transition: transform 0.4s var(--apple-spring);
}

.logo:hover img {
    transform: scale(1.05) translateZ(0);
}

/* ===== Performance Optimizations ===== */
* {
    will-change: auto;
}

.hero,
.apple-card,
.fade-in-section,
.btn,
.service-card,
.destination-card {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== Reduce Motion Support ===== */
@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;
    }
}

/* ===== Smooth Page Transitions ===== */
.page-transition {
    opacity: 0;
    transform: scale(0.98) translateZ(0);
    animation: pageEntry 0.8s var(--apple-ease) forwards;
}

@keyframes pageEntry {
    0% {
        opacity: 0;
        transform: scale(0.98) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

/* ===== Glass Morphism Effect ===== */
.glass-card {
    background: rgba(250, 249, 246, 0.7);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: background 0.3s var(--apple-ease),
                backdrop-filter 0.3s var(--apple-ease);
}

.glass-card:hover {
    background: rgba(250, 249, 246, 0.85);
    backdrop-filter: saturate(200%) blur(25px);
    -webkit-backdrop-filter: saturate(200%) blur(25px);
}

/* ===== Text Selection - Apple Style ===== */
::selection {
    background: var(--color-champagne);
    color: white;
}

::-moz-selection {
    background: var(--color-champagne);
    color: white;
}

/* ===== Smooth Webkit Scrollbar ===== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-champagne);
    border-radius: 6px;
    transition: background 0.3s var(--apple-ease);
}

::-webkit-scrollbar-thumb:hover {
    background: #B89647;
}

/* ===== Loading States ===== */
.loading-skeleton {
    background: linear-gradient(
        90deg,
        rgba(250, 249, 246, 0.1) 0%,
        rgba(201, 169, 97, 0.1) 50%,
        rgba(250, 249, 246, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s var(--apple-ease) infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
