/* ============================================================
   XAM MESSENGER — GLASSMORPHISM + PARTICLES
   ============================================================ */

:root {
    /* ===== НАСТРОЙКИ ТЕМЫ — МЕНЯЙ ЗДЕСЬ ===== */
    --theme-hue: 260; /* Основной цвет (0-360): 260=фиолетовый, 210=синий, 150=зелёный, 0=красный */
    --theme-saturation: 70%; /* Насыщенность цвета */
    --glass-opacity: 0.15; /* Прозрачность стекла (0.05 - 0.4) */
    --glass-blur: 20px; /* Размытие стекла (10-40px) */
    --glass-border-opacity: 0.2; /* Прозрачность границ */
    --particle-color: var(--accent); /* Цвет частиц */
    --particle-count: 80; /* Количество частиц (JS) */
    --particle-speed: 0.5; /* Скорость частиц (JS) */
    --line-distance: 150; /* Расстояние для линий (JS) */
    /* ===== ОСНОВНЫЕ ЦВЕТА ===== */
    --accent: hsl(var(--theme-hue), var(--theme-saturation), 55%);
    --accent-hover: hsl(var(--theme-hue), var(--theme-saturation), 45%);
    --accent-light: hsl(var(--theme-hue), var(--theme-saturation), 70%);
    --accent-glow: hsla(var(--theme-hue), var(--theme-saturation), 55%, 0.4);
    --accent-subtle: hsla(var(--theme-hue), var(--theme-saturation), 55%, 0.15);
    /* ===== ФОН ===== */
    --bg-primary: #050510;
    --bg-chat: transparent;
    /* ===== СТЕКЛО ===== */
    --glass-bg: rgba(255, 255, 255, var(--glass-opacity));
    --glass-bg-hover: rgba(255, 255, 255, calc(var(--glass-opacity) + 0.05));
    --glass-bg-active: rgba(255, 255, 255, calc(var(--glass-opacity) + 0.1));
    --glass-border: rgba(255, 255, 255, var(--glass-border-opacity));
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    /* ===== ТЕКСТ ===== */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.35);
    --text-accent: var(--accent-light);
    /* ===== СООБЩЕНИЯ ===== */
    --bg-message-own: hsla(var(--theme-hue), var(--theme-saturation), 45%, 0.5);
    --bg-message-other: rgba(255, 255, 255, 0.08);
    /* ===== СТАТУСЫ ===== */
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    /* ===== РАЗМЕРЫ ===== */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --sidebar-width: 340px;
    --header-height: 64px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* ============================================================
   CANVAS ЧАСТИЦ
   ============================================================ */

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================================
   СТЕКЛЯННЫЕ МИКСИНЫ
   ============================================================ */

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-hover:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, calc(var(--glass-border-opacity) + 0.1));
}

/* ============================================================
   ЭКРАНЫ
   ============================================================ */

.screen {
    display: none;
    height: 100vh;
    position: relative;
    z-index: 1;
}

    .screen.active {
        display: flex;
    }

/* ============================================================
   АВТОРИЗАЦИЯ
   ============================================================ */

#auth-screen {
    justify-content: center;
    align-items: center;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 72px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 30px var(--accent-glow));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.auth-logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 14px;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 20px;
}

    .auth-form.active {
        display: flex;
    }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .form-group label {
        font-size: 12px;
        font-weight: 500;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px 16px;
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(10px);
        color: var(--text-primary);
        font-size: 15px;
        font-family: inherit;
        transition: var(--transition);
        outline: none;
    }

        .form-group input:focus,
        .form-group textarea:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-subtle), 0 0 20px var(--accent-glow);
            background: rgba(255, 255, 255, 0.1);
        }

        .form-group input::placeholder {
            color: var(--text-muted);
        }

.btn-primary {
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

    .btn-primary::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s;
    }

    .btn-primary:hover::before {
        left: 100%;
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 25px var(--accent-glow);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

.btn-secondary {
    padding: 10px 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    backdrop-filter: blur(10px);
}

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.3);
    }

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

    .auth-switch a {
        color: var(--accent-light);
        text-decoration: none;
        font-weight: 500;
        transition: var(--transition);
    }

        .auth-switch a:hover {
            text-shadow: 0 0 10px var(--accent-glow);
        }

.error-message {
    color: var(--danger);
    text-align: center;
    font-size: 14px;
    min-height: 20px;
    margin-top: 10px;
}

