/* Шапка сайта */
.main-header {
    background: rgba(26, 26, 58, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(106, 76, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 20px;
}

/* Левая часть */
.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--cosmos-text);
    font-size: 1.5rem;
    font-weight: bold;
    transition: color 0.3s;
}

.logo:hover {
    color: var(--cosmos-accent-light);
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    background: linear-gradient(45deg, var(--cosmos-accent), var(--cosmos-accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    color: var(--cosmos-text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--cosmos-text);
    background: rgba(106, 76, 255, 0.1);
}

/* Центральная часть - поиск */
.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 45px 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--cosmos-text);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: var(--cosmos-accent);
    box-shadow: 0 0 0 2px rgba(106, 76, 255, 0.2);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--cosmos-text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.search-btn:hover {
    color: var(--cosmos-accent);
}

.search-icon {
    font-size: 1.1rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cosmos-primary);
    border: 1px solid var(--cosmos-secondary);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-top: 5px;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--cosmos-secondary);
    transition: background 0.2s;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: var(--cosmos-text);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(106, 76, 255, 0.1);
}

.search-result-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.search-result-meta {
    font-size: 0.85rem;
    color: var(--cosmos-text-secondary);
    display: flex;
    gap: 10px;
}

/* Правая часть - пользователь */
.header-right {
    flex-shrink: 0;
}

.user-actions {
    display: flex;
    align-items: center;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-buttons .btn {
    padding: 8px 20px;
    font-size: 0.95rem;
}

/* Профиль пользователя */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--cosmos-text);
    padding: 5px;
    border-radius: 6px;
    transition: background 0.3s;
}

.user-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--cosmos-accent);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.logout-btn {
    padding: 6px 15px;
    font-size: 0.9rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
    }
    
    .header-left {
        order: 1;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        margin: 10px 0;
    }
    
    .header-right {
        order: 2;
    }
    
    .logo-text {
        display: none;
    }
    
    .user-name {
        display: none;
    }
}