/**
 * Файл: css/navbar.css
 * Назначение: Стили для навигационной панели (стиль как на странице логина)
 * Версия: 5.0
 */

/* ============================================
   Навигационная панель (прозрачная, как на логине)
   ============================================ */
.navbar {
    background: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px);
    box-shadow: none !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 1rem;
}

@media (min-width: 768px) {
    .navbar .container {
        padding: 0.75rem 2rem;
    }
}

/* Логотип - стиль как на странице логина */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-image {
    height: 40px;
    width: auto;
    transition: transform 0.2s ease;
	
}

.logo:hover .logo-image {
    transform: scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.logo-subtitle {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Основная навигация */
.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    transform: translateY(-1px);
}

.nav-links a.active {
    background: rgba(79, 70, 229, 0.7) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.nav-links a.active:hover {
    background: rgba(79, 70, 229, 0.9) !important;
}

/* Пользовательское меню */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.user-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* Аватар пользователя */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Кнопка выхода */
.logout-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.7);
    color: white;
    transform: scale(1.05);
}

/* Кнопки входа/регистрации */
.auth-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.auth-buttons .btn-outline,
.auth-buttons .btn-primary {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.auth-buttons .btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
}

.auth-buttons .btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

.auth-buttons .btn-primary {
    background: rgba(79, 70, 229, 0.7);
    border: 1px solid rgba(79, 70, 229, 0.8);
    color: white;
}

.auth-buttons .btn-primary:hover {
    background: rgba(79, 70, 229, 0.9);
}

/* Мобильное меню */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0.5rem;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
}

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

/* ============================================
   Адаптивность
   ============================================ */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .nav-links.open {
        display: flex;
    }
    
    /* Двухколоночная сетка для элементов меню */
    .nav-links.open {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .nav-links a {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 0.5rem;
        text-align: center;
    }
    
    /* Стили для блока аутентификации в мобильном меню */
    .nav-links .auth-buttons {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        width: 100%;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        grid-column: span 2;
    }
    
    .nav-links .auth-buttons a {
        width: 100%;
        text-align: center;
    }
    
    /* Стили для пользовательского меню в мобильной версии */
    .nav-links .user-menu {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        grid-column: span 2;
    }
    
    .nav-links .user-menu .user-info {
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    .nav-links .user-menu .user-avatar,
    .nav-links .user-menu .logout-btn {
        width: 100%;
        justify-content: center;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .logo-title {
        font-size: 1rem;
    }
    
    .logo-subtitle {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 32px;
    }
    
    .logo-title {
        font-size: 0.875rem;
    }
    
    .logo-subtitle {
        font-size: 0.6rem;
    }
    
    .nav-links.open {
        gap: 0.5rem;
    }
    
    .nav-links a {
        padding: 0.6rem 0.25rem;
        font-size: 0.8rem;
    }
}