/* Custom Styles for GreenHaven Villa Website */

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

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Floating animation for decorative elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-float-delay-1 {
    animation: float 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

.animate-float-delay-2 {
    animation: float 3s ease-in-out infinite;
    animation-delay: 1s;
}

/* ==================== PREMIUM HERO ANIMATIONS ==================== */

/* Subtle parallax effect for hero background */
@keyframes subtleParallax {
    0% {
        transform: scale(1.05) translateY(0);
    }
    100% {
        transform: scale(1.05) translateY(-10px);
    }
}

.hero-parallax {
    animation: subtleParallax 20s ease-in-out infinite alternate;
}

/* Soft mist/ambience overlay animation */
@keyframes mistFlow {
    0% {
        opacity: 0.1;
        transform: translateX(0) translateY(0);
    }
    50% {
        opacity: 0.15;
        transform: translateX(20px) translateY(-10px);
    }
    100% {
        opacity: 0.1;
        transform: translateX(0) translateY(0);
    }
}

.mist-overlay {
    animation: mistFlow 15s ease-in-out infinite;
}

/* Gentle floating eco-icons (leaf/wind) */
@keyframes ecoFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-2px) rotate(2deg);
        opacity: 0.8;
    }
}

.eco-icon-float {
    animation: ecoFloat 4s ease-in-out infinite;
}

.eco-icon-float-delay-1 {
    animation: ecoFloat 4.5s ease-in-out infinite;
    animation-delay: 0.8s;
}

.eco-icon-float-delay-2 {
    animation: ecoFloat 5s ease-in-out infinite;
    animation-delay: 1.6s;
}

/* Glassmorphism floating cards animation */
@keyframes floatCard {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.glass-card-float {
    animation: floatCard 6s ease-in-out infinite;
}

.glass-card-float-delay-1 {
    animation: floatCard 6s ease-in-out infinite;
    animation-delay: 0.5s;
}

.glass-card-float-delay-2 {
    animation: floatCard 6s ease-in-out infinite;
    animation-delay: 1s;
}

.glass-card-float-delay-3 {
    animation: floatCard 6s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Badge shimmer effect */
@keyframes badgeShimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.badge-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: badgeShimmer 3s ease-in-out infinite;
}

/* ==================== SMOOTH SCROLLING ==================== */

html {
    scroll-behavior: smooth;
}

/* ==================== CUSTOM SCROLLBAR ==================== */

::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #1f3d2b;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d5941;
}

/* ==================== TYPOGRAPHY ENHANCEMENTS ==================== */

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

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

/* ==================== IMAGE LOADING ==================== */

img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

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

/* Smooth transitions for all interactive elements */
a, button {
    transition: all 0.3s ease;
}

/* ==================== MODAL OVERLAY ==================== */

.modal-overlay {
    backdrop-filter: blur(8px);
}

/* ==================== GALLERY MASONRY FIXES ==================== */

/* Prevent column breaks inside items */
.columns-1 > *,
.columns-2 > *,
.columns-3 > * {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* ==================== ELEVATED NATURE GRID ANIMATIONS ==================== */

/* Slow zoom-in effect for amenity cards */
.amenity-card-image {
    transition: transform 0.4s ease-out;
}

.amenity-card:hover .amenity-card-image {
    transform: scale(1.08);
}

/* Overlay darkening on hover */
.amenity-card-overlay {
    transition: background 0.4s ease-out, backdrop-filter 0.4s ease-out;
}

.amenity-card:hover .amenity-card-overlay {
    background: linear-gradient(to top, rgba(31, 61, 43, 0.85), rgba(31, 61, 43, 0.3), transparent) !important;
    backdrop-filter: blur(8px);
}

/* Floating shadow effect */
.amenity-card {
    transition: box-shadow 0.4s ease-out, transform 0.4s ease-out;
    box-shadow: 0 4px 20px rgba(31, 61, 43, 0.08);
}

.amenity-card:hover {
    box-shadow: 0 12px 40px rgba(31, 61, 43, 0.15);
    transform: translateY(-8px);
}

/* Nature icon subtle float */
@keyframes natureIconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-3px) rotate(5deg);
    }
}

.nature-icon {
    animation: natureIconFloat 3s ease-in-out infinite;
}

/* ==================== FIND US SECTION ANIMATIONS ==================== */

