/* Site-Wide Navigation Styles */

/* Hide mobile-only items on desktop */
@media (min-width: 769px) {
    .site-menu-item.mobile-only {
        display: none !important;
    }

    .site-menu-item.desktop-only {
        display: block;
    }
}

/* Skip to main content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1e293b;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1001;
    border-radius: 0 0 4px 0;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

.site-nav {
    background: #1e293b;
    color: white;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 60px; /* Fixed height for consistent spacing */
}

.site-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px; /* Match navbar height */
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 1rem 0;
}

.site-logo:hover {
    color: #10b981;
}

.site-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-menu-item {
    position: relative;
}

.site-menu-item > a,
.site-menu-item button.dropdown-toggle {
    color: white;
    text-decoration: none;
    padding: 1rem 1.25rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s, background 0.3s;
    height: 100%;
    background: transparent;
    border: none;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
}

/* Focus styles for keyboard navigation */
.site-menu-item > a:focus,
.site-menu-item button.dropdown-toggle:focus,
.site-logo:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.site-menu-item a:hover,
.site-menu-item button.dropdown-toggle:hover {
    color: #10b981;
    background: rgba(255, 255, 255, 0.05);
}

/* Active page indicator */
.site-menu-item a[aria-current="page"] {
    color: #10b981;
    font-weight: 500;
}

.site-menu-item a[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #10b981;
}

/* Dropdown arrow styling */
.dropdown-arrow {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    transition: transform 0.3s;
    display: inline-block;
}

.site-menu-item.has-dropdown:hover .dropdown-arrow,
.site-menu-item button[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: -1px;
}

/* Add invisible bridge to maintain hover */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

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

.dropdown-menu a {
    color: #1e293b;
    padding: 0.875rem 1.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    border-radius: 4px;
}

.dropdown-menu a:focus {
    outline: 2px solid #6366f1;
    outline-offset: -2px;
}

.dropdown-menu a:hover {
    background: #f1f5f9;
    color: #059669;
    transform: translateX(4px);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 2px solid transparent;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: 4px;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    /* Hide desktop-only items on mobile */
    .site-menu-item.desktop-only {
        display: none !important;
    }

    /* Show mobile-only items on mobile */
    .site-menu-item.mobile-only {
        display: block;
    }

    .site-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: #1e293b;
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s;
    }

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

    .mobile-menu-toggle {
        display: block;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(45, 55, 72, 0.8);
        margin-top: 0;
        border-radius: 0;
        width: 100%;
    }
    
    .dropdown-menu a {
        color: rgba(255, 255, 255, 0.9) !important;
        display: block !important;
    }
    
    .site-menu-item.has-dropdown::after {
        display: none;
    }
}