/* Navigation Header */
.main-nav {
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateZ(0); /* Chrome paint stability */
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    margin-right: 40px;
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-icon {
    font-size: 1.5rem;
    margin-right: 8px;
}

.logo-text {
    color: #ffffff;
}

/* Search Bar */
.nav-search {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin-right: 40px;
}

.nav-search input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    background: #404040;
    border: 1px solid #555;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-search input:focus {
    outline: none;
    border-color: #667eea;
    background: #4a4a4a;
}

.nav-search input::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

/* Global Search Results */
.global-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #404040;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #404040;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
}

.search-result-name mark {
    background-color: #667eea;
    color: #ffffff;
    padding: 1px 2px;
    border-radius: 2px;
}

.search-result-type {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 2px;
}

.search-result-rarity {
    font-size: 0.75rem;
    color: #666;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Navigation Categories */
.nav-categories {
    display: flex;
    gap: 0;
    flex: 1;
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

.nav-item {
    position: relative;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #cccccc;
    font-weight: 500;
    font-size: 14px;
}

.nav-item:hover {
    background: #404040;
    color: #ffffff;
}

.nav-item:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-arrow {
    margin-left: 8px;
    font-size: 10px;
    transition: transform 0.2s ease;
    color: #999;
}

/* Dropdown Menus */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
}

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

.dropdown-content {
    padding: 15px;
}

.dropdown-search {
    margin-bottom: 15px;
}

.dropdown-search-input {
    width: 100%;
    padding: 8px 12px;
    background: #404040;
    border: 1px solid #555;
    border-radius: 4px;
    color: #ffffff;
    font-size: 13px;
}

.dropdown-search-input:focus {
    outline: none;
    border-color: #667eea;
}

.dropdown-search-input::placeholder {
    color: #999;
}

.dropdown-items {
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
    color: #cccccc;
    font-size: 13px;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.dropdown-item:hover {
    background: #404040;
    color: #ffffff;
}

.dropdown-item.weapon-item {
    position: relative;
}

.dropdown-item.weapon-item:hover::after {
    content: '>';
    position: absolute;
    right: 12px;
    color: #667eea;
    font-weight: bold;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }
    
    .nav-logo {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .nav-search {
        margin-right: 0;
        margin-bottom: 15px;
        max-width: none;
    }
    
    .nav-categories {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-item {
        padding: 8px 15px;
        height: auto;
    }
    
}

/* User Dropdown Styles */
.user-button {
    position: relative;
    display: flex;
    align-items: center;
    background: #404040;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 0.9rem;
    gap: 8px;
}

.user-button:hover {
    background: #4a4a4a;
    border-color: #666;
}

.user-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 280px;
    margin-top: 8px;
}

.user-dropdown .dropdown-content {
    padding: 0;
}

.dropdown-header {
    padding: 20px;
    background: #404040;
    border-radius: 8px 8px 0 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 2px;
}

.user-email {
    color: #b0b0b0;
    font-size: 0.85rem;
}

.dropdown-divider {
    height: 1px;
    background: #404040;
    margin: 0;
}

.dropdown-items {
    padding: 8px 0;
}

.user-dropdown .dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #cccccc;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    border-radius: 0;
}

.user-dropdown .dropdown-item:hover {
    background: #404040;
    color: #ffffff;
}

.dropdown-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.logout-item {
    color: #e74c3c !important;
}

.logout-item:hover {
    background: #c0392b !important;
    color: white !important;
}

/* Click outside to close dropdown */
.user-dropdown.show {
    display: block !important;
}
