/* ============================================
   VILLA PRECIOSA RESORT - Animations & Effects
   Redesigned with Emil Kowalski's Design Engineering Principles
   ============================================ */

/* ─── Custom Easing Curves (Emil Kowalski) ─── */
:root {
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ─── Reveal Animations (Scroll Entry) ─── */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 0;
    will-change: transform, opacity;
}

.reveal-up {
    transform: translateY(32px);
}

.reveal-left {
    transform: translateX(-32px);
}

.reveal-right {
    transform: translateX(32px);
}

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
    opacity: 1;
    transform: translate(0, 0);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

/* Staggered delays - tighter for snappier feel */
[data-delay="50"] { transition-delay: 0.05s; }
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="150"] { transition-delay: 0.15s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="250"] { transition-delay: 0.25s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="350"] { transition-delay: 0.35s; }
[data-delay="400"] { transition-delay: 0.4s; }

/* Scale reveal variant */
.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    will-change: transform, opacity;
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-bounce);
}

/* Blur reveal variant */
.reveal-blur {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(16px);
    will-change: transform, opacity, filter;
}

.reveal-blur.revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), filter 0.8s var(--ease-out);
}

/* ─── Custom Cursor Glow Effect ─── */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(201,168,76,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.cursor-glow.active {
    opacity: 1;
}

/* ─── Button Press Feedback (scale 0.97 on :active) ─── */
.btn,
.btn-primary,
.btn-outline,
.btn-gold,
.header-cta,
.btn-reserve-mobile,
.room-option,
.gallery-item,
.activity-chip,
.social-link,
.testimonial-prev,
.testimonial-next {
    transition: transform 0.16s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.btn:active,
.btn-primary:active,
.btn-outline:active,
.btn-gold:active,
.header-cta:active,
.btn-reserve-mobile:active,
.room-option:active,
.gallery-item:active,
.activity-chip:active,
.social-link:active,
.testimonial-prev:active,
.testimonial-next:active {
    transform: scale(0.97);
}

/* ─── Card Hover Lift ─── */
.room-card,
.activity-showcase-card,
.experience-card {
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.room-card:hover,
.activity-showcase-card:hover,
.experience-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ─── Hero Content Entrance (staggered, spring-like) ─── */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

body.loaded .hero-tag {
    animation: heroFadeUp 0.7s var(--ease-out) 0.2s both;
}

body.loaded .hero-title {
    animation: heroReveal 0.9s var(--ease-out) 0.4s both;
}

body.loaded .hero-subtitle {
    animation: heroFadeUp 0.7s var(--ease-out) 0.6s both;
}

body.loaded .hero-actions {
    animation: heroFadeUp 0.7s var(--ease-out) 0.75s both;
}

/* ─── Text Shimmer Effect ─── */
.hero-title em {
    background: linear-gradient(
        120deg,
        var(--color-gold-light) 0%,
        var(--color-gold) 25%,
        #fff 50%,
        var(--color-gold) 75%,
        var(--color-gold-light) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

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

/* ─── Parallax Tilt for Cards ─── */
.room-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.room-card-content {
    transform: translateZ(20px);
}

/* ─── Floating Elements ─── */
.about-badge {
    animation: float 4s ease-in-out infinite;
}

.yacht-badge {
    animation: floatSlow 6s ease-in-out infinite;
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-6px) rotate(1deg); }
    66% { transform: translateY(-3px) rotate(-0.5deg); }
}

/* ─── Gallery Hover Effects (new overlay system) ─── */
.gallery-item::before {
    display: none;
}

/* ─── Amenity Icon Pulse ─── */
.amenity-icon {
    position: relative;
}

.amenity-item:hover .amenity-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(201,168,76,0.3);
    animation: pulse-ring 1.5s var(--ease-out) infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ─── Activity Chips Wave ─── */
.category-items .activity-chip {
    animation: chipFloat 3s ease-in-out infinite;
}

.category-items .activity-chip:nth-child(2n) { animation-delay: 0.5s; }
.category-items .activity-chip:nth-child(3n) { animation-delay: 1s; }
.category-items .activity-chip:nth-child(4n) { animation-delay: 1.5s; }

@keyframes chipFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.activity-chip:hover {
    animation: none;
}

/* ─── Scroll Progress Bar ─── */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-ocean));
    z-index: 10001;
    width: 0%;
    transition: width 0.1s linear;
}

