/* Custom styles for Longmont United Hospital */

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

/* Hide scrollbar for mobile menu on body scroll */
body.menu-open {
    overflow: hidden;
}

/* Navbar transition */
#navbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#navbar.scrolled {
    background: rgba(65, 12, 21, 0.95) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile menu animations */
#mobileMenu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-link {
    position: relative;
}

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

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

/* Scroll reveal animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .group:hover {
        transform: none;
    }
    
    #backToTop {
        transition: none;
    }
}

/* Hero floating cards animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Apply subtle float to hero cards */
@media (prefers-reduced-motion: no-preference) {
    #hero .absolute > div {
        animation: float 4s ease-in-out infinite;
    }
    
    #hero .absolute > div:nth-child(2) {
        animation-delay: -1s;
    }
    
    #hero .absolute > div:nth-child(3) {
        animation-delay: -2s;
    }
    
    #hero .absolute > div:nth-child(4) {
        animation-delay: -3s;
    }
    
    #hero .absolute > div:nth-child(5) {
        animation-delay: -0.5s;
    }
}

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

/* Button hover effects */
button:hover,
a:hover {
    transform: translateY(-1px);
}

button:active,
a:active {
    transform: translateY(0);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #8c2134;
}

/* Map section */
section iframe {
    transition: filter 0.3s ease;
}

section iframe:hover {
    filter: grayscale(0);
}

/* Ensure images don't cause layout shift */
img {
    max-width: 100%;
    height: auto;
}

/* Form validation styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #16a34a;
}

/* Print styles */
@media print {
    #navbar,
    #backToTop,
    .reveal {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .bg-burgundy-950,
    .bg-burgundy-800 {
        background: #fff !important;
        color: #000 !important;
    }
}