/* Fade-in animation for map */
@keyframes fadeInMap {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.map-container {
    animation: fadeInMap 0.8s ease-out forwards;
}

/* Slide-in animation for floating info card */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.floating-info-card {
    animation: slideInFromLeft 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

/* Fade-in up for info grid items */
@keyframes fadeInUpGrid {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-grid-item {
    animation: fadeInUpGrid 0.6s ease-out forwards;
    opacity: 0;
}

.info-grid-item:nth-child(1) { animation-delay: 0.2s; }
.info-grid-item:nth-child(2) { animation-delay: 0.3s; }
.info-grid-item:nth-child(3) { animation-delay: 0.4s; }
.info-grid-item:nth-child(4) { animation-delay: 0.5s; }

/* Hover scaling for grid items */
.info-grid-item {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.info-grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(31, 61, 43, 0.12);
}

/* ==================== REFINED PREMIUM STYLING ==================== */

/* Premium map container with enhanced shadow */
.premium-map-container {
    box-shadow:
        0 20px 60px rgba(31, 61, 43, 0.08),
        0 10px 30px rgba(31, 61, 43, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    border-radius: 2.5rem; /* 40px */
}

/* Enhanced glassmorphism for info card */
.premium-glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 8px 32px rgba(31, 61, 43, 0.12),
        0 2px 8px rgba(31, 61, 43, 0.08);
}

/* Feature card with gradient background */
.premium-feature-card {
    background: linear-gradient(135deg, #ffffff 0%, #faf9f7 100%);
    box-shadow:
        0 4px 16px rgba(31, 61, 43, 0.06),
        0 2px 8px rgba(31, 61, 43, 0.04);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 12px 32px rgba(31, 61, 43, 0.12),
        0 4px 16px rgba(31, 61, 43, 0.08);
}

/* Enhanced icon container */
.premium-icon-container {
    background: linear-gradient(135deg, rgba(168, 184, 150, 0.15) 0%, rgba(168, 184, 150, 0.25) 100%);
    transition: all 0.3s ease-out;
}

.premium-feature-card:hover .premium-icon-container {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, rgba(168, 184, 150, 0.25) 0%, rgba(168, 184, 150, 0.35) 100%);
}

/* Premium CTA button enhancement */
.premium-cta-button {
    box-shadow:
        0 8px 24px rgba(29, 75, 51, 0.25),
        0 4px 12px rgba(29, 75, 51, 0.15);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-cta-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 16px 40px rgba(29, 75, 51, 0.35),
        0 8px 20px rgba(29, 75, 51, 0.2);
}

/* Vertical separator line */
.premium-separator {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(31, 61, 43, 0.1) 20%,
        rgba(31, 61, 43, 0.15) 50%,
        rgba(31, 61, 43, 0.1) 80%,
        transparent 100%
    );
}

/* ==================== CUSTOM UTILITIES ==================== */

/* Glass morphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #1f3d2b 0%, #a8b896 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Shadow elevations */
.shadow-soft {
    box-shadow: 0 4px 20px rgba(31, 61, 43, 0.08);
}

.shadow-medium {
    box-shadow: 0 8px 30px rgba(31, 61, 43, 0.12);
}

.shadow-strong {
    box-shadow: 0 12px 40px rgba(31, 61, 43, 0.16);
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Reduce font sizes on mobile */
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 2rem;
        line-height: 1.3;
    }

    /* Adjust spacing for mobile */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Desktop enhancements */
@media (min-width: 1024px) {
    /* Smooth parallax effect on hover for cards */
    .hover-lift {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .hover-lift:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(31, 61, 43, 0.15);
    }
}

/* ==================== ACCESSIBILITY ==================== */

/* Focus states for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #1f3d2b;
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@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;
    }
}

/* ==================== PRINT STYLES ==================== */

@media print {
    /* Hide navigation and interactive elements when printing */
    nav,
    footer,
    button,
    .no-print {
        display: none !important;
    }

    /* Ensure good contrast for printing */
    body {
        background: white;
        color: black;
    }

    /* Page breaks */
    section {
        page-break-inside: avoid;
    }
}

/* ==================== CUSTOM FORM STYLES ==================== */

/* Remove default form styles and apply custom ones */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Placeholder styling */
::placeholder {
    color: rgba(31, 61, 43, 0.5);
    opacity: 1;
}

:-ms-input-placeholder {
    color: rgba(31, 61, 43, 0.5);
}

::-ms-input-placeholder {
    color: rgba(31, 61, 43, 0.5);
}

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

/* Image lazy loading placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f5efe6 0%, #e8dfd0 50%, #f5efe6 100%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

/* ==================== SELECTION STYLING ==================== */

::selection {
    background-color: #1f3d2b;
    color: #f5efe6;
}

::-moz-selection {
    background-color: #1f3d2b;
    color: #f5efe6;
}

/* ==================== BORDER RADIUS CONSISTENCY ==================== */

/* Apply consistent border radius to all rounded elements */
.rounded-custom {
    border-radius: 12px;
}

/* ==================== Z-INDEX MANAGEMENT ==================== */

/* Ensure proper stacking order */
.z-modal {
    z-index: 9999;
}

.z-nav {
    z-index: 1000;
}

.z-dropdown {
    z-index: 100;
}

/* ==================== CUSTOM GRID GAPS ==================== */

/* Custom gap utilities for specific layouts */
.gap-custom {
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .gap-custom {
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .gap-custom {
        gap: 3rem;
    }
}

/* ==================== UNIFIED LOCATION CARD STYLING ==================== */

/* Ensure map takes full height in unified card layout */
#map {
    min-height: 100%;
}

/* Smooth scrollbar for location list */
.flex-1.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

.flex-1.overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(31, 61, 43, 0.05);
    border-radius: 3px;
}

.flex-1.overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(31, 61, 43, 0.2);
    border-radius: 3px;
}

.flex-1.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(31, 61, 43, 0.3);
}

/* ==================== LAZY LOADING IMAGE OPTIMIZATION ==================== */

/* Lazy image placeholder with blur-up effect */
.lazy-image {
    background: linear-gradient(135deg, #f5efe6 0%, #e8dfd0 50%, #f5efe6 100%);
    background-size: 200% 200%;
    animation: shimmer 1.5s ease-in-out infinite;
    filter: blur(10px);
    transform: scale(1.05);
    transition: filter 0.5s ease-out, transform 0.5s ease-out, opacity 0.5s ease-out;
    opacity: 0;
}

.lazy-image.loaded {
    filter: blur(0);
    transform: scale(1);
    background: none;
    opacity: 1;
}

/* Shimmer animation for loading placeholder */
@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Intersection Observer fallback */
.lazy-image[src] {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}
