/* =================================================================== */
/*          ELEGANT "PILL" STYLE FOR ACTIVE MENU                     */
/* =================================================================== */

/* --- Base Nav Link Style --- */
.nav-item > a {
    display: block;
    padding: 0.6rem 1rem; /* Give links some padding for the pill background */
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s ease;
    border-radius: 9999px; /* Make it a fully rounded pill shape */
    position: relative;
}

/* --- Hover Style --- */
/* On hover, show a very light grey pill */
.nav-item > a:hover {
    color: var(--text-dark);
    background-color: var(--bg-light); /* #f9fafb */
}

/* --- Active Style (The Main Design) --- */
.nav-item > a.active {
    color: var(--primary-blue);
    background-color: #dbeafe; /* A light, complementary blue */
    font-weight: 600;
}

/* For dropdowns, we still want the parent to be highlighted, but just the text */
.nav-item.has-dropdown-active > a {
    color: var(--primary-blue);
    font-weight: 600;
    background-color: transparent; /* No pill for the parent, just colored text */
}
.top-navbar {
    background: #1e293b;
    color: #cbd5e1;
    font-size: 13px;
    border-bottom: 1px solid #334155;
}

.top-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-nav-left {
    display: flex;
    align-items: center;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
}

.contact-item svg {
    color: #3b82f6;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-link {
    width: 28px;
    height: 28px;
    background: #334155;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    transition: all 0.2s ease;
    text-decoration: none;
}

.social-link:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
}

.emergency-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #dc2626;
    border-radius: 4px;
    color: white;
    font-weight: 600;
}

.emergency-text {
    font-size: 12px;
}

.emergency-number {
    font-size: 14px;
    font-weight: 700;
}

/* Mobile styles for top navbar */
@media screen and (max-width: 768px) {
    .top-navbar {
        font-size: 12px;
    }

    .top-nav-container {
        padding: 6px 16px;
        flex-direction: column;
        gap: 8px;
    }

    .contact-info {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .contact-item {
        font-size: 11px;
    }

    .top-nav-right {
        gap: 16px;
    }

    .social-links {
        gap: 8px;
    }

    .social-link {
        width: 24px;
        height: 24px;
    }

    .emergency-info {
        padding: 3px 8px;
    }
}

@media screen and (max-width: 480px) {
    .contact-info {
        gap: 12px;
    }

    .contact-item:nth-child(3) {
        display: none; /* Hide hours on very small screens */
    }
}

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.navbar.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

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

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-icon::before {
    content: '+';
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 15px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 0 2px;
}

.nav-link:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.dropdown-arrow {
    margin-left: 6px;
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #94a3b8;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: #1e293b;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-top: 8px;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    color: #1e293b;
    background: #f8fafc;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.search-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.appointment-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.appointment-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.hamburger:hover {
    background: #f1f5f9;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: #64748b;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        padding: 20px 0;
        transition: left 0.3s ease;
        gap: 0;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        justify-content: space-between;
        padding: 16px 20px;
        margin: 0;
        border-radius: 0;
        font-size: 16px;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        background: #f8fafc;
        border: none;
        border-radius: 0;
        opacity: 0;
        visibility: hidden;
        transform: none;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .dropdown.active .dropdown-content {
        opacity: 1;
        visibility: visible;
        max-height: 300px;
    }

    .dropdown-content a {
        padding: 12px 40px;
        border-bottom: 1px solid #e2e8f0;
        background: transparent;
    }

    .dropdown-content a:hover {
        background: #f1f5f9;
    }

    .dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }

    .hamburger {
        display: flex;
    }

    .nav-actions {
        gap: 8px;
    }

    .search-btn {
        width: 36px;
        height: 36px;
    }

    .appointment-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}