/* ============================================================
   ЧАТ — LAYOUT
   ============================================================ */

#chat-screen {
    flex-direction: row;
    gap: 1px;
}

/* ============================================================
   САЙДБАР
   ============================================================ */

.sidebar {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: rgba(255, 255, 255, var(--glass-opacity));
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--glass-border);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    height: var(--header-height);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

    .user-info:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .user-info span {
        font-weight: 600;
        font-size: 14px;
    }

.sidebar-actions {
    display: flex;
    gap: 2px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

    .icon-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(1.05);
    }

.search-bar {
    padding: 10px 14px;
}

    .search-bar input {
        width: 100%;
        padding: 10px 16px;
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-xl);
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(10px);
        color: var(--text-primary);
        font-size: 13px;
        outline: none;
        transition: var(--transition);
    }

        .search-bar input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px var(--accent-subtle);
        }

        .search-bar input::placeholder {
            color: var(--text-muted);
        }

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

    .chat-list::-webkit-scrollbar {
        width: 3px;
    }

    .chat-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 3px;
    }

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border: 1px solid transparent;
}

    .chat-item:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .chat-item.active {
        background: var(--accent-subtle);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 20px var(--accent-glow);
    }

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-last-message {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item.active .chat-item-last-message {
    color: rgba(255, 255, 255, 0.7);
}

.chat-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.chat-item-time {
    font-size: 10px;
    color: var(--text-muted);
}

.unread-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px var(--accent-glow);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

    .empty-state .hint {
        font-size: 12px;
        margin-top: 8px;
    }

/* ============================================================
   АВАТАР
   ============================================================ */

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
}

    .avatar.small {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .avatar.large {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }

/* ============================================================
   ОБЛАСТЬ ЧАТА
   ============================================================ */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}

.no-chat-selected {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-message {
    text-align: center;
    color: var(--text-muted);
}

.welcome-icon {
    font-size: 80px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 40px var(--accent-glow));
    animation: float 3s ease-in-out infinite;
}

.welcome-message h2 {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ============================================================
   ЗАГОЛОВОК ЧАТА
   ============================================================ */

.chat-header {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: var(--header-height);
    background: rgba(255, 255, 255, var(--glass-opacity));
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

    .chat-header-info h3 {
        font-size: 15px;
        font-weight: 600;
    }

.chat-status {
    font-size: 12px;
    color: var(--success);
}

.chat-header-actions {
    display: flex;
    gap: 4px;
}

.mobile-back {
    display: none;
    font-size: 22px;
    margin-right: 8px;
}

/* ============================================================
   СООБЩЕНИЯ
   ============================================================ */

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

    .messages-container::-webkit-scrollbar {
        width: 4px;
    }

    .messages-container::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: auto;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    animation: messageIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.own {
    align-self: flex-end;
}

.message.other {
    align-self: flex-start;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    position: relative;
    word-wrap: break-word;
    line-height: 1.45;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.message.own .message-bubble {
    background: var(--bg-message-own);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-right-radius: 4px;
}

.message.other .message-bubble {
    background: var(--bg-message-other);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 4px;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 4px;
}

.message-text {
    font-size: 14px;
    white-space: pre-wrap;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

.message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

.message-status {
    font-size: 11px;
}

.message-edited {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.message-deleted {
    font-style: italic;
    color: var(--text-muted);
}

.message-system {
    align-self: center;
    max-width: 80%;
}

    .message-system .message-bubble {
        background: var(--accent-subtle);
        text-align: center;
        font-size: 12px;
        color: var(--text-secondary);
        border-radius: var(--radius-xl);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

.date-separator {
    text-align: center;
    padding: 16px 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

/* ============================================================
   ИНДИКАТОР НАБОРА
   ============================================================ */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.typing-dots {
    display: flex;
    gap: 3px;
}

    .typing-dots span {
        width: 5px;
        height: 5px;
        background: var(--accent-light);
        border-radius: 50%;
        animation: typingDot 1.4s infinite;
    }

        .typing-dots span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-dots span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ============================================================
   ПОЛЕ ВВОДА
   ============================================================ */

.message-input-area {
    padding: 12px 20px;
    background: rgba(255, 255, 255, var(--glass-opacity));
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-border);
}

.reply-preview {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    backdrop-filter: blur(10px);
}

.reply-content {
    flex: 1;
}

.reply-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-light);
    display: block;
}

.reply-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

#message-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    outline: none;
    transition: var(--transition);
}

    #message-input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px var(--accent-subtle);
        background: rgba(255, 255, 255, 0.1);
    }

    #message-input::placeholder {
        color: var(--text-muted);
    }

.send-btn {
    width: 42px !important;
    height: 42px !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover)) !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    transition: var(--transition);
    box-shadow: 0 2px 15px var(--accent-glow);
}

    .send-btn:hover {
        transform: scale(1.1) !important;
        box-shadow: 0 4px 25px var(--accent-glow);
    }

