:root {
    /* Обновленная цветовая палитра */
    --primary-color: #7C3AED;
    --secondary-color: #8B5CF6;
    --accent-color: #6D28D9;
    --light-purple: #F5F3FF;
    --dark-purple: #5B21B6;
    --text-color: #1F2937;
    --light-text: #6B7280;
    --border-color: rgba(0, 0, 0, 0.08);
    --hover-color: rgba(124, 58, 237, 0.08);
    --background-color: #ffffff;
    --my-message-bg: #7C3AED;
    --sidebar-bg: #ffffff;
    --active-chat-bg: rgba(124, 58, 237, 0.08);
    --admin-color: #EF4444;
    --admin-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --mobile-header-height: 64px;
    --mobile-footer-height: 72px;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    
    /* Новые переменные */
    --gradient-primary: linear-gradient(135deg, #7C3AED, #6D28D9);
    --gradient-hover: linear-gradient(135deg, #8B5CF6, #7C3AED);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Oxygen, Ubuntu, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
}

/* Улучшенные анимации */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.95); opacity: 0; }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulseSoft {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* НОВАЯ Анимация для смайлика "в разработке" */
@keyframes emojiPulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        opacity: 0.7;
    }
    25% { 
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.15) rotate(0deg);
        opacity: 1;
    }
    75% { 
        transform: scale(1.1) rotate(-5deg);
        opacity: 0.8;
    }
}

@keyframes constructionPulse {
    0%, 100% { 
        transform: scale(1);
        background: var(--warning-color);
    }
    50% { 
        transform: scale(1.1);
        background: #FBBF24;
    }
}

/* Контейнеры */
.container {
    display: flex;
    height: 100vh;
    position: relative;
    backdrop-filter: blur(10px);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    padding: 20px;
}

.auth-box {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.8s ease;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s;
}

.auth-box:hover::before {
    left: 100%;
}

.auth-logo {
    color: white;
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.auth-logo i {
    margin-right: 12px;
    font-size: 2.6rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 6px;
    gap: 4px;
    backdrop-filter: blur(10px);
}

.auth-tab {
    flex: 1;
    padding: 16px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    position: relative;
}

.auth-tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: var(--shadow-sm);
}

.auth-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.auth-form {
    display: none;
    animation: fadeIn 0.5s ease;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 16px 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus, .form-group select:focus {
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.15);
}

.btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin-top: 8px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    background: var(--gradient-hover);
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 12px;
    display: none;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--error-color);
    animation: slideIn 0.3s ease;
}

/* ИСПРАВЛЕННЫЕ СТИЛИ ДЛЯ ПУСТЫХ СОСТОЯНИЙ */
.empty-states-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
}

.empty-state-content {
    max-width: 400px;
    animation: fadeIn 0.6s ease;
}

.empty-state-icon {
    font-size: 80px;
    color: var(--primary-color);
    margin-bottom: 24px;
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
}

.empty-state-description {
    font-size: 1rem;
    color: var(--light-text);
    margin-bottom: 32px;
    line-height: 1.6;
}

