/* =============== MESSENGER STYLES =============== */

.messenger {
    display: flex;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

/* ===== САЙДБАР ===== */
.sidebar {
    width: 380px;
    background: var(--bg-primary);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
}

.sidebar-header {
    padding: 24px;
    background: var(--bg-secondary);
    box-shadow: 0 4px 20px var(--shadow-dark);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-logo i {
    color: var(--accent-primary);
    font-size: 24px;
}

.profile-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    transition: all 0.3s ease;
}

.profile-btn:hover {
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    transform: scale(1.05);
}

.search-box {
    position: relative;
}

.search-container {
    position: relative;
}

.search-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.search-container input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--bg-primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light),
                0 0 0 2px var(--accent-glow);
}

.search-container input::placeholder {
    color: var(--text-muted);
}

/* ===== СПИСОК ЧАТОВ ===== */
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    position: relative;
}

.chat-item:hover {
    background: var(--bg-secondary);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    transform: translateX(4px);
}

.chat-item.active {
    background: var(--bg-secondary);
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.chat-name {
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.chat-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.chat-preview {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    position: absolute;
    right: 16px;
    top: 16px;
    box-shadow: 0 0 10px var(--success);
}

/* ===== FAB КНОПКА ===== */
.fab-new-chat {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--accent-glow);
    transition: all 0.3s ease;
    z-index: 10;
}

.fab-new-chat:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 32px rgba(110, 68, 255, 0.5);
}

/* ===== ОСНОВНОЙ ЧАТ ===== */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
}

/* ===== НЕТ ЧАТА ===== */
.no-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.no-chat-icon {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: white;
    margin-bottom: 32px;
    box-shadow: 0 20px 60px var(--accent-glow);
    animation: float 6s infinite ease-in-out;
}

.no-chat h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.no-chat p {
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
    font-size: 15px;
}

