/**
 * Home Page Styles
 * Custom styles specifically for Templates/page/home.php
 * Uses scoped selectors to avoid conflicts with other CSS files
 */

/* ============================================
   Scope: Only apply to home.php template
   ============================================ */
main > section {
    position: relative;
}

/* ============================================
   Hero Section (First Section)
   ============================================ */
main > section:first-of-type {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

/* Hero Background Image */
main > section:first-of-type .absolute.inset-0.opacity-20 {
    z-index: 0;
}

main > section:first-of-type .absolute.inset-0.opacity-20 > div {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hero Badge */
main > section:first-of-type .inline-flex.items-center.gap-2.bg-white\/10 {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

main > section:first-of-type .inline-flex.items-center.gap-2.bg-white\/10 .flex.h-2.w-2 {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Hero Title */
main > section:first-of-type h1 {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Hero Subtitle */
main > section:first-of-type .text-xl.md\:text-2xl.lg\:text-3xl {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Hero Description */
main > section:first-of-type .text-base.md\:text-lg.text-white\/80 {
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

/* Hero Buttons - Phone Button */
main > section:first-of-type a[href^="tel:"][data-slot="button"] {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(59, 130, 246, 0.3);
}

main > section:first-of-type a[href^="tel:"][data-slot="button"]:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25), 0 0 25px rgba(59, 130, 246, 0.4);
}

/* Hero Buttons - WhatsApp Button */
main > section:first-of-type a[href^="https://wa.me/"][data-slot="button"] {
    border-width: 2px;
}

main > section:first-of-type a[href^="https://wa.me/"][data-slot="button"]:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

/* Hero Stats Grid */
main > section:first-of-type .grid.grid-cols-2.md\:grid-cols-4 {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

main > section:first-of-type .grid.grid-cols-2.md\:grid-cols-4 > div {
    transition: all 0.3s ease;
}

main > section:first-of-type .grid.grid-cols-2.md\:grid-cols-4 > div:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* Hero Features Grid */
main > section:first-of-type .grid.grid-cols-1.md\:grid-cols-3 {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

main > section:first-of-type .grid.grid-cols-1.md\:grid-cols-3 > div {
    transition: all 0.3s ease;
}

main > section:first-of-type .grid.grid-cols-1.md\:grid-cols-3 > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Scroll CTA */
main > section:first-of-type .flex.flex-col.items-center.gap-2.text-white\/60 {
    transition: all 0.3s ease;
}

main > section:first-of-type .flex.flex-col.items-center.gap-2.text-white\/60:hover {
    transform: translateY(4px);
}

main > section:first-of-type .w-6.h-10.border-2 {
    position: relative;
}

main > section:first-of-type .w-6.h-10.border-2 .w-1\.5.h-3 {
    animation: scroll-bounce 2s infinite;
}

@keyframes scroll-bounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(8px);
        opacity: 0.7;
    }
}

/* ============================================
   Info Section (Second Section)
   ============================================ */
main > section.bg-background {
    position: relative;
}

/* Info Badge */
main > section.bg-background .inline-flex.items-center.gap-2.px-4.py-2.bg-primary\/10 {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Info Cards */
main > section.bg-background .bg-card.rounded-2xl {
    transition: all 0.3s ease;
}

main > section.bg-background .bg-card.rounded-2xl:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Climate Card */
main > section.bg-background .bg-gradient-to-br.from-cyan-50 {
    transition: all 0.3s ease;
}

main > section.bg-background .bg-gradient-to-br.from-cyan-50:hover {
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
}

/* Regulatory Card */
main > section.bg-background .bg-blue-50.rounded-2xl {
    transition: all 0.3s ease;
}

main > section.bg-background .bg-blue-50.rounded-2xl:hover {
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}

/* Impact Stats */
main > section.bg-background .bg-white\/80.rounded-xl {
    transition: all 0.3s ease;
}

main > section.bg-background .bg-white\/80.rounded-xl:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* Info CTA */
main > section.bg-background .mt-12.bg-primary.rounded-2xl {
    transition: all 0.3s ease;
}

main > section.bg-background .mt-12.bg-primary.rounded-2xl:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Services Section (Third Section)
   ============================================ */
main > section.bg-gradient-to-b.from-primary.to-primary\/90 {
    position: relative;
}

/* Services Intro Card */
main > section.bg-gradient-to-b.from-primary.to-primary\/90 .bg-white\/10.backdrop-blur-sm {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

main > section.bg-gradient-to-b.from-primary.to-primary\/90 .bg-white\/10.backdrop-blur-sm:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Services Benefits Cards */
main > section.bg-gradient-to-b.from-primary.to-primary\/90 .grid.md\:grid-cols-3 > div {
    transition: all 0.3s ease;
}

main > section.bg-gradient-to-b.from-primary.to-primary\/90 .grid.md\:grid-cols-3 > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Services Grid Section (#services)
   ============================================ */
#services {
    scroll-margin-top: 80px;
}

#services .text-center.max-w-2xl {
    margin-bottom: 3rem;
}

/* Service Cards */
#services .grid.grid-cols-1.md\:grid-cols-3 > div {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#services .grid.grid-cols-1.md\:grid-cols-3 > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

#services .grid.grid-cols-1.md\:grid-cols-3 > div:hover::before {
    left: 100%;
}

#services .grid.grid-cols-1.md\:grid-cols-3 > div:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: hsl(var(--primary) / 0.5);
}

#services .grid.grid-cols-1.md\:grid-cols-3 > div .w-16.h-16 {
    transition: transform 0.3s ease;
}

#services .grid.grid-cols-1.md\:grid-cols-3 > div:hover .w-16.h-16 {
    transform: scale(1.1) rotate(5deg);
}

/* Service Tags */
#services .flex.flex-wrap.gap-2 > li {
    transition: all 0.2s ease;
}

#services .flex.flex-wrap.gap-2 > li:hover {
    background: hsl(var(--muted));
    transform: scale(1.05);
}

