/* ========================================
   La Jolla Volunteer Fire Department
   Custom Styles
======================================== */

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

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background: rgba(15, 185, 138, 0.3);
    color: #ffffff;
}

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

#navbar.scrolled {
    background: rgba(5, 16, 24, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #0fb98a;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ========================================
   Mobile Menu
======================================== */
#mobile-menu {
    left: 0;
    right: 0;
}

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }

/* ========================================
   Reveal Animations
======================================== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for children */
.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

/* ========================================
   Service Cards
======================================== */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.5s ease,
                background 0.5s ease;
}

.service-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Buttons
======================================== */
button, a[type="submit"] {
    cursor: pointer;
}

/* ========================================
   Form Styles
======================================== */
input:focus, select:focus, textarea:focus {
    outline: none;
}

/* ========================================
   Scrollbar
======================================== */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #1e4a66;
    border-radius: 4px;
}

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

/* ========================================
   Reduced Motion
======================================== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .reveal,
    .service-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .nav-link::after {
        display: none;
    }
    
    #mobile-menu .mobile-link {
        opacity: 1;
        transform: none;
        transition-delay: 0s;
    }
}

/* ========================================
   Mobile Responsiveness
======================================== */
@media (max-width: 767px) {
    .font-serif.text-5xl,
    .font-serif.text-6xl {
        font-size: 2.5rem;
        line-height: 1.1;
    }
}

/* ========================================
   Loading State
======================================== */
html:not(.loaded) body {
    opacity: 0;
}

html.loaded body {
    opacity: 1;
    transition: opacity 0.3s ease;
}
