/* mobile.css - Стили ТОЛЬКО для мобильных устройств (до 768px) */

@media (max-width: 768px) {
    /* ==================== LAYOUT ==================== */
    .app-main {
        flex-direction: column;
    }

    .app-container {
        height: 100vh;
        overflow: hidden;
    }

    /* Навигационная панель */
    .sidebar-nav-container {
        position: fixed;
        left: -72px;
        top: var(--header-height);
        bottom: var(--mobile-nav-height);
        width: 72px;
        z-index: 100;
        background: var(--bg-secondary);
        border-right: 1px solid var(--border-color);
        transition: left var(--transition-normal);
    }

    .sidebar-nav-container.active {
        left: 0;
    }

    /* Панель контента - выезжает СЛЕВА */
    .sidebar-content-container {
        position: fixed;
        left: -100%; /* Скрыта СЛЕВА */
        top: var(--header-height);
        bottom: var(--mobile-nav-height);
        width: 85%;
        max-width: 350px;
        z-index: 200;
        border-right: none;
        box-shadow: var(--shadow-xl);
        background: var(--bg-primary);
        transition: left var(--transition-normal);
    }

    .sidebar-content-container.active {
        left: 0; /* Выезжает слева */
    }

    .sidebar-content-container.hidden {
        display: none;
    }

    /* Область чата - не смещается */
    .chat-area {
        margin-left: 0 !important;
        height: calc(100vh - var(--header-height) - var(--mobile-nav-height));
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* Правая панель */
    .right-panel {
        position: fixed;
        right: -100%;
        top: var(--header-height);
        bottom: var(--mobile-nav-height);
        width: 85%;
        max-width: 320px;
        z-index: 210;
        background: var(--bg-secondary);
        transition: right var(--transition-normal);
    }

    .right-panel.active {
        right: 0;
    }

    /* ==================== MOBILE NAV ==================== */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--mobile-nav-height);
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        align-items: center;
        z-index: 100;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        background: none;
        border: none;
        color: var(--text-secondary);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.7rem;
        cursor: pointer;
        padding: 0.5rem;
        flex: 1;
    }

    .mobile-nav-item i {
        font-size: 1.25rem;
    }

    .mobile-nav-item.active {
        color: var(--primary);
    }

    /* ==================== HEADER ==================== */
    .app-header {
        padding: 0 1rem;
        height: 56px;
    }

    .header-title {
        display: none !important;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    /* ==================== CHAT HEADER ==================== */
    .chat-header {
        height: 56px;
        padding: 0 1rem;
    }

    .chat-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .chat-name {
        font-size: 0.95rem;
        font-weight: 600;
    }

    /* ИСПРАВЛЕНО: chat-meta не суженный */
    .chat-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.7rem;
        max-width: 100%;
    }

    .chat-meta span {
        white-space: nowrap;
    }

    .chat-actions .header-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* ==================== MESSAGES ==================== */
    .messages-container {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .message {
        max-width: 85%;
        padding: 0.6rem 1rem;
        border-radius: 16px;
    }

    .message-header {
        margin-bottom: 0.2rem;
    }

    .message-sender {
        font-size: 0.8rem;
    }

    .message-time {
        font-size: 0.65rem;
    }

    .message-content {
        font-size: 0.9rem;
    }

    .message-image {
        max-width: 200px;
        max-height: 200px;
    }

    /* ==================== INPUT ==================== */
    .chat-input-container {
        padding: 0.75rem;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
    }

    .message-input {
        min-height: 40px;
        max-height: 100px;
        padding: 0.6rem 0.8rem;
        font-size: 0.95rem;
    }

    .input-tool-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .send-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    /* ==================== MODALS ==================== */
    .modal-content {
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 4rem);
        margin: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 180px);
    }

    .modal-footer {
        padding: 1rem;
    }

    /* ==================== DROPDOWN ==================== */
    .dropdown-menu {
        width: calc(100vw - 2rem);
        right: 1rem;
        left: 1rem;
        margin: 0 auto;
    }

    /* ==================== AUTH ==================== */
    .auth-wrapper {
        padding: 1rem;
    }

    .auth-header h1 {
        font-size: 2rem;
    }

    .auth-features {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
    }

    .auth-forms {
        padding: 1.5rem;
    }

    /* ==================== OVERLAY ==================== */
    .overlay {
        top: var(--header-height);
        bottom: var(--mobile-nav-height);
        z-index: 190;
    }

    .overlay.active {
        opacity: 0.7;
    }

    /* ==================== REPLY PREVIEW ==================== */
    .reply-preview {
        margin: -0.75rem -0.75rem 0.75rem -0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .reply-preview-sender {
        font-size: 0.8rem;
    }

    .reply-preview-text {
        font-size: 0.8rem;
    }

    /* ==================== EMPTY STATES ==================== */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state-icon {
        font-size: 3rem;
    }

    .empty-state-title {
        font-size: 1.1rem;
    }

    .empty-state-description {
        font-size: 0.875rem;
    }

    /* ==================== LIST ITEMS ==================== */
    .chat-list-item {
        padding: 0.6rem 1rem;
    }

    .list-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .list-title {
        font-size: 0.95rem;
    }

    .list-subtitle {
        font-size: 0.8rem;
    }

    /* ==================== PARTICIPANT LIST ==================== */
    .participant-item {
        padding: 0.6rem 1rem;
    }

    .participant-item .list-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .participant-item .list-title {
        font-size: 0.9rem;
    }

    .participant-item .list-subtitle {
        font-size: 0.75rem;
    }

    /* ==================== CHAT SETTINGS ==================== */
    .chat-settings-modal .chat-info-section {
        padding: 1rem;
    }

    .chat-settings-modal #chat-settings-name {
        font-size: 1rem;
    }

    .chat-settings-modal #chat-settings-members {
        font-size: 0.85rem;
    }

    /* ==================== CONTEXT MENU ==================== */
    .context-menu {
        min-width: 180px;
        max-width: calc(100vw - 2rem);
    }

    .context-menu-item {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    /* ==================== SCROLLBAR ==================== */
    ::-webkit-scrollbar {
        width: 4px;
    }

    /* ==================== NOTIFICATIONS ==================== */
    .notifications-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .notification {
        padding: 0.75rem;
    }

    .notification-title {
        font-size: 0.9rem;
    }

    .notification-message {
        font-size: 0.8rem;
    }

    /* ==================== BLOCK SCROLL ==================== */
    body.menu-open {
        overflow: hidden;
    }
}