/* ============================================
   FAQ Section
   ============================================ */
[data-slot="accordion"] {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

[data-slot="accordion-item"] {
    transition: all 0.3s ease;
    overflow: hidden;
}

[data-slot="accordion-item"]:hover {
    border-color: hsl(var(--primary) / 0.4);
}

[data-slot="accordion-item"][data-state="open"] {
    border-color: hsl(var(--primary) / 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-slot="accordion-trigger"] {
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

[data-slot="accordion-trigger"]:hover {
    color: hsl(var(--primary));
}

[data-slot="accordion-trigger"] svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

[data-slot="accordion-item"][data-state="open"] [data-slot="accordion-trigger"] svg {
    transform: rotate(180deg);
}

[data-slot="accordion-content"] {
    transition: all 0.3s ease;
}

[data-slot="accordion-content"] p {
    line-height: 1.75;
    color: hsl(var(--muted-foreground));
}

/* ============================================
   Neighborhoods Section (#neighborhoods)
   ============================================ */
#neighborhoods {
    scroll-margin-top: 80px;
}

/* Neighborhood Search */
#neighborhood-search {
    transition: all 0.3s ease;
}

#neighborhood-search:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

/* Neighborhood Filter Buttons */
#neighborhoods .flex.flex-wrap.gap-2 button {
    transition: all 0.2s ease;
}

#neighborhoods .flex.flex-wrap.gap-2 button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#neighborhoods .flex.flex-wrap.gap-2 button.bg-primary {
    box-shadow: 0 4px 12px hsl(var(--primary) / 0.3);
}

/* Neighborhood Cards */
#neighborhoods-grid > div {
    transition: all 0.3s ease;
    cursor: pointer;
}

#neighborhoods-grid > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Load More Button */
#load-more-neighborhoods {
    transition: all 0.3s ease;
}

#load-more-neighborhoods:hover {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Final CTA Section
   ============================================ */
main > section.bg-primary:last-of-type {
    position: relative;
    overflow: hidden;
}

main > section.bg-primary:last-of-type .absolute.inset-0.opacity-10 {
    z-index: 0;
}

main > section.bg-primary:last-of-type .container {
    position: relative;
    z-index: 10;
}

/* Final CTA Buttons */
main > section.bg-primary:last-of-type a[href^="tel:"][data-slot="button"] {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(59, 130, 246, 0.3);
}

main > section.bg-primary:last-of-type a[href^="tel:"][data-slot="button"]:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25), 0 0 25px rgba(59, 130, 246, 0.4);
}

main > section.bg-primary:last-of-type a[href^="https://wa.me/"][data-slot="button"] {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(34, 197, 94, 0.3);
}

main > section.bg-primary:last-of-type a[href^="https://wa.me/"][data-slot="button"]:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25), 0 0 25px rgba(34, 197, 94, 0.4);
}

/* Final CTA Features */
main > section.bg-primary:last-of-type .flex.flex-wrap.items-center.justify-center.gap-6 > div {
    transition: all 0.2s ease;
}

main > section.bg-primary:last-of-type .flex.flex-wrap.items-center.justify-center.gap-6 > div:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

/* ============================================
   Buttons - General Styles
   ============================================ */
main [data-slot="button"] {
    position: relative;
    overflow: hidden;
}

main [data-slot="button"]::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.6s, height 0.6s;
}

main [data-slot="button"]:hover::before {
    width: 300px;
    height: 300px;
}

main [data-slot="button"] span,
main [data-slot="button"] svg {
    position: relative;
    z-index: 1;
}

/* CTA Glow Effect */
main [data-slot="button"].cta-glow {
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 30px rgba(59, 130, 246, 0.5);
    }
}

/* ============================================
   Cards - General Styles
   ============================================ */
main [data-slot="card"] {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

main [data-slot="card"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

main [data-slot="card"]:hover::after {
    opacity: 1;
}

main [data-slot="card"]:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Card Hover Effect */
main .card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

main .card-hover:hover {
    transform: translateY(-8px) scale(1.02);
}

/* ============================================
   Section Padding Utility
   ============================================ */
.section-padding {
    padding: 5rem 1rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 6rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .section-padding {
        padding: 7rem 2rem;
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 767px) {
    /* Hero Section Mobile */
    main > section:first-of-type {
        min-height: 70vh;
        padding: 3rem 1rem;
    }
    
    main > section:first-of-type h1 {
        font-size: 2rem;
    }
    
    main > section:first-of-type .text-xl.md\:text-2xl.lg\:text-3xl {
        font-size: 1.5rem;
    }
    
    /* Buttons Full Width on Mobile */
    main [data-slot="button"] {
        width: 100%;
    }
    
    /* Section Padding Mobile */
    .section-padding {
        padding: 3rem 1rem;
    }
    
    /* Cards Stack on Mobile */
    #services .grid.grid-cols-1.md\:grid-cols-3 > div {
        margin-bottom: 1rem;
    }
}

/* ============================================
   Smooth Scrolling
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================
   Focus States for Accessibility
   ============================================ */
main [data-slot="button"]:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

main [data-slot="accordion-trigger"]:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    main > section:first-of-type .flex.flex-col.items-center.gap-2,
    main [data-slot="button"],
    #load-more-neighborhoods {
        display: none;
    }
    
    main > section {
        page-break-inside: avoid;
    }
}
