/* ========================================
   STEVE PEST CONTROL SERVICES
   Custom Styles & Animations
   ======================================== */

/* ---- Scroll Behavior ---- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

/* ---- Selection ---- */
::selection {
    background-color: #16a34a;
    color: white;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #166534;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #14532d;
}

/* ---- Navigation States ---- */
.nav-scrolled {
    background-color: rgba(5, 46, 22, 0.97) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-scrolled .nav-logo-text {
    color: #ffffff;
}

/* ---- Slow bounce animation ---- */
@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 2.5s ease-in-out infinite;
}

/* ---- Pest Card Shine Effect ---- */
.pest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(250, 204, 21, 0.05),
        transparent
    );
    transition: left 0.5s ease;
}

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

/* ---- Mobile Menu Animation ---- */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.active {
    max-height: 500px;
    opacity: 1;
}

/* ---- Focus Styles ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* ---- Smooth Image Loading ---- */
img {
    transition: opacity 0.3s ease;
}

img[loading] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* ---- Card hover elevation ---- */
article:hover {
    transform: translateY(-2px);
}

/* ---- Back to top button visibility ---- */
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* ---- WhatsApp float entrance ---- */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#whatsapp-float {
    animation: slide-up 0.5s ease 1s both;
}

/* ---- Form Success Animation ---- */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#form-success:not(.hidden) {
    animation: fade-in 0.4s ease;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ---- Print styles ---- */
@media print {
    nav,
    #whatsapp-float,
    #back-to-top {
        display: none !important;
    }
    section {
        break-inside: avoid;
    }
}