/* ─── Header Logo Entrance ─── */
.header .logo-icon {
    display: inline-block;
    animation: starSpin 8s linear infinite;
}

@keyframes starSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ─── Room Card Image Overlay on Hover ─── */
.room-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.room-card:hover .room-card-img::after {
    opacity: 1;
}

/* ─── Social Link Hover Effect ─── */
.social-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(201,168,76,0.1);
    transform: scale(0.95);
    transition: transform 0.3s var(--ease-out);
}

.social-link:hover::after {
    transform: scale(1.5);
}

.social-link {
    position: relative;
    overflow: visible;
}

/* ─── Smooth Entrance for Testimonials ─── */
.testimonial-card {
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), visibility 0.6s;
}

.testimonial-card.slide-left {
    transform: translateX(-60px);
    opacity: 0;
}

.testimonial-card.slide-right {
    transform: translateX(60px);
    opacity: 0;
}

/* ─── Gold Underline Effect ─── */
.section-title {
    position: relative;
    display: inline-block;
}

.text-center .section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--color-gold);
}

/* ─── Contact Form Focus Glow ─── */
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--color-ocean);
    box-shadow: 0 0 0 4px rgba(26,107,138,0.08), 0 4px 16px rgba(26,107,138,0.06);
}

/* ─── Footer Link Hover ─── */
.footer-list a {
    position: relative;
}

.footer-list a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-gold);
    transition: width 200ms var(--ease-out);
}

.footer-list a:hover::after {
    width: 100%;
}

/* ─── Grain Texture Overlay (subtle) ─── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

/* ─── Smooth Page Transitions ─── */
.section {
    will-change: transform;
}

/* ─── Contact Items ─── */
.contact-item {
    transition: transform 0.3s var(--ease-out);
}

.contact-item:hover {
    transform: translateX(4px);
}

.contact-item:hover i {
    background: var(--color-gold);
    color: var(--color-white);
}

/* ─── EXPLORE SECTION - Clean Animations ─── */

/* Card hover lift */
.bento-card {
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out), border-color 0.5s var(--ease-out);
}

/* Image zoom on hover */
.bento-img-wrapper img {
    transition: transform 0.7s var(--ease-out);
}

.bento-card:hover .bento-img-wrapper img {
    transform: scale(1.08);
}

/* Tag hover effect */
.bento-tag {
    transition: background 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.bento-card:hover .bento-tag {
    background: rgba(201,168,76,0.35);
    transform: translateY(-1px);
}

/* Button hover */
.btn-neon {
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), background-color 0.4s var(--ease-out);
}

.btn-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201,168,76,0.3);
}

.btn-neon:active {
    transform: scale(0.97);
}

.btn-ghost-glass {
    transition: transform 0.4s var(--ease-out), background 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}

.btn-ghost-glass:hover {
    transform: translateY(-2px);
}

.btn-ghost-glass:active {
    transform: scale(0.97);
}

/* Grid fade in */
@keyframes fadeGrid {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pulse dot */
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.6); }
    50% { box-shadow: 0 0 0 8px rgba(201,168,76,0); }
}

/* Orb float */
@keyframes exploreOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-80px, 60px) scale(1.15); }
}

@keyframes exploreOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, -40px) scale(1.1); }
}

/* ─── Stagger Children Animation ─── */
.stagger-children > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.stagger-children.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.revealed > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.revealed > *:nth-child(8) { transition-delay: 0.4s; }

/* ─── Smooth Section Transition ─── */
.section {
    transition: background-color 0.6s var(--ease-out);
}

/* ─── Image Reveal on Scroll ─── */
.img-reveal {
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.9s var(--ease-out);
}

.img-reveal.revealed {
    clip-path: inset(0 0 0% 0);
}

/* ─── Responsive Animation Adjustments ─── */
@media (max-width: 768px) {
    .cursor-glow { display: none; }
    .activity-chip { animation: none !important; }

    .reveal-up { transform: translateY(20px); }
    .reveal-left { transform: translateX(-20px); }
    .reveal-right { transform: translateX(20px); }
    
    .reveal-up.revealed,
    .reveal-left.revealed,
    .reveal-right.revealed {
        transition-duration: 0.5s;
    }
}

/* prefers-reduced-motion: reduce motion, not eliminate it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal-up,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-blur,
    .img-reveal {
        opacity: 1;
        transform: none;
        filter: none;
        clip-path: none;
    }
}
