/* Custom styles for Atienza Acob Medical Center */

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

/* Header scroll state */
#site-header {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(107, 58, 110, 0.08);
}

#site-header.scrolled .header-logo-text {
    color: #6B3A6E;
}

/* Mobile menu animation */
#menu-icon span:nth-child(1) {
    transform-origin: top center;
}

#menu-icon span:nth-child(3) {
    transform-origin: bottom center;
}

body.menu-open #menu-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

body.menu-open #menu-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

body.menu-open #menu-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile nav links */
.mobile-nav-link {
    display: block;
    color: #6B3A6E;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: background 0.2s ease;
}

.mobile-nav-link:hover {
    background: #FAF5FA;
}

/* Nav links */
.nav-link {
    position: relative;
}

/* Service card hover */
.service-card {
    transform: translateY(0);
    transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease, border-color 0.4s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

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

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

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

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

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

/* Fade-in on scroll */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.fade-in-stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.fade-in-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.fade-in-stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.fade-in-stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.fade-in-stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.fade-in-stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }

.fade-in-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Focus styles */
input:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}

/* Selection */
::selection {
    background: #E8D0E8;
    color: #412241;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
    .fade-in, .fade-in-stagger > * {
        opacity: 1;
        transform: none;
    }
}
