/* css/sidebar.css - СТИЛИ САЙДБАРА */

/* Основные CSS переменные для сайдбара */
:root {
    --sidebar-width: 345px; /* Основная ширина сайдбара */
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР САЙДБАРА ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    z-index: 1000;
}

/* ===== УБИРАЕМ СВОРАЧИВАНИЕ НА ДЕСКТОПЕ ===== */
/* На десктопе сайдбар всегда развернут */
.sidebar.collapsed {
    width: var(--sidebar-width); /* Оставляем ту же ширину */
}

/* ===== ШАПКА САЙДБАРА ===== */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    min-height: var(--header-height);
    max-height: var(--header-height);
}

.sidebar-header-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===== СКРЫВАЕМ КНОПКУ СВОРАЧИВАНИЯ НА ДЕСКТОПЕ ===== */
/* На десктопе кнопка меню скрыта */
.menu-toggle {
    display: none;
}

.profile-toggle, .settings-toggle, .theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 1.2rem;
    height: 36px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-toggle:hover, .settings-toggle:hover, .theme-toggle:hover {
    background: var(--bg-tertiary);
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 20px;
}

.menu-line {
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition);
}

/* ===== КЛИКАБЕЛЬНЫЙ ЗАГОЛОВОК С ГРАДИЕНТОМ ===== */
.main-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.main-logo:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-logo:active {
    transform: scale(0.95);
}

/* Альтернативный градиент для лучшей читаемости */
.main-logo.alternative {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e53 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-logo.alternative:hover {
    background: linear-gradient(135deg, #ff8e53 0%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== ВКЛАДКИ САЙДБАРА ===== */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
}

.sidebar-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sidebar-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.sidebar-tab:hover {
    color: var(--text-primary);
}

/* ===== КОНТЕЙНЕРЫ ВКЛАДОК ===== */
.chats-list, .online-users, .leads-list, .projects-list, .telephony-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.users-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ И МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease;
        width: 280px;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    /* ===== ПОКАЗЫВАЕМ КНОПКУ МЕНЮ ТОЛЬКО НА МОБИЛЬНЫХ ===== */
    .menu-toggle {
        display: flex; /* Показываем только на мобильных */
    }

    .sidebar-header {
        padding: 0 0.75rem;
    }

    .sidebar-tabs {
        padding: 0 0.5rem;
    }

    .sidebar-tab {
        padding: 0.75rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .main-logo {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .sidebar-tabs {
        flex-wrap: wrap;
    }

    .sidebar-tab {
        flex: 1 0 50%;
        font-size: 0.8rem;
        padding: 0.75rem 0.25rem;
    }
    
    .chats-list, .online-users, .leads-list, .projects-list, .telephony-container {
        padding: 0.75rem;
    }
    
    .main-logo {
        font-size: 1.2rem;
    }
}