/* ===== ЗАГОЛОВОК ЧАТА ===== */
.chat-header {
    padding: 20px 32px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: 0 4px 20px var(--shadow-dark);
    position: relative;
    z-index: 2;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: white;
    position: relative;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.chat-header-details h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.chat-header-details p {
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
}

.chat-controls {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    transition: all 0.3s ease;
}

.icon-btn:hover {
    color: var(--accent-primary);
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    transform: translateY(-2px);
}

/* ===== СООБЩЕНИЯ ===== */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.message {
    display: flex;
    max-width: 70%;
    animation: messageAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message.own {
    align-self: flex-end;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    position: relative;
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    transition: all 0.3s ease;
}

.message.own .message-bubble {
    background: var(--accent-primary);
    color: white;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 18px;
    box-shadow: 4px 4px 12px rgba(110, 68, 255, 0.3), -4px -4px 8px var(--shadow-light);
}

.message:not(.own) .message-bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.message-text {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 6px;
    font-weight: 400;
}

.message-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.message-time {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 400;
}

.message-status {
    font-size: 12px;
    opacity: 0.9;
}

.message.own .message-status {
    color: rgba(255,255,255,0.9);
}

/* ===== ГОЛОСОВЫЕ СООБЩЕНИЯ ===== */
.voice-message {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.voice-wave {
    flex: 1;
    height: 30px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.voice-duration {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

/* ===== ПОЛЕ ВВОДА ===== */
.message-input-container {
    padding: 20px 32px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
    box-shadow: 0 -4px 20px var(--shadow-dark);
    position: relative;
    z-index: 2;
}

.input-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    transition: all 0.3s ease;
}

.toolbar-btn:hover {
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.toolbar-btn.active {
    color: var(--accent-primary);
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border-radius: 24px;
    padding: 4px;
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light),
                0 0 0 3px var(--accent-glow);
}

.input-wrapper input {
    flex: 1;
    padding: 14px 18px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 400;
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.emoji-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 4px;
}

.emoji-btn:hover {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.send-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--accent-glow);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 12px 32px rgba(110, 68, 255, 0.5);
}

.send-btn:active {
    transform: scale(0.95) rotate(0deg);
}

/* =============== СТИКЕРЫ И ЭМОДЗИ =============== */

.message-input-container {
    position: relative;
}

.stickers-panel {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 380px;
    max-height: 400px;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 1000;
    overflow: hidden;
    margin-bottom: 10px;
    animation: slideUp 0.3s ease;
}

.stickers-panel.active {
    display: flex;
    flex-direction: column;
}

.stickers-tabs {
    display: flex;
    padding: 8px;
    gap: 4px;
    background: var(--bg-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stickers-tabs::-webkit-scrollbar {
    display: none;
}

.sticker-tab {
    min-width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sticker-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sticker-tab.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.stickers-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
    max-height: 350px;
}

.stickers-content::-webkit-scrollbar {
    width: 6px;
}

.stickers-content::-webkit-scrollbar-track {
    background: transparent;
}

.stickers-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.stickers-section-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stickers-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.stickers-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.sticker-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    user-select: none;
}

.sticker-item:hover {
    background: var(--bg-tertiary);
    transform: scale(1.1);
}

.sticker-item:active {
    transform: scale(0.95);
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal-content {
    background: var(--bg-secondary);
    border-radius: 24px;
    width: 480px;
    max-width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 20px 20px 60px var(--shadow-dark), -20px -20px 60px var(--shadow-light);
    animation: slideUp 0.4s ease;
}

.modal-header {
    padding: 24px;
    background: var(--bg-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* ===== ПРОФИЛЬ ===== */
.profile-content {
    padding: 24px;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 600;
    color: white;
    margin: 0 auto 16px;
    box-shadow: 0 8px 32px var(--accent-glow);
}

.profile-name {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.profile-status {
    text-align: center;
    color: var(--success);
    font-size: 14px;
    margin-bottom: 24px;
}

.profile-info {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row i {
    width: 20px;
    color: var(--accent-primary);
    font-size: 16px;
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.action-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

.action-btn.danger {
    color: #ff4444;
}

.action-btn.danger:hover {
    background: rgba(255, 68, 68, 0.1);
}

/* ===== СПИСОК ПОЛЬЗОВАТЕЛЕЙ ===== */
.user-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    background: var(--bg-primary);
}

.user-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

/* ===== НАСТРОЙКИ ===== */
.settings-layout {
    display: flex;
    min-height: 500px;
}

.settings-sidebar {
    width: 200px;
    background: var(--bg-tertiary);
    border-radius: 16px 0 0 16px;
    padding: 24px 0;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.3s;
    font-size: 15px;
}

.settings-tab:hover {
    background: var(--bg-primary);
}

.settings-tab.active {
    background: var(--accent-primary);
    color: white;
}

.settings-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-height: 600px;
}

.settings-section {
    display: none;
}

.settings-section[data-section="profile"] {
    display: block;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 12px;
}

.theme-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.theme-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.theme-btn.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.color-options {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.background-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.bg-btn {
    padding: 16px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-btn.active {
    border-color: var(--accent-primary);
}

/* ===== ПЕРЕКЛЮЧАТЕЛИ ===== */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    min-width: 320px;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 8px 8px 24px var(--shadow-dark), -8px -8px 24px var(--shadow-light);
    z-index: 2000;
    animation: slideInRight 0.4s ease;
}

.notification i:first-child {
    font-size: 24px;
}

.notification span {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
}

/* ===== РЕАКЦИИ ===== */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 0;
}

.message-reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.message-reaction:hover {
    transform: scale(1.05);
    background: var(--bg-secondary);
}

.message-reaction.user-reacted {
    background: var(--accent-primary);
    color: white;
}

.message-reaction .reaction-emoji {
    font-size: 14px;
}

.message-reaction .reaction-count {
    font-size: 11px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

.message-reaction.add-reaction {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 4px 8px;
    opacity: 0.7;
}

.message-reaction.add-reaction:hover {
    opacity: 1;
    color: var(--accent-primary);
}

.message.own .message-reaction:not(.user-reacted) {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.message.own .message-reaction.add-reaction {
    background: rgba(255, 255, 255, 0.1);
}

/* Панель реакций */
.reactions-panel {
    position: fixed;
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    z-index: 1200;
    min-width: 300px;
}

.reactions-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.reactions-panel-header span {
    font-weight: 600;
}

.close-reactions {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-reactions:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.reactions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.reaction-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: var(--bg-primary);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reaction-btn:hover {
    transform: translateY(-2px);
    background: var(--bg-tertiary);
}

.reaction-btn.active {
    background: var(--accent-primary);
    color: white;
}

.reaction-btn.active .reaction-emoji {
    transform: scale(1.1);
}

.reaction-btn .reaction-emoji {
    font-size: 24px;
    transition: transform 0.2s ease;
}

.reaction-btn .reaction-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.reaction-btn.active .reaction-count {
    color: white;
}

.reactions-panel-footer {
    text-align: center;
}

.more-reactions {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.more-reactions:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

/* ===== АНИМАЦИИ ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .sidebar { width: 340px; }
}

@media (max-width: 768px) {
    .sidebar { width: 100%; }
    .messenger { flex-direction: column; }
    .main-chat { display: none; }
    .main-chat.active { display: flex; }
    .message { max-width: 85%; }
    .notification { min-width: 280px; left: 16px; right: 16px; width: auto; }
    .reactions-panel {
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
    }
    .reactions-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .stickers-panel {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
    }
    .stickers-grid {
        grid-template-columns: repeat(7, 1fr);
    }
    .sticker-item {
        font-size: 24px;
    }
    .reactions-panel {
        padding: 12px;
    }
    .reaction-btn {
        padding: 8px;
    }
    .reaction-btn .reaction-emoji {
        font-size: 20px;
    }
}

/* ===== КОНТЕКСТНОЕ МЕНЮ ===== */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 10px 10px 30px var(--shadow-dark), -10px -10px 30px var(--shadow-light);
    z-index: 1000;
    min-width: 200px;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.2s ease;
    pointer-events: none;
}

.context-menu.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.context-item {
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.context-item:hover {
    background: var(--bg-tertiary);
}

.context-item.danger {
    color: #ff4444;
}

.context-item.danger:hover {
    background: rgba(255, 68, 68, 0.1);
}

.context-item i {
    width: 20px;
    font-size: 16px;
}

/* ===== ПАНЕЛЬ ФАЙЛОВ ===== */
.panel {
    display: none;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 -4px 20px var(--shadow-dark);
}

.panel.active {
    display: block;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.file-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-option:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.file-option i {
    font-size: 24px;
    color: var(--accent-primary);
}

.file-option span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== ИНДИКАТОРЫ ПЕЧАТИ ===== */
.typing-indicator {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.reply-indicator {
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.reply-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reply-details {
    display: flex;
    flex-direction: column;
}

.reply-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
}

.reply-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.close-reply {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-reply:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}