/* ===================================
   IL GIRASOLE B&B - ANIMATIONS
   Premium Effects & Animations
   =================================== */

/* ===================================
   LOADING SCREEN
   =================================== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1E6091 0%, #154A6E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader__content {
    text-align: center;
}

.loader__sunflower {
    margin-bottom: 2rem;
}

/* Animated Sunflower */
.sunflower {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.sunflower__center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #8B4513 0%, #654321 100%);
    border-radius: 50%;
    z-index: 2;
}

.sunflower__petals {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotateSunflower 8s linear infinite;
}

.sunflower__petals span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 45px;
    background: linear-gradient(to top, #E8B923, #F5D76E);
    border-radius: 50% 50% 50% 50% / 80% 80% 20% 20%;
    transform-origin: center bottom;
}

.sunflower__petals span:nth-child(1) { transform: translate(-50%, -100%) rotate(0deg); }
.sunflower__petals span:nth-child(2) { transform: translate(-50%, -100%) rotate(45deg); }
.sunflower__petals span:nth-child(3) { transform: translate(-50%, -100%) rotate(90deg); }
.sunflower__petals span:nth-child(4) { transform: translate(-50%, -100%) rotate(135deg); }
.sunflower__petals span:nth-child(5) { transform: translate(-50%, -100%) rotate(180deg); }
.sunflower__petals span:nth-child(6) { transform: translate(-50%, -100%) rotate(225deg); }
.sunflower__petals span:nth-child(7) { transform: translate(-50%, -100%) rotate(270deg); }
.sunflower__petals span:nth-child(8) { transform: translate(-50%, -100%) rotate(315deg); }

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

.loader__text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.3s forwards;
}

.loader__bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader__progress {
    height: 100%;
    background: linear-gradient(90deg, #E8B923, #F5D76E);
    border-radius: 2px;
    animation: loadProgress 1.5s ease forwards;
}

@keyframes loadProgress {
    from { width: 0%; }
    to { width: 100%; }
}

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

/* ===================================
   SCROLL PROGRESS BAR
   =================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #E8B923, #F5D76E, #E8B923);
    background-size: 200% 100%;
    width: 0%;
    z-index: 10001;
    transition: width 0.1s ease;
    animation: shimmer 2s linear infinite;
}

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

/* ===================================
   FLOATING WHATSAPP BUTTON
   =================================== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

.whatsapp-float__tooltip {
    position: absolute;
    right: 70px;
    background: #333;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.whatsapp-float__tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-left-color: #333;
}

.whatsapp-float:hover .whatsapp-float__tooltip {
    opacity: 1;
    visibility: visible;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
}

/* ===================================
   PARALLAX HERO
   =================================== */
.hero {
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

.hero__content {
    animation: heroFadeIn 1s ease 1.5s both;
}

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

.hero__title {
    animation: titleReveal 1.2s ease 1.7s both;
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.9);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* ===================================
   SCROLL REVEAL ANIMATIONS
   =================================== */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Staggered animations for grid items */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ===================================
   3D TILT EFFECT ON CARDS
   =================================== */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(var(--rotateX, 0deg)) rotateY(var(--rotateY, 0deg));
}

.tilt-card__inner {
    transform: translateZ(30px);
    transition: transform 0.3s ease;
}

.tilt-card:hover .tilt-card__inner {
    transform: translateZ(50px);
}

/* ===================================
   ENHANCED ROOM CARDS
   =================================== */
.room-card {
    position: relative;
    overflow: hidden;
}

.room-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.2),
        transparent
    );
    transition: left 0.5s ease;
    z-index: 1;
}

.room-card:hover::before {
    left: 100%;
}

.room-card__image {
    overflow: hidden;
}

.room-card__image .image-placeholder,
.room-card__image img {
    transition: transform 0.5s ease;
}

.room-card:hover .room-card__image .image-placeholder,
.room-card:hover .room-card__image img {
    transform: scale(1.1);
}

/* ===================================
   SERVICE CARD HOVER EFFECTS
   =================================== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #E8B923, #F5D76E);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover::after {
    transform: scaleX(1);
}

.service-card__icon {
    transition: transform 0.4s ease;
}

.service-card:hover .service-card__icon {
    transform: scale(1.2) rotate(10deg);
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1.2) rotate(10deg); }
    50% { transform: scale(1.3) rotate(-5deg); }
}

/* ===================================
   PLACE CARDS HOVER
   =================================== */
.place-card {
    position: relative;
}

.place-card__image {
    position: relative;
    overflow: hidden;
}

.place-card__image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.5) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.place-card:hover .place-card__image::after {
    opacity: 1;
}

.place-card__image .image-placeholder,
.place-card__image img {
    transition: transform 0.5s ease;
}

.place-card:hover .place-card__image .image-placeholder,
.place-card:hover .place-card__image img {
    transform: scale(1.1);
}

/* ===================================
   REVIEW CARDS
   =================================== */
.review-card {
    transition: all 0.4s ease;
}

.review-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.review-card__stars {
    display: inline-block;
}

.review-card:hover .review-card__stars {
    animation: starTwinkle 0.6s ease;
}

@keyframes starTwinkle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===================================
   BUTTON EFFECTS
   =================================== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn--primary:active,
.btn--outline:active {
    transform: scale(0.98);
}

/* Magnetic button effect placeholder */
.btn-magnetic {
    transition: transform 0.3s ease;
}

/* ===================================
   TEXT ANIMATIONS
   =================================== */
.text-gradient {
    background: linear-gradient(135deg, #E8B923, #1E6091, #E8B923);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradient 3s linear infinite;
}

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

/* ===================================
   FLOATING ELEMENTS
   =================================== */
.float {
    animation: float 6s ease-in-out infinite;
}

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

.float-slow {
    animation: float 8s ease-in-out infinite;
}

.float-fast {
    animation: float 4s ease-in-out infinite;
}

/* ===================================
   CURSOR GLOW (optional)
   =================================== */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(232, 185, 35, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ===================================
   SECTION TRANSITIONS
   =================================== */
.section {
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #E8B923, transparent);
    opacity: 0.5;
}

.section:first-of-type::before {
    display: none;
}

/* ===================================
   IMAGE REVEAL EFFECT
   =================================== */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1E6091;
    z-index: 2;
    transform-origin: right;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.image-reveal.revealed::before {
    transform: scaleX(0);
}

/* ===================================
   COUNTER ANIMATION
   =================================== */
.counter {
    font-variant-numeric: tabular-nums;
}

/* ===================================
   SMOOTH SCROLL INDICATOR
   =================================== */
.scroll-down {
    animation: scrollBounce 2s ease infinite;
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-7px);
    }
}

/* ===================================
   LOADING STATES
   =================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease infinite;
}

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

/* ===================================
   MOBILE OPTIMIZATIONS
   =================================== */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .whatsapp-float__tooltip {
        display: none;
    }

    /* Reduce animations on mobile for performance */
    .parallax {
        background-attachment: scroll;
    }

    .cursor-glow {
        display: none;
    }
}

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

    .loader {
        display: none;
    }

    .scroll-progress {
        display: none;
    }
}