.empty-state-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-state-btn {
    padding: 12px 24px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.empty-state-btn i {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

/* ИСПРАВЛЕНИЕ: Правильное выравнивание плюса */
.empty-state-btn .icon-plus {
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.empty-state-btn.primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.empty-state-btn.primary:hover {
    background: var(--gradient-hover);
}

/* Специфические стили для разных типов пустых состояний */
.empty-state-chats .empty-state-icon {
    color: var(--primary-color);
}

.empty-state-group-chats .empty-state-icon {
    color: var(--success-color);
}

.empty-state-messages .empty-state-icon {
    color: var(--warning-color);
}

.empty-state-hidden {
    display: none !important;
}

/* Главное приложение */
.app-container {
    display: none;
    width: 100%;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-lg);
}

.sidebar {
    width: 360px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fafafa;
}

/* Улучшенный мобильный хедер */
.mobile-header {
    display: none;
    height: var(--mobile-header-height);
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.mobile-header .app-logo {
    font-size: 1.3rem;
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.mobile-header-actions {
    display: flex;
    gap: 16px;
}

.mobile-header-btn {
    font-size: 20px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-header-btn:hover {
    background: var(--hover-color);
    transform: scale(1.1);
}

/* Улучшенный мобильный футер */
.mobile-footer {
    display: none;
    height: var(--mobile-footer-height);
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    padding: 8px 20px;
    backdrop-filter: blur(20px);
}

.mobile-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    color: var(--light-text);
    position: relative;
    flex: 1;
    max-width: 80px;
}

.mobile-nav-item.active {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.mobile-nav-item:hover:not(.active) {
    background: var(--hover-color);
    transform: translateY(-2px);
}

.mobile-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-item span {
    font-size: 11px;
    font-weight: 600;
}

/* Улучшенный сайдбар */
.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: white;
}

.app-logo {
    color: var(--primary-color);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.app-logo i {
    margin-right: 10px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    margin-top: 12px;
    gap: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2px;
}

.user-status {
    font-size: 13px;
    color: var(--light-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.logout-btn, .switch-account-btn {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    font-size: 18px;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover, .switch-account-btn:hover {
    background: var(--hover-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Поиск */
.sidebar-search {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: white;
}

.search-container {
    position: relative;
    margin-bottom: 15px;
}

.search-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-text);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-input {
    width: 100%;
    padding: 14px 14px 14px 48px;
    border: 2px solid #f5f5f5;
    border-radius: var(--radius-lg);
    font-size: 15px;
    background: #fafafa;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    background: white;
    transform: translateY(-1px);
}

.search-buttons {
    display: flex;
    gap: 12px;
}

.refresh-chat-btn, .new-chat-search-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.refresh-chat-btn i, .new-chat-search-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.refresh-chat-btn:hover, .new-chat-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.refresh-chat-btn.rotating i {
    animation: rotate 1s linear infinite;
}

/* Навигация */
.nav-list {
    list-style: none;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: white;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 6px;
    transition: var(--transition);
    color: var(--light-text);
    font-weight: 500;
    position: relative;
}

.nav-item:hover {
    background: var(--hover-color);
    transform: translateX(4px);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.nav-item i {
    margin-right: 12px;
    font-size: 18px;
    transition: transform 0.3s ease;
    width: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-badge {
    background: var(--error-color);
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
    animation: pulseSoft 2s infinite;
}

/* Список чатов */
.chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: white;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    margin-bottom: 10px;
    transition: var(--transition);
    border: 1.5px solid transparent;
    background: white;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.chat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.chat-item.active {
    background: var(--active-chat-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.chat-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin-right: 14px;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    transition: var(--transition);
    position: relative;
}

.chat-item:hover .chat-avatar {
    transform: scale(1.05);
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-color);
}

.chat-meta {
    font-size: 12px;
    color: var(--light-text);
    white-space: nowrap;
}

.chat-last-message {
    font-size: 14px;
    color: var(--light-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-count {
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulseSoft 2s infinite;
}

/* Контакты */
.contact-item {
    position: relative;
}

.online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--success-color);
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

.btn-start-chat {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.btn-start-chat:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Хедер чата */
.chat-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.menu-toggle {
    font-size: 22px;
    margin-right: 16px;
    cursor: pointer;
    display: none;
    color: var(--primary-color);
    padding: 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: var(--hover-color);
    transform: scale(1.1);
}

.current-chat-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin-right: 14px;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    transition: var(--transition);
    position: relative;
}

.current-chat-avatar:hover {
    transform: scale(1.05);
}

.current-chat-info {
    flex: 1;
}

.current-chat-name {
    font-weight: 700;
    font-size: 17px;
    color: var(--text-color);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-chat-status {
    font-size: 14px;
    color: var(--light-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-actions {
    display: flex;
    gap: 12px;
}

.chat-action-btn {
    font-size: 20px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-action-btn:hover {
    background: var(--hover-color);
    transform: scale(1.1);
    color: var(--accent-color);
}

/* Контейнер сообщений */
.messages-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    scroll-behavior: smooth;
    position: relative;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--light-text);
    animation: float 3s ease-in-out infinite;
}

.welcome-message i {
    font-size: 72px;
    color: var(--primary-color);
    margin-bottom: 24px;
    opacity: 0.7;
    display: flex;
    justify-content: center;
}

.welcome-message h2 {
    margin-bottom: 12px;
    color: var(--text-color);
    font-weight: 700;
}

.welcome-message p {
    font-size: 1.1rem;
    opacity: 0.8;
    max-width: 400px;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--light-text);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
    color: var(--primary-color);
    display: flex;
    justify-content: center;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 15px;
}

/* Улучшенные сообщения */
.message {
    display: flex;
    margin-bottom: 16px;
    animation: fadeIn 0.4s ease;
    position: relative;
    padding: 0 8px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    align-self: flex-end;
    border: 2px solid var(--primary-color);
    transition: var(--transition);
}

.message:hover .message-avatar {
    transform: scale(1.05);
}

.message-content {
    max-width: 70%;
    position: relative;
}

.message-sender {
    font-size: 13px;
    color: var(--light-text);
    margin-bottom: 4px;
    font-weight: 500;
    padding-left: 4px;
}

.message-text {
    background: white;
    padding: 14px 18px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    word-wrap: break-word;
    line-height: 1.5;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    position: relative;
    transition: var(--transition);
    font-size: 15px;
}

.message-text:hover {
    box-shadow: var(--shadow);
}

.my-message {
    flex-direction: row-reverse;
}

.my-message .message-avatar {
    margin-right: 0;
    margin-left: 12px;
}

.my-message .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.my-message .message-text {
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.message-time {
    font-size: 11px;
    color: var(--light-text);
    margin-top: 4px;
    padding: 0 4px;
}

.message-status {
    font-size: 11px;
    color: var(--light-text);
    margin-top: 2px;
    text-align: right;
}

/* Файлы в сообщениях */
.message-file {
    margin-top: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    max-width: 280px;
    transition: var(--transition);
}

.message-file:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.message-file-preview {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.message-file-preview:hover {
    background: #f1f5f9;
    transform: scale(1.02);
}

.message-file-info {
    padding: 12px;
}

.message-file-name {
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-all;
    font-size: 14px;
}

.message-file-size {
    font-size: 12px;
    color: var(--light-text);
}

.message-file-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 12px;
    transition: var(--transition);
    font-weight: 500;
}

.message-file-download:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

/* Голосовые сообщения */
.message-voice {
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 240px;
    transition: var(--transition);
}

.message-voice:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.message-voice-play {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.message-voice-play:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.message-voice-waveform {
    flex: 1;
    height: 28px;
    background: #f8fafc;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

.message-voice-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 14px;
    transition: width 0.1s linear;
}

.message-voice-duration {
    font-size: 12px;
    color: var(--light-text);
    min-width: 36px;
    text-align: center;
}

/* ИСПРАВЛЕННЫЙ Улучшенный ввод сообщений */
.message-input-container {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: white;
    gap: 12px;
    position: relative;
}

.message-input-wrapper {
    flex: 1;
    position: relative;
}

.message-input {
    width: 100%;
    padding: 16px 60px 16px 18px;
    border: 2px solid #f0f0f0;
    border-radius: 24px;
    font-size: 15px;
    background: white;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    transition: var(--transition);
}

.message-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.message-input-wrapper.focused .message-input {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ИСПРАВЛЕНИЕ: Возвращаем иконки для кнопок ввода */
.emoji-btn, .attachment-btn, .send-btn, .voice-message-btn {
    font-size: 20px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: var(--transition);
    position: relative;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

/* Восстанавливаем иконки с использованием псевдоэлементов */
.emoji-btn::before {
    content: "😊";
    font-size: 20px;
}

.attachment-btn::before {
    content: "📎";
    font-size: 20px;
}

.voice-message-btn::before {
    content: "🎤";
    font-size: 20px;
}

.send-btn::before {
    content: "➤";
    font-size: 20px;
    color: white;
}

.emoji-btn:hover, .attachment-btn:hover, .voice-message-btn:hover {
    background: var(--hover-color);
    transform: scale(1.1);
}

.emoji-btn.active, .attachment-btn.active {
    background: var(--primary-color);
    color: white;
}

.send-btn {
    background: var(--gradient-primary);
    color: white;
}

.send-btn:hover:not(:disabled) {
    background: var(--gradient-hover);
    transform: scale(1.1);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.voice-message-btn.recording {
    color: var(--error-color);
    animation: pulse 1s infinite;
}

.voice-message-btn.recording::before {
    content: "●";
    color: var(--error-color);
}

/* НОВЫЙ СТИЛЬ для смайлика "в разработке" */
.emoji-btn.in-progress {
    position: relative;
    animation: emojiPulse 2s ease-in-out infinite;
}

.emoji-btn.in-progress::after {
    content: "🛠";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    background: var(--warning-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: constructionPulse 1.5s ease-in-out infinite;
}

/* Emoji панель */
.emoji-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    transform: translateY(20px);
    opacity: 0;
    transition: var(--transition);
}

.emoji-panel.active {
    display: grid;
    transform: translateY(0);
    opacity: 1;
}

.emoji-item {
    font-size: 24px;
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background: var(--hover-color);
    transform: scale(1.2);
}

/* Запись голоса */
.voice-recorder {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.voice-recorder.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.voice-recorder-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 30px;
    text-align: center;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.5s ease;
}

.voice-recorder-icon {
    font-size: 40px;
    color: var(--error-color);
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
    display: flex;
    justify-content: center;
}

.voice-recorder-timer {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.voice-recorder-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.voice-recorder-cancel, .voice-recorder-send {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-recorder-cancel {
    background: #f8fafc;
    color: var(--light-text);
    border: 1px solid var(--border-color);
}

.voice-recorder-cancel:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.voice-recorder-send {
    background: var(--gradient-primary);
    color: white;
}

.voice-recorder-send:hover {
    background: var(--gradient-hover);
    transform: translateY(-2px);
}

/* Улучшенные уведомления */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 380px;
}

.notification {
    display: flex;
    align-items: center;
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    animation: slideInRight 0.3s ease-out;
    min-width: 300px;
    border-left: 4px solid;
    transform: translateX(100%);
    opacity: 0;
    transition: var(--transition);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--error-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

.notification.info {
    border-left-color: var(--primary-color);
}

.notification-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification.success .notification-icon {
    color: var(--success-color);
}

.notification.error .notification-icon {
    color: var(--error-color);
}

.notification.warning .notification-icon {
    color: var(--warning-color);
}

.notification.info .notification-icon {
    color: var(--primary-color);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
    font-size: 14px;
}

.notification-message {
    font-size: 13px;
    color: var(--light-text);
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--light-text);
    margin-left: 12px;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    background: #f8fafc;
    color: var(--text-color);
}

/* Админ панель */
.admin-container {
    display: none;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    background: var(--admin-bg);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: white;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
}

.admin-logo {
    display: flex;
    align-items: center;
    color: var(--admin-color);
    font-size: 1.4rem;
    font-weight: 700;
}

.admin-logo i {
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
}

.admin-tab {
    padding: 18px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: var(--light-text);
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    position: relative;
    font-weight: 500;
}

.admin-tab:hover {
    color: var(--admin-color);
    background: rgba(239, 68, 68, 0.05);
}

.admin-tab.active {
    color: var(--admin-color);
    border-bottom-color: var(--admin-color);
}

.admin-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #f8fafc;
}

.admin-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-tab-content.active {
    display: block;
}

/* Улучшенные карточки статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--light-text);
    font-weight: 500;
    font-size: 14px;
}

/* Улучшенная таблица */
.admin-table-container {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--light-purple);
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.admin-table tr:hover {
    background: var(--light-purple);
}

/* Улучшенные кнопки действий */
.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    margin-right: 6px;
    transition: var(--transition);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-edit {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.btn-ban {
    background: rgba(239, 68, 68, 0.1);
    color: var(--admin-color);
}

.btn-unban {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--admin-color);
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Админ float button */
.admin-float-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
}

.admin-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(124, 58, 237, 0.4);
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.5s ease;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
}

.modal-close {
    font-size: 24px;
    color: var(--light-text);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f1f5f9;
    color: var(--text-color);
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Feature Modal */
.feature-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.feature-modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    max-width: 380px;
    width: 100%;
    animation: bounceIn 0.5s ease;
    border: 1px solid var(--border-color);
}

.feature-modal-icon {
    font-size: 52px;
    margin-bottom: 20px;
    color: var(--warning-color);
    display: flex;
    justify-content: center;
}

.feature-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
}

.feature-modal-text {
    color: var(--light-text);
    margin-bottom: 24px;
    line-height: 1.5;
    font-size: 15px;
}

.feature-modal-close {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.feature-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* File Modal */
.file-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
}

.file-modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    min-height: 400px;
}

.file-modal-body img,
.file-modal-body video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-md);
}

.file-modal-body audio {
    width: 100%;
    max-width: 500px;
}

.file-modal-body .file-download {
    padding: 40px;
    text-align: center;
    width: 100%;
}

.file-download-icon {
    font-size: 56px;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.file-download-info {
    margin-bottom: 20px;
}

.file-download-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 16px;
}

.file-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
    font-size: 14px;
}

.file-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* Поиск и выделение */
mark {
    background: #FEF3C7;
    color: #92400E;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .sidebar {
        width: 320px;
    }
    
    .chat-item {
        padding: 14px;
    }
    
    .message-content {
        max-width: 75%;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        z-index: 1000;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        width: 100%;
        padding-bottom: var(--mobile-footer-height);
    }
    
    .mobile-header {
        display: flex;
    }
    
    .mobile-footer {
        display: block;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .message-input-container {
        padding: 16px 20px;
    }
    
    .messages-container {
        padding: 20px 12px;
        padding-bottom: calc(20px + var(--mobile-footer-height));
    }
    
    .admin-float-btn {
        bottom: calc(30px + var(--mobile-footer-height));
    }
    
    .emoji-panel {
        grid-template-columns: repeat(6, 1fr);
        padding: 16px;
    }
    
    .notification {
        min-width: 280px;
        margin: 10px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .empty-state-content {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .empty-state-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .empty-state-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .auth-box {
        padding: 24px 20px;
        margin: 10px;
    }
    
    .chat-item {
        padding: 12px;
    }
    
    .message-text {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .emoji-panel {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .admin-table-container {
        overflow-x: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .empty-state-icon {
        font-size: 60px;
    }
    
    .empty-state-title {
        font-size: 1.3rem;
    }
    
    .message-input-container {
        gap: 8px;
    }
    
    .emoji-btn, .attachment-btn, .send-btn, .voice-message-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
}

/* Темизация */
body.theme-dark {
    --background-color: #1a1a1a;
    --sidebar-bg: #2d2d2d;
    --text-color: #ffffff;
    --light-text: #b0b0b0;
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-color: rgba(124, 58, 237, 0.2);
    --light-purple: rgba(124, 58, 237, 0.1);
}

body.theme-light {
    --background-color: #ffffff;
    --sidebar-bg: #f8f9fa;
    --text-color: #1F2937;
    --light-text: #6B7280;
    --border-color: rgba(0, 0, 0, 0.08);
    --hover-color: rgba(124, 58, 237, 0.08);
}

/* Прокрутка */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Утилиты */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.shadow-hover {
    transition: var(--transition);
}

.shadow-hover:hover {
    box-shadow: var(--shadow);
}

/* Состояния загрузки */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

/* Анимация появления для элементов списка */
.chat-item, .nav-item, .contact-item {
    animation: slideIn 0.3s ease;
}

.chat-item:nth-child(even) {
    animation-delay: 0.1s;
}

/* Улучшенные фокус-состояния */
button:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Специальные стили для выбранного текста */
::selection {
    background: rgba(124, 58, 237, 0.2);
    color: inherit;
}

::-moz-selection {
    background: rgba(124, 58, 237, 0.2);
    color: inherit;
}

/* Улучшенные placeholder */
::placeholder {
    color: var(--light-text);
    opacity: 0.7;
}

:-ms-input-placeholder {
    color: var(--light-text);
    opacity: 0.7;
}

::-ms-input-placeholder {
    color: var(--light-text);
    opacity: 0.7;
}

/* Стили для улучшенного интерфейса */

/* Quick Login Demo */
.quick-login-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.quick-login-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 14px;
}

.quick-login-btn {
    padding: 8px 12px;
    font-size: 12px;
    margin: 2px;
    background: var(--primary-color);
    color: white;
}

.quick-login-btn:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

/* Account Switch Modal */
.account-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.account-item:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.account-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid var(--primary-color);
}

.account-info {
    flex: 1;
}

.account-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.account-email {
    color: #666;
    font-size: 14px;
}

.account-arrow {
    color: #999;
    font-size: 14px;
}

.empty-accounts, .error-accounts {
    text-align: center;
    padding: 40px;
    color: #777;
}

.empty-accounts i, .error-accounts i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.error-accounts {
    color: #ff6b6b;
}

.btn-retry {
    margin-top: 16px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* Offline and Sync Indicators */
.offline-indicator, .sync-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff9800;
    color: white;
    padding: 12px 20px;
    text-align: center;
    z-index: 10000;
    font-size: 14px;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sync-indicator {
    top: 50px;
    background: #2196f3;
}

/* Admin Improvements */
.admin-table-row:hover {
    background: #f8f9fa;
}

.empty-state-cell, .error-state-cell {
    text-align: center;
    padding: 40px;
    color: #777;
}

.empty-state-cell i, .error-state-cell i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.error-state-cell {
    color: #ff6b6b;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.online {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-badge.offline {
    background: #f5f5f5;
    color: #666;
}

.ban-badge {
    background: #ffebee;
    color: #c62828;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    margin-left: 8px;
}

.btn-action {
    padding: 6px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 0 2px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-ban {
    background: #ffebee;
    color: #c62828;
}

.btn-unban {
    background: #e8f5e8;
    color: #2e7d32;
}

.btn-edit {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-action:hover {
    transform: scale(1.1);
}

/* Voice Recorder Improvements */
.voice-recorder {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.voice-recorder.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.voice-recorder-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.5s ease;
}

.voice-recorder-icon {
    font-size: 40px;
    color: var(--error-color);
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

.voice-recorder-timer {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.voice-recorder-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.voice-recorder-cancel, .voice-recorder-send {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 14px;
}

.voice-recorder-cancel {
    background: #f8fafc;
    color: var(--light-text);
    border: 1px solid var(--border-color);
}

.voice-recorder-cancel:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.voice-recorder-send {
    background: var(--gradient-primary);
    color: white;
}

.voice-recorder-send:hover {
    background: var(--gradient-hover);
    transform: translateY(-2px);
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    .quick-login-container {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 12px;
    }
    
    .account-item {
        padding: 12px;
    }
    
    .account-avatar {
        width: 40px;
        height: 40px;
    }
}

/* Animation improvements */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.95); opacity: 0; }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}