/* ============================================
   Tiplersville Family Medical Clinic
   Custom Styles
   ============================================ */

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

/* Selection color */
::selection {
    background-color: #40632e;
    color: #fcfbf8;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f8f5ee;
}
::-webkit-scrollbar-thumb {
    background: #9dbc84;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #55803d;
}

/* Nav link underline animation */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #40632e;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* Mobile nav link */
.mobile-nav-link {
    display: block;
}

/* Hero decorative elements */
.hero-pattern {
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 32px 32px;
}

/* Service card hover glow */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    box-shadow: 0 0 0 1px rgba(64, 99, 46, 0.1);
}
.service-card {
    position: relative;
    overflow: hidden;
}

/* Form focus states */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(64, 99, 46, 0.1);
}

/* Back to top button transition */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile menu animation */
#mobile-menu {
    animation: slideDown 0.3s ease forwards;
}
#mobile-menu.hidden {
    animation: slideUp 0.2s ease forwards;
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .service-card,
    .group {
        transition: none;
    }
    .group:hover {
        transform: none;
    }
    #back-to-top {
        transition: none;
    }
    img {
        transition: none;
    }
}

/* Large screen adjustments */
@media (min-width: 1280px) {
    .font-serif {
        letter-spacing: -0.01em;
    }
}

/* Print styles */
@media print {
    #site-header,
    #back-to-top,
    #mobile-menu {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
    section {
        page-break-inside: avoid;
    }
}
