/* ============================================
   NAVIGATION - Clean, Simple, No Conflicts
   ============================================ */

/* User Dropdown Styles */
.nav-user-dropdown {
    position: relative;
    display: inline-block;
}

.nav-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
}

.nav-user-toggle:hover {
    background-color: #f3f4f6;
}

.nav-user-toggle i.fa-user-circle {
    font-size: 20px;
    color: #2B68C1;
}

.nav-user-toggle i.fa-chevron-down {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.nav-user-dropdown.open .nav-user-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}

.nav-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(43, 104, 193, 0.1);
    padding: 8px 0;
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.nav-user-dropdown.open .nav-user-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.nav-user-menu-item:hover {
    background-color: #f3f4f6;
    color: #2B68C1;
}

.nav-user-menu-item i {
    font-size: 16px;
    width: 16px;
    text-align: center;
}

.nav-user-menu-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 8px 0;
}

.nav-logout-btn {
    color: #dc2626 !important;
}

.nav-logout-btn:hover {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
}

/* Base dropdown styles */
.nav-item.has-children .nav-submenu {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(43, 104, 193, 0.1);
    padding: 1rem 0;
    min-width: 280px;
    z-index: 1000;
    list-style: none;
    margin: 0;
    
    /* Hidden by default */
    display: none;
    opacity: 0;
    
    /* Smooth transition */
    transition: opacity 0.2s ease;
}

/* Show dropdown when expanded */
.nav-item.has-children.expanded .nav-submenu {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* Mega menu (Industries) - Grid layout */
.nav-item.has-children.mega-menu .nav-submenu {
    max-width: 1000px;
    min-width: 900px;
    padding: 32px;
}

.nav-item.has-children.mega-menu.expanded .nav-submenu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    column-gap: 32px;
    opacity: 1;
}

/* Submenu items */
.nav-submenu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-sublink {
    display: block;
    padding: 1rem 1.5rem;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-sublink:hover {
    background: rgba(43, 104, 193, 0.05);
    border-left-color: #2B68C1;
    color: #2B68C1;
}

/* Mega menu items */
.mega-menu .nav-sublink {
    padding: 10px 16px;
    border-radius: 8px;
    border-left: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mega-menu .nav-sublink::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #2B68C1;
    border-radius: 50%;
    flex-shrink: 0;
}

.mega-menu .nav-sublink:hover {
    background: linear-gradient(135deg, rgba(42, 59, 143, 0.08) 0%, rgba(43, 104, 193, 0.08) 100%);
    transform: translateX(4px);
}

/* Mobile adjustments */
@media (max-width: 1024px) {
    .nav-item.has-children.mega-menu .nav-submenu {
        min-width: 500px;
    }
    
    .nav-item.has-children.mega-menu.expanded .nav-submenu {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-item.has-children .nav-submenu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        min-width: 0;
    }
    
    .nav-item.has-children.mega-menu .nav-submenu {
        min-width: 0;
    }
    
    .nav-item.has-children.mega-menu.expanded .nav-submenu {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
    }
}

/* Auth Buttons */
.nav-item.auth-buttons {
    margin-left: auto;
}

.nav-auth-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-user-welcome {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.auth-login, .auth-register {
    background: linear-gradient(135deg, #2A3B8F 0%, #2B68C1 100%);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.auth-register {
    background: transparent;
    border: 2px solid #2B68C1;
    color: #2B68C1 !important;
}

.auth-login:hover, .auth-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 104, 193, 0.3);
}

.auth-register:hover {
    background: linear-gradient(135deg, #2A3B8F 0%, #2B68C1 100%);
    color: white !important;
}

/* User Dropdown */
.nav-user-dropdown {
    position: relative;
}

.nav-user-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-user-toggle:hover {
    background: #f3f4f6;
}

.nav-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    margin-top: 0.5rem;
}

.nav-user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.nav-user-menu-item:hover {
    background: #f3f4f6;
    color: #2B68C1;
}

.nav-user-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.nav-logout-btn {
    color: #dc2626 !important;
}

.nav-logout-btn:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

@media (max-width: 768px) {
    .nav-item.auth-buttons {
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e5e7eb;
    }
    
    .nav-auth-group {
        justify-content: center;
    }
}
