/* ============================================================
   SPACESCOUT PREMIUM ANIMATIONS & MICRO-INTERACTIONS
   Strictly Non-Destructive Enhancements to Existing UI/UX
   ============================================================ */

/* 1. Global Smooth Transition Defaults & Scroll Experience */
html {
    scroll-behavior: smooth;
}

/* Page entrance */
body {
    opacity: 0;
    animation: pageEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageEntrance {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 2. Scroll-Triggered Reveal Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.slide-right {
    transform: translateX(-30px);
}

.reveal-on-scroll.slide-left {
    transform: translateX(30px);
}

.reveal-on-scroll.scale-up {
    transform: scale(0.94);
}

.reveal-on-scroll.is-visible {
    opacity: 1 !important;
    transform: translateY(0) translateX(0) scale(1) !important;
}

/* Staggered Delay Utilities */
.stagger-group > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-group > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-group > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-group > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-group > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-group > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-group > *:nth-child(7) { transition-delay: 0.47s; }
.stagger-group > *:nth-child(8) { transition-delay: 0.54s; }

/* 3. Image Animations & Hover Interactions */
img {
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.district-card img,
.location-item img,
.category-card-img img,
.property-thumb img,
.cart-item-img,
.blog-card img,
.blog-card-img img,
.blog-item img,
.post-card img,
.srv-card-img img,
.team-card img,
.about-team-card img,
.property-detail-gallery img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease !important;
}

/* Subtle image hover zoom */
.district-card:hover img,
.location-item:hover img,
.category-card:hover .category-card-img img,
.property-card:hover .property-thumb img,
.blog-card:hover img,
.blog-card:hover .blog-card-img img,
.blog-item:hover img,
.post-card:hover img,
.srv-card:hover img,
.about-team-card:hover img {
    transform: scale(1.07) !important;
}

/* 4. Existing Cards Hover Lift & Elevation */
.property-card,
.property-item,
.prop-card,
.district-card,
.category-card,
.location-item,
.feature-card,
.srv-card,
.service-card,
.t-slide-card,
.blog-card,
.blog-item,
.post-card,
.team-card,
.about-team-card,
.about-stat-card,
.about-values-card,
.about-excellence-card,
.about-timeline-item,
.faq-card,
.srv-stat-card,
.hero-stat-item,
.cart-item-card,
.contact-card,
.cms-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease !important;
    will-change: transform, box-shadow;
}

.property-card:hover,
.property-item:hover,
.prop-card:hover,
.district-card:hover,
.category-card:hover,
.location-item:hover,
.feature-card:hover,
.srv-card:hover,
.service-card:hover,
.t-slide-card:hover,
.blog-card:hover,
.blog-item:hover,
.post-card:hover,
.team-card:hover,
.about-team-card:hover,
.about-stat-card:hover,
.about-values-card:hover,
.about-excellence-card:hover,
.about-timeline-item:hover,
.faq-card:hover,
.srv-stat-card:hover,
.hero-stat-item:hover,
.contact-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 18px 38px -8px rgba(0, 0, 0, 0.14), 0 6px 14px -4px rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(200, 164, 93, 0.35) !important;
}

/* 5. Buttons Micro-Interactions */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-wa,
.btn-gold,
.btn-search,
.save-btn,
a.btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, border-color 0.25s ease !important;
    will-change: transform, box-shadow;
}

button:hover,
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-wa:hover,
.btn-gold:hover,
.btn-search:hover,
.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

button:active,
.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-wa:active,
.btn-gold:active,
.btn-search:active,
.save-btn:active {
    transform: translateY(0) scale(0.98) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Subtle Shimmer for Primary / WhatsApp / Search buttons */
.btn-wa::after,
.btn-primary::after,
.btn-gold::after,
.btn-search::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    transition: none;
    pointer-events: none;
}

.btn-wa:hover::after,
.btn-primary:hover::after,
.btn-gold:hover::after,
.btn-search:hover::after {
    animation: btnShimmer 1.1s ease-in-out;
}

@keyframes btnShimmer {
    0% { left: -60%; }
    100% { left: 140%; }
}

/* 6. Navigation Interactions */
#main-header {
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease !important;
}

#main-header.scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18) !important;
}

.header-links a,
.nav-link,
.dropdown-item {
    position: relative;
    transition: color 0.25s ease, opacity 0.25s ease !important;
}

.header-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--accent-gold, #C8A45D);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
}

.header-links a:hover::after {
    width: 100%;
    left: 0;
}

.side-drawer {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease !important;
}

.drawer-overlay {
    transition: opacity 0.35s ease, visibility 0.35s ease, backdrop-filter 0.35s ease !important;
}

/* 7. Numbers / Statistics Counter Smoothness */
.hero-stat-number,
.srv-stat-num,
.about-stat-number,
.about-stat-num,
.stat-number,
.count-up {
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease;
    font-variant-numeric: tabular-nums;
}

/* 8. Icon Hover Micro-Interactions */
svg,
.icon-box,
.feature-icon,
.badge-icon,
.srv-icon {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s ease, fill 0.3s ease !important;
}

a:hover svg,
button:hover svg,
.feature-card:hover .feature-icon,
.srv-card:hover .srv-icon,
.hero-stat-item:hover svg,
.about-stat-card:hover svg {
    transform: scale(1.12) translateY(-2px);
}

/* 9. Text & Heading Animations */
.hero-title,
.section-title,
.page-title,
.about-hero-heading,
.about-vision-heading {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* 10. Forms / Inputs Focus Interactions */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea,
.search-input,
.form-control {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus,
.search-input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--accent-gold, #C8A45D) !important;
    box-shadow: 0 0 0 4px rgba(200, 164, 93, 0.18) !important;
    transform: translateY(-1px);
}

/* Reduced Motion Accessibility */
@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;
    }
    body {
        opacity: 1 !important;
        animation: none !important;
    }
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}
