* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #fafafa;
    color: #1a1a1a;
    line-height: 1.5;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    position: relative;
}

/* User Menu Styles */
.user-menu {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: #2d2d2d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.user-avatar:hover {
    background-color: #404040;
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    border: 1px solid #e5e5e5;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
}

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

.user-avatar-small {
    width: 32px;
    height: 32px;
    background-color: #2d2d2d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
    color: #1a1a1a;
}

.user-email {
    font-size: 12px;
    color: #6b6b6b;
    margin-top: 2px;
}

.dropdown-divider {
    height: 1px;
    background-color: #e5e5e5;
    margin: 8px 0;
}

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

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.15s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .user-menu {
        top: 16px;
        right: 16px;
    }

    .user-dropdown {
        min-width: 200px;
        right: -8px;
    }
}


/* ========== ЛЕВЫЙ БАР (общий для всех страниц) ========== */

/* Контейнер бара */
.left-sidebar {
    width: 50px;
    background: #fafafa;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 35px;
    gap: 17px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
}

/* Иконки */
.sidebar-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background: transparent;
    border: none;
    font-size: 20px;
    position: relative;
}

/* Яблоко */
.sidebar-icon.home {
    background: transparent;
    box-shadow: none;
    font-size: 26px;
}

.sidebar-icon.home:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: wiggle 0.5s ease;
}

/* Чаты */
.sidebar-icon.chats {
    background: transparent;
    font-size: 22px;
}

.sidebar-icon.chats:hover {
    background: #f3f4f6;
    transform: translateY(-2px);  /* ← УБРАЛ scale(1.05) */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);  /* ← ДОБАВИЛ тень как у яблока */
    animation: wiggle 0.5s ease;
}

/* Spacer */
.sidebar-spacer {
    flex: 1;
}

/* Тултипы */
.sidebar-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 40px;
    background: #1a1a1a;
    color: white;
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 1000;
}

.sidebar-icon:hover::after {
    opacity: 1;
}

/* Анимация покачивания */
@keyframes wiggle {
    0%, 100% { transform: translateY(-2px) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(-5deg); }
    75% { transform: translateY(-2px) rotate(5deg); }
}

/* Отступ для контента на страницах с баром */
body.with-sidebar {
    padding-left: 50px;
}

/* ==============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (Добавить в конец файла)
   ============================================== */
@media (max-width: 768px) {

    /* 1. ПОДНИМАЕМ КРУЖОК "D" ВЫШЕ */
    .user-menu {
        /* 🔨 Добавили !important, чтобы перебить настройки из user_menu.css */
        top: 15px !important;
        right: 16px !important;
    }

    /* Ровняем выпадающее меню, чтобы на узком экране оно не ушло вправо за край */
    .user-dropdown {
        min-width: 200px;
        right: -8px;
    }

    /* 2. Превращаем боковую панель в нижнее меню */
    .left-sidebar {
        width: 100%;             /* Растянуть на всю ширину */
        height: 60px;            /* Фиксированная высота */
        top: auto;               /* Отцепляем от верха */
        bottom: 0;               /* Прижимаем к низу */
        left: 0;

        flex-direction: row;     /* Выстраиваем иконки в ряд, а не в столбик */
        justify-content: space-around; /* Равномерно распределяем */
        padding-top: 0;          /* Убираем верхний отступ */

        border-right: none;      /* Убираем границу справа */
        border-top: 1px solid #e5e7eb; /* Добавляем границу сверху */
        background: #ffffff;     /* Белый фон, чтобы не просвечивал контент */
    }

    /* 2. Корректируем отступы тела страницы */
    body.with-sidebar {
        padding-left: 0;         /* Убираем отступ слева */
        padding-bottom: 70px;    /* Добавляем отступ снизу, чтобы контент не перекрывался меню */
    }

    /* 3. Скрываем "распорку" (spacer), она не нужна в горизонтальном меню */
    .sidebar-spacer {
        display: none;
    }

    /* 4. Отключаем всплывающие подсказки на телефоне (они мешают при тапе) */
    .sidebar-icon::after {
        display: none;
    }
}