/* ============================================================
   МОДАЛЬНЫЕ ОКНА
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

    .modal.active {
        display: flex;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: rgba(20, 20, 40, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

    .modal-header h3 {
        font-size: 17px;
    }

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
}

/* ============================================================
   ТОСТЫ
   ============================================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 350px;
}

    .toast.success {
        background: rgba(16, 185, 129, 0.8);
    }

    .toast.error {
        background: rgba(239, 68, 68, 0.8);
    }

    .toast.info {
        background: hsla(var(--theme-hue), var(--theme-saturation), 45%, 0.8);
    }

@keyframes toastIn {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}

/* ============================================================
   КОНТЕКСТНОЕ МЕНЮ
   ============================================================ */

.context-menu {
    position: fixed;
    background: rgba(20, 20, 40, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 6px 0;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    min-width: 160px;
    animation: slideUp 0.15s ease;
}

.context-menu-item {
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

    .context-menu-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .context-menu-item.danger {
        color: var(--danger);
    }

/* ============================================================
   ФАЙЛЫ И МЕДИА
   ============================================================ */

.message-image-container {
    margin: 4px 0;
}

.message-image {
    max-width: 300px;
    max-height: 400px;
    border-radius: 10px;
    cursor: pointer;
    display: block;
    transition: var(--transition);
}

    .message-image:hover {
        transform: scale(1.02);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

.message-file a {
    text-decoration: none;
    color: inherit;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

    .file-info:hover {
        background: rgba(255, 255, 255, 0.1);
    }

.file-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.file-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.file-size {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================
   СТИКЕРЫ
   ============================================================ */

.sticker-panel {
    position: absolute;
    bottom: 80px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    background: rgba(20, 20, 40, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 100;
    animation: slideUp 0.2s ease;
}

.sticker-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--glass-border);
}

.sticker-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    flex: 1;
    padding-right: 8px;
}

    .sticker-tabs::-webkit-scrollbar {
        height: 0;
    }

.sticker-tab {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 2px;
}

    .sticker-tab:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .sticker-tab.active {
        background: var(--accent-subtle);
        box-shadow: 0 0 10px var(--accent-glow);
    }

    .sticker-tab img {
        width: 28px;
        height: 28px;
        object-fit: cover;
        border-radius: 4px;
    }

    .sticker-tab .tab-emoji {
        font-size: 20px;
    }

.sticker-panel-actions {
    display: flex;
    gap: 2px;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

    .sticker-grid::-webkit-scrollbar {
        width: 3px;
    }

    .sticker-grid::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.1);
        border-radius: 3px;
    }

.sticker-item {
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: pointer;
    padding: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .sticker-item:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(1.15);
    }

    .sticker-item img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.sticker-message {
    max-width: 150px;
    max-height: 150px;
}

.pack-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pack-preview-stickers {
    display: flex;
    gap: 4px;
}

    .pack-preview-stickers img {
        width: 40px;
        height: 40px;
        object-fit: contain;
    }

.pack-info {
    flex: 1;
}

    .pack-info h4 {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .pack-info span {
        font-size: 12px;
        color: var(--text-muted);
    }

/* ============================================================
   ПРОФИЛЬ МЕНЮ
   ============================================================ */

.profile-menu {
    position: absolute;
    bottom: 70px;
    left: 10px;
    width: 280px;
    background: rgba(20, 20, 40, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 200;
    animation: slideUp 0.2s ease;
    padding: 16px;
}

.profile-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 12px;
}

.profile-menu-name {
    font-weight: 600;
    font-size: 15px;
}

.profile-menu-id {
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

    .profile-menu-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .profile-menu-item.danger {
        color: var(--danger);
    }

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: absolute;
        z-index: 10;
        left: 0;
        top: 0;
        height: 100%;
    }

        .sidebar.hidden-mobile {
            display: none;
        }

    .mobile-back {
        display: flex !important;
    }

    .message {
        max-width: 85%;
    }
}
