/* Мобильные стили для TinyMCE */
@media screen and (max-width: 768px) {
    /* Стили для TinyMCE редактора на мобильных */
    .tox-tinymce {
        border-radius: 8px !important;
        max-width: 100% !important;
        font-size: 16px !important; /* Предотвращение zoom на iOS */
    }
    
    .tox-toolbar {
        flex-wrap: wrap !important;
        padding: 4px !important;
    }
    
    .tox-toolbar__group {
        margin: 2px !important;
    }
    
    .tox-tbtn {
        padding: 6px !important;
        margin: 1px !important;
    }
    
    .tox-edit-area {
        border-radius: 0 0 8px 8px !important;
    }
    
    .tox-editor-container {
        max-width: 100% !important;
    }
    
    /* Скрываем statusbar на мобильных */
    .tox-statusbar {
        display: none !important;
    }
    
    /* Fallback для textarea если TinyMCE не загрузился */
    .tinymce-editor {
        width: 100% !important;
        border-radius: 8px !important;
        border: 1px solid #ccc !important;
        padding: 10px !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        font-size: 16px !important; /* Предотвращает zoom на iOS */
        line-height: 1.4 !important;
    }
}

/* Мобильные стили */
@media screen and (max-width: 768px) {
    /* Ограничение размера аватарок в чате */
    .uc-avatar, .uc-contact-avatar, .uc-chat-header-avatar {
        max-width: 32px !important;
        max-height: 32px !important;
    }

    /* Унифицированные мобильные размеры аватарок (28px) */
    .avatar:not(.mobile-detail-page .avatar):not(.participants-section .avatar) {
        width: 28px;
        height: 28px;
    }
    .default-avatar:not(.sidebar .default-avatar):not(.mobile-detail-page .default-avatar) {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    /* Основной контейнер для мобильной версии детальной страницы */
    .mobile-detail-page {
        min-height: 100vh;
        background: #F8FAFC;
        padding-bottom: 80px;
        animation: slide-up 0.3s ease-out;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Фиксированная шапка с размытым фоном */
    .detail-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        z-index: 100;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    /* Секция с основной информацией о задаче */
    .task-info-section {
        margin-top: 8px; /* высота шапки + отступ */
        padding: 20px 16px;
        background: white;
        margin-bottom: 8px;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    /* Остальные стили остаются без изменений ... */
}

/* Глобальные стили для мобильных устройств */
@media screen and (max-width: 768px) {
    /* Сброс стандартных отступов */
    body {
        margin: 0;
        padding: 0;
        background: #F8FAFC;
    }

    /* Предотвращение горизонтальной прокрутки */
    html, body {
        overflow-x: hidden;
        position: relative;
        width: 100%;
    }

    /* Оптимизация размеров кнопок для тач-устройств */
    button,
    .btn,
    .dropdown-item {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Крупные action-кнопки */
    .btn-primary,
    .btn-success,
    .btn-danger,
    .btn-create {
        min-height: 40px;
        padding: 8px 16px;
        font-size: 14px;
        border-radius: 8px;
    }

    /* Маленькие кнопки */
    .btn-sm {
        min-height: 30px;
        padding: 4px 10px;
        font-size: 12px;
    }

    /* Улучшение читаемости текста */
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    /* Адаптивные отступы для контейнеров */
    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Компактные формы */
    .form-control,
    .form-select {
        font-size: 14px;
        padding: 8px 10px;
        border-radius: 8px;
    }

    /* Компактные карточки */
    .card {
        border-radius: 10px;
        margin-bottom: 12px;
    }

    .card-body {
        padding: 12px;
    }

    .card-header {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Компактные заголовки */
    h1, .h1 { font-size: 1.4rem; }
    h2, .h2 { font-size: 1.2rem; }
    h3, .h3 { font-size: 1.05rem; }
    h4, .h4 { font-size: 0.95rem; }

    /* Компактные секции форм */
    .form-section {
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .form-section-header {
        padding: 10px 14px;
        font-size: 13px;
    }

    .form-section-body {
        padding: 12px 14px;
    }

    .form-label,
    .form-label-styled {
        font-size: 12px;
        margin-bottom: 4px;
    }

    /* Компактные таблицы */
    .table td,
    .table th {
        padding: 8px 10px;
        font-size: 13px;
    }

    /* Компактные бейджи */
    .badge {
        font-size: 11px;
        padding: 3px 7px;
    }

    /* Компактные алерты */
    .alert {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 8px;
    }

    /* Модальные окна — на весь экран */
    .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
    }

    .modal-body {
        padding: 14px;
    }

    .modal-header {
        padding: 12px 14px;
    }

    .modal-footer {
        padding: 10px 14px;
    }
}

/* Основные стили страницы */
.mobile-detail-page {
    position: relative;
    width: 100%;
    margin-left: 0;
    min-height: 100vh;
    background: #F8FAFC;
    padding-bottom: 80px;
    animation: slide-up 0.3s ease-out;
}

/* Анимация появления страницы */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для шапки */
.detail-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Стили для кнопок навигации */
.back-button,
.menu-button {
    min-width: 44px;
    min-height: 44px;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 50%;
    transition: background-color 0.2s;
}

/* Эффект при нажатии на кнопки */
.back-button:active,
.menu-button:active {
    background-color: #F1F5F9;
}

/* Заголовок задачи */
.task-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* Секция с основной информацией */
.task-info-section {
    padding: 20px 16px;
    background: white;
    margin-bottom: 8px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Название задачи */
.task-name {
    font-size: 24px;
    font-weight: 700;
    color: #1E293B;
    margin: 0 0 16px;
    line-height: 1.3;
}

/* Секция статусов */
.status-section {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Общие стили для бейджей */
.status-badge,
.priority-badge {
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s;
}

/* Эффект при нажатии на бейджи */
.status-badge:active,
.priority-badge:active {
    transform: scale(0.95);
}

/* Цветовая схема для разных статусов */
.status-badge.pending { 
    background: #F8FAFC; 
    color: #64748B;
    border: 1px solid #E2E8F0;
}

.status-badge.in_progress { 
    background: #EFF6FF; 
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

.status-badge.paused {
    background: #fff7ed;
    color: #d97706;
    border: 1px solid #fef3c7;
}

.status-badge.review { 
    background: #FEF3C7; 
    color: #B45309;
    border: 1px solid #FDE68A;
}

.status-badge.completed { 
    background: #DCFCE7; 
    color: #16A34A;
    border: 1px solid #BBF7D0;
}

/* Цветовая схема для приоритетов */
.priority-badge.low { 
    background: #F0FDF4;
    color: #16A34A;
    border: 1px solid #BBF7D0;
}

.priority-badge.medium { 
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.priority-badge.high { 
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

/* Информация о дедлайне */
.deadline-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748B;
    font-size: 14px;
    padding: 8px 12px;
    background: #F8FAFC;
    border-radius: 8px;
    width: fit-content;
}

/* Секция участников */
.participants-section {
    padding: 16px;
    background: white;
    margin-bottom: 8px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Стили для участника */
.participant {
    flex: 1;
}

/* Метка участника */
.participant-label {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Информация об участнике */
.participant-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Стили для аватаров (детальная страница) */
.mobile-detail-page .avatar,
.mobile-detail-page .avatar-placeholder,
.participants-section .avatar,
.participants-section .avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.avatar img,
.avatar-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Заполнитель аватара */
.avatar-placeholder {
    background: linear-gradient(135deg, #E2E8F0, #CBD5E1);
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
}

/* Секция описания */
.description-section {
    padding: 20px;
    background: white;
    margin-bottom: 8px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Заголовок описания */
.description-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #1E293B;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Иконка в заголовке */
.description-section h3 svg {
    opacity: 0.7;
}

/* Контент описания */
.description-content {
    font-size: 15px;
    line-height: 1.6;
    color: #475569;
}

/* Секция галереи */
.images-section {
    padding: 20px;
    background: white;
    margin-bottom: 8px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Заголовок галереи */
.images-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1E293B;
    margin-bottom: 16px;
}

/* Иконка в заголовке галереи */
.images-section h3 svg {
    opacity: 0.7;
}

/* Сетка изображений */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

/* Элемент изображения */
.image-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

/* Эффект при нажатии на изображение */
.image-item:active {
    transform: scale(0.98);
}

/* Само изображение */
.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Секция комментариев */
.comments-section {
    padding: 5px;
    background: white;
    border-radius: 12px 12px 12px 12px;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

/* Заголовок комментариев */
.comments-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1E293B;
    margin-bottom: 16px;
}

/* Иконка в заголовке комментариев */
.comments-section h3 svg {
    opacity: 0.7;
}

/* Список комментариев */
.comments-list {
    margin-bottom: 20px;
}

/* Элемент комментария */
.comment-item {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #F8FAFC;
    border-radius: 12px;
    animation: fadeIn 0.3s ease-out;
}

/* Анимация появления комментария */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Стиль для собственных комментариев */
.comment-item.own-comment {
    background: #EFF6FF;
    margin-left: 20%;
}

/* Шапка комментария */
.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

/* Автор комментария */
.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: #1E293B;
}

/* Время комментария */
.comment-time {
    font-size: 12px;
    color: #64748B;
}

/* Содержимое комментария */
.comment-content {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

/* Форма добавления комментария */
.comment-form {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 16px;
    border-top: 1px solid #E2E8F0;
    z-index: 10;
}

/* Поле ввода комментария */
#commentInput {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    transition: border-color 0.2s ease;
    flex: 1;
    border: none;
    background: none;
    resize: none;
    padding: 8px;
    font-size: 15px;
    max-height: 120px;
    min-height: 40px;
    color: #1E293B;
}

/* Плейсхолдер поля ввода */
#commentInput::placeholder {
    color: #94A3B8;
}

/* Фокус на поле ввода */
#commentInput:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Кнопка отправки комментария */
#sendComment {
    transform: scale(1);
    transition: transform 0.2s ease;
    background: #2563EB;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

/* Эффект при нажатии кнопки отправки */
#sendComment:active {
    transform: scale(0.95);
}

/* Общие анимации для интерактивных элементов */
.back-button,
.menu-button,
.status-badge,
.priority-badge,
.image-item,
#sendComment {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Состояния при наведении */
.back-button:hover,
.menu-button:hover {
    background-color: #F1F5F9;
}

#sendComment:hover {
    background-color: #1D4ED8;
}

/* Адаптивные стили для маленьких экранов */
@media (max-width: 360px) {
    .task-info-section,
    .participants-section,
    .description-section,
    .images-section,
    .comments-section {
        padding: 16px;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .status-badge,
    .priority-badge {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .participant-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .avatar-wrapper {
        margin-bottom: 8px;
    }
}

/* Эффект ripple для интерактивных элементов */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

/* Анимация ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

/* Анимация эффекта ripple */
@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Стили для кастомного дропдауна */
.custom-dropdown {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 200px;
}

/* Элементы дропдауна */
.custom-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: #1E293B;
    transition: all 0.2s ease;
}

/* Ховер для элементов дропдауна */
.custom-dropdown .dropdown-item:hover {
    background: #F1F5F9;
}

/* Опасные действия в дропдауне */
.custom-dropdown .dropdown-item.text-danger {
    color: #DC2626;
}

/* Иконки в дропдауне */
.custom-dropdown .dropdown-item svg {
    opacity: 0.7;
}

/* Иконки статусов */
.status-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Цвета иконок статусов */
.status-badge.pending .status-icon { background: #64748B; }
.status-badge.in_progress .status-icon { background: #2563EB; }
.status-badge.paused .status-icon { background: #fc9e2b; }
.status-badge.review .status-icon { background: #B45309; }
.status-badge.completed .status-icon { background: #16A34A; }

/* Детали участников */
.participant-details {
    flex: 1;
}

/* Имя участника */
.participant-name {
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 4px;
}

/* Роль участника */
.participant-role {
    font-size: 13px;
    color: #64748B;
}

/* Стрелка назначения */
.assignment-arrow {
    display: flex;
    justify-content: center;
    padding: 16px 0;
    color: #94A3B8;
}

/* Просмотрщик изображений */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Активное состояние просмотрщика */
.image-viewer.active {
    display: flex;
    animation: fade-in 0.3s ease-out;
}

/* Контент просмотрщика */
.viewer-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

/* Изображение в просмотрщике */
.viewer-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

/* Анимация появления */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Спиннер загрузки */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 20px;
}

/* Анимация спиннера */
.loading-spinner::after {
    content: "";
    width: 30px;
    height: 30px;
    border: 3px solid #E2E8F0;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

/* Анимация вращения спиннера */
@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Сообщение об ошибке */
.error-message {
    text-align: center;
    padding: 20px;
    color: #DC2626;
    background: #FEE2E2;
    border-radius: 8px;
    margin: 10px 0;
}

/* Анимации для комментариев */
[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Активное состояние анимации */
[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* Стили заголовков секций */
.description-section h3,
.images-section h3,
.comments-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1E293B;
    margin-bottom: 16px;
}

/* Иконки в заголовках */
.description-section h3 svg,
.images-section h3 svg,
.comments-section h3 svg {
    opacity: 0.7;
}

/* Стили для шапки детальной страницы */
header.detail-header {
    padding-top: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    padding-right: 0px;
    border-radius: 10px;
}

/*Для главной страницы кнопка задач*/
@media screen and (max-width: 768px) {
    .col-md-4 {
        width: 100%;
    }
    .alert-dismissible .btn-close {
        padding: 0.5rem 1rem;
    }
}

/* Стили для мобильной страницы */
.mobile-page {
    padding: 0px;
    max-width: 768px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.header-content {
    flex: 1;
    margin-right: 16px;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.search-box {
    position: relative;
    width: 200px;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

.filter-menu {
    position: relative;
}

.filter-button {
    padding: 8px;
    color: #6c757d;
    transition: color 0.2s;
}

.filter-button:hover {
    color: #2c3e50;
}

.filter-dropdown {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: none;
    border-radius: 8px;
    width: 250px;
}


.dropdown-item {
    padding: 12px 16px;
    transition: background-color 0.2s;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 32px;
}

.empty-icon {
    margin-bottom: 16px;
    color: #adb5bd;
}

.empty-title {
    font-size: 20px;
    color: #495057;
    margin-bottom: 8px;
}

.empty-description {
    color: #6c757d;
    margin: 0;
}

.fab-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    text-decoration: none;
}

.fab-button:hover {
    transform: translateY(-2px);
    background: #0056b3;
}

.fab-icon {
    stroke: white;
}

/* Стили для активного фильтра */
.dropdown-item.active {
    background-color: #e9ecef;
    color: #2c3e50;
    font-weight: 500;
}

.filter-dropdown .dropdown-item {
    cursor: pointer;
}

.filter-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Стили для переключателя сортировки */
#sortByDeadline:checked {
    background-color: #dc3545; /* Красный цвет для режима "По срочности" */
    border-color: #dc3545;
}

#sortByDeadline {
    cursor: pointer;
    /*9width: 3em;
    height: 1.5em;*/
}

/* Анимация для иконки сортировки по срочности */
.fa-hourglass-half {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Стили для активного состояния кнопки фильтра */
.filter-button i {
    transition: color 0.3s ease;
}

.filter-button.active i {
    color: #007bff;
}/* ========================================
   Мобильный UI для Push-уведомлений
   ======================================== */

/* Баннер для включения уведомлений — под мобильным хедером */
.mobile-push-banner {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1050;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-push-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}

.mobile-push-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.mobile-push-text {
    flex: 1;
    min-width: 0;
}

.mobile-push-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    font-weight: 600;
}

.mobile-push-text p {
    margin: 0;
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.3;
}

.mobile-push-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-push-actions .btn {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
}

.mobile-push-actions .btn-outline-light {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.mobile-push-actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Push FAB кнопка убрана — уведомления доступны через мобильный хедер */

/* Toast уведомления */
@keyframes toastSlideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideDown {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
}

/* ============================================
   МОБИЛЬНЫЙ HEADER - НОВАЯ ПАНЕЛЬ СВЕРХУ
   ============================================ */

.mobile-header {
    display: none; /* Скрыт по умолчанию, показывается на мобильных */
    position: fixed;
    top: 0;
    left: 0;
    right: 0; /* На всю ширину экрана */
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1100;
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}

/* Левая часть header - аватар пользователя и приветствие */
.mobile-header-left {
    display: flex;
    align-items: center;
    min-width: 0; /* Для корректного обрезания текста */
    flex: 1;
}

/* Кликабельная ссылка на профиль */
.mobile-profile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 6px 10px;
    margin: -6px -10px; /* Компенсация padding для увеличения области клика */
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.mobile-profile-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.mobile-profile-link:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.2);
}

/* Аватар пользователя */
.mobile-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* Fallback аватар (первая буква имени) */
.mobile-user-avatar-fallback {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Информация о пользователе */
.mobile-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Приветствие */
.mobile-greeting {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
    font-weight: 400;
}

/* Имя пользователя */
.mobile-username {
    font-size: 15px;
    font-weight: 600;
    color: white;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Логотип для гостей */
.mobile-header-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.mobile-header-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

/* Центр header - счётчик онлайн пользователей */
.mobile-header-center {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 8px;
}

.mobile-online-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 16px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mobile-online-badge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.mobile-online-badge i {
    font-size: 14px;
}

.mobile-online-badge span {
    min-width: 12px;
    text-align: center;
}

/* Зелёная точка для активности */
.mobile-online-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 8px #4caf50;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* Правая часть header - иконки */
.mobile-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-header-icon {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-header-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.mobile-header-icon:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

/* Badge для уведомлений */
.mobile-header-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: #ff4757;
    color: white;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Оверлей для мобильного меню */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

/* Адаптация только для мобильных устройств */
@media (max-width: 768px) {
    /* Показываем гамбургер-меню */
    .mobile-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Sidebar на мобильных - скрыт по умолчанию, выезжает слева */
    .sidebar {
        display: flex !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
        z-index: 1050;
    }
    
    /* Sidebar активен - виден */
    .sidebar.mobile-active {
        transform: translateX(0);
    }
    
    /* Убираем функцию сворачивания на мобильных */
    .sidebar.collapsed {
        width: 280px;
    }
    
    .sidebar.collapsed .nav-link span,
    .sidebar.collapsed .nav-link span:not(.badge),
    .sidebar.collapsed .user-profile-section h5,
    .sidebar.collapsed .user-profile-section small {
        display: inline !important;
    }
    
    .sidebar.collapsed .nav-link {
        padding: 12px 24px;
        margin: 4px 16px;
        justify-content: flex-start;
        position: static;
    }
    
    .sidebar.collapsed .nav-link i {
        margin-right: 12px;
        font-size: 1.1em;
    }
    
    .sidebar.collapsed .sidebar-avatar {
        width: 64px;
        height: 64px;
    }
    
    .sidebar.collapsed .default-avatar {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }
    
    .sidebar.collapsed .nav-link .badge {
        position: static;
        transform: none;
    }
    
    /* Скрываем блок управления (toggle + индикатор) на мобильных */
    .sidebar-controls {
        display: none !important;
    }
    
    /* Показываем мобильный header */
    .mobile-header {
        display: block;
    }
    
    /* Контент на всю ширину на мобильных с отступом под header, bottom nav и правую панель Bitrix */
    .main-content {
        margin-left: 0 !important;
        margin-right: 60px !important; /* Отступ под правую боковую панель Bitrix */
        padding: 12px;
        padding-top: 72px; /* Отступ под header (60px + 12px) */
        padding-bottom: 72px; /* Отступ под bottom nav (60px + 12px) */
        min-height: 100vh;
    }

    .main-content.sidebar-collapsed {
        margin-left: 0 !important;
        margin-right: 60px !important;
    }
    
    .mobile-push-banner {
        display: block;
    }
}

/* ============================================
   НИЖНЯЯ ПАНЕЛЬ НАВИГАЦИИ (BOTTOM NAV BAR)
   ============================================ */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0; /* На всю ширину экрана */
    height: 60px;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 1100;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: #94a3b8;
    font-size: 10px;
    gap: 2px;
    position: relative;
    transition: color 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.bottom-nav-item span {
    font-weight: 500;
    font-size: 9px;
    line-height: 1;
}

.bottom-nav-item.active {
    color: #667eea;
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item:active {
    opacity: 0.7;
}

/* Центральная кнопка "+" */
.bottom-nav-center {
    position: relative;
}

.bottom-nav-plus {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -16px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bottom-nav-plus i {
    color: white;
    font-size: 18px;
}

.bottom-nav-center:active .bottom-nav-plus {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Бейджи на иконках */
.bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    margin-right: -20px;
    min-width: 16px;
    height: 16px;
    background: #ef4444;
    color: white;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Показываем на мобильных */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
}

/* На десктопе скрываем мобильные элементы */
@media (min-width: 769px) {
    .mobile-push-banner,
    .mobile-hamburger,
    .mobile-menu-overlay,
    .mobile-bottom-nav {
        display: none !important;
    }
}
