/* ============================================
   Palm Springs Medical Building of Hialeah
   Custom Styles
   ============================================ */

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(27, 67, 50, 0.2);
    color: #1B4332;
}

/* ── Scroll Reveal (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    }

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

    .reveal:nth-child(2) { transition-delay: 100ms; }
    .reveal:nth-child(3) { transition-delay: 200ms; }
    .reveal:nth-child(4) { transition-delay: 300ms; }
}

/* When JS is active, add revealed class */
.js .reveal {
    opacity: 0;
    transform: translateY(30px);
}

.js .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Floating Cards Animation ── */
@media (prefers-reduced-motion: no-preference) {
    .animate-float {
        animation: float 4s ease-in-out infinite;
    }

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

    .animate-float-slow {
        animation: float 5s ease-in-out infinite 0.6s;
    }
}

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

/* ── Navbar ── */
#navbar {
    background: rgba(250, 250, 246, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(27, 67, 50, 0.08);
}

#navbar.scrolled {
    box-shadow: 0 4px 30px rgba(27, 67, 50, 0.08);
}

/* ── Mobile Menu ── */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

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

/* ── Menu Button ── */
#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menu-btn.active .menu-line:nth-child(3) {
    width: 1.5rem;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Service Card Hover ── */
.group:hover .group-hover\:bg-white\/20 {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ── Button Ripple Effect ── */
button, a {
    -webkit-tap-highlight-color: transparent;
}

/* ── Focus Styles ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #1B4332;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Mobile Menu Overlay ── */
#mobile-menu {
    transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Smooth Image Loading ── */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ── 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 {
    #navbar,
    #mobile-menu,
    .animate-float,
    .animate-float-delayed,
    .animate-float-slow {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
    }
}
