/* ============================================
   JB's Plumbing Repair Services — Custom Styles
   ============================================ */

/* Base reset & smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f0f7;
}
::-webkit-scrollbar-thumb {
    background: #d6c4e0;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ba9ecb;
}

/* Selection color */
::selection {
    background: #d6c4e0;
    color: #39234f;
}

/* ============================================
   Floating animations for hero cards
   ============================================ */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

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

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

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

/* ============================================
   Navbar styles
   ============================================ */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(107, 63, 160, 0.08);
}

#navbar.scrolled .font-display {
    color: #39234f;
}

/* ============================================
   Service card hover effects
   ============================================ */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6B3FA0, #E89E1E);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* ============================================
   Gallery hover effects
   ============================================ */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(57, 35, 79, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ============================================
   Scroll reveal animations (progressive enhancement)
   Only applied when JS is available and user
   prefers motion. Default state is visible.
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Default state for JS-gated reveals is also visible */
    .reveal-on-scroll {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Mobile menu transitions
   ============================================ */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

#mobile-menu.open {
    max-height: 500px;
    padding-top: 0;
}

.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ebe0f0;
}

.mobile-link:last-child {
    border-bottom: none;
}

/* ============================================
   Form select dropdown arrow
   ============================================ */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%236B3FA0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ============================================
   Responsive adjustments
   ============================================ */
@media (max-width: 767px) {
    .font-display {
        line-height: 1.15;
    }
    
    #hero h1 {
        font-size: 2.75rem;
    }
    
    #hero h1 span {
        display: block;
    }
    
    .animate-float,
    .animate-float-delayed {
        animation: none;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #hero h1 {
        font-size: 3.5rem;
    }
}

/* ============================================
   Focus visible for accessibility
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #6B3FA0;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Print styles
   ============================================ */
@media print {
    #navbar,
    .animate-float,
    .animate-float-delayed {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
