/* Quad Navigation Styles */
.quad-nav-container {
    justify-content: center;
    display: flex;
    margin: 0 auto;
    overflow: visible;
    position: relative;
    background: #d1ecf1;
}

.quad-nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    position: relative;
    z-index: 9999;
    margin: 0;
    padding: 0;
    font-size: 15px;
}

/* Mobile menu toggle button using existing menu-toggle-icon */
.quad-mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: 8px;
    z-index: 10000;
    align-self: flex-end;
}

/* Style the existing menu-toggle-icon within our button */
.quad-mobile-menu-toggle .menu-toggle-icon {
    /* Let the existing icon styles handle the appearance */
    /* Add any additional styling if needed */
}

/* Role-based access containers */
.admin-access,
.voting-access,
.committee-access {
    display: none;
}

.quad-nav-item {
    position: relative;
    z-index: 10;
}

.quad-nav-item > a {
    display: block;
    padding: 12px 20px;
    color: var(--heading-color, var(--color-heading));
    text-decoration: none;
    white-space: nowrap;
}

.quad-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}

.quad-nav-item:hover .quad-dropdown {
    display: block;
}

.quad-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.quad-dropdown a:hover {
    background-color: #f8f9fa;
}

.quad-dropdown a:last-child {
    border-bottom: none;
}

.quad-dropdown-section {
    font-weight: bold;
    background: #ecf0f1;
    padding: 8px 15px;
    color: #2c3e50;
    border-bottom: 1px solid #bdc3c7;
}

/* Mobile styles */
@media (max-width: 768px) {
    .quad-nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Show mobile menu toggle button */
    .quad-mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 20px;
    }
    
    /* Hide menu by default on mobile */
    .quad-nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #d1ecf1;
        border-top: 1px solid #ccc;
    }
    
    /* Show menu when toggled */
    .quad-nav-menu.mobile-menu-open {
        display: flex;
    }
    
    .quad-nav-item {
        width: 100%;
        border-bottom: 1px solid #ccc;
    }
    
    .quad-nav-item:last-child {
        border-bottom: none;
    }
    
    .quad-nav-item > a {
        padding: 15px 20px;
        border-bottom: none;
    }
    
    /* Mobile dropdown styles */
    .quad-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid #ddd;
        max-height: none;
        display: none;
        width: 100%;
        min-width: auto;
    }
    
    /* Show dropdown when toggled */
    .quad-dropdown.mobile-dropdown-open {
        display: block;
    }
    
    /* Remove hover behavior on mobile */
    .quad-nav-item:hover .quad-dropdown {
        display: none;
    }
    
    .quad-dropdown a {
        padding: 12px 30px;
        background: #f8f9fa;
    }
    
    .quad-dropdown-section {
        padding: 10px 30px;
        background: #e9ecef;
    }
    
    /* Role-based elements mobile display */
    .admin-access,
    .voting-access,
    .committee-access,
    .standard-items {
        display: block;
        width: 100%;
    }
    
    /* Ensure proper mobile display for role-based elements */
    .admin-access[style*="display: inline-flex"],
    .voting-access[style*="display: inline-flex"], 
    .committee-access[style*="display: inline-flex"] {
        display: block;
    }
    
    /* Mobile menu item styling for role-based items */
    .admin-access .quad-nav-item,
    .voting-access .quad-nav-item,
    .committee-access .quad-nav-item {
        background: #00557d;
    }
    
    .admin-access .quad-nav-item > a,
    .voting-access .quad-nav-item > a,
    .committee-access .quad-nav-item > a {
        color: #d1ecf1;
    }
}

/* Smooth transitions */
.quad-nav-menu,
.quad-dropdown {
    transition: all 0.3s ease;
}

/* Accessibility improvements */
.quad-mobile-menu-toggle:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .quad-nav-menu,
    .quad-dropdown {
        transition: none;
    }
}