/* CSS Variables for Themes */
:root {
    --primary-color: #0088cc;
    --primary-dark: #006699;
    --primary-light: #66b3ff;
    --background: #ffffff;
    --sidebar-background: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e1e5e9;
    --hover-color: #f0f2f5;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --online-color: #4caf50;
    --away-color: #ff9800;
    --offline-color: #999999;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}
[data-theme="light"] {
    --primary-color: #0088cc !important;
    --primary-hover: #0077b3 !important;
    --bg-color: #ffffff !important;
    --sidebar-bg: #f8f9fa !important;
    --chat-bg: #ffffff !important;
    --text-color: #333333 !important;
    --text-muted: #666666 !important;
    --border-color: #e1e5e9 !important;
    --hover-color: #f0f2f5 !important;
    --message-sent: #0088cc !important;
    --message-received: #e8f4fd !important;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    --accent-color: #ff6b6b !important;
}

[data-theme="dark"] {
    --primary-color: #0088cc !important;
    --primary-hover: #0099e6 !important;
    --bg-color: #1a1a1a !important;
    --sidebar-bg: #2d2d2d !important;
    --chat-bg: #1a1a1a !important;
    --text-color: #ffffff !important;
    --text-muted: #a0a0a0 !important;
    --border-color: #404040 !important;
    --hover-color: #3d3d3d !important;
    --message-sent: #0088cc !important;
    --message-received: #2d2d2d !important;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    --accent-color: #ff6b6b !important;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.9;
    overflow: hidden;
}

/* App Container */
.app-container {
    display: flex;
    height: 94vh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: 360px;
    background: var(--sidebar-background);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

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

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.user-details {
    flex: 1;
    min-width: 0;
}

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

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

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

/* Search Container */
.search-container {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 36px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.search-box .icon-btn {
    position: absolute;
    right: 6px;
    width: 24px;
    height: 24px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-btn:hover {
    background: var(--hover-color);
}

.badge {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-pane.active {
    display: flex;
}

/* Lists */
.chats-list,
.rooms-list,
.contacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-item,
.room-item,
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
}

.chat-item:hover,
.room-item:hover,
.contact-item:hover {
    background: var(--hover-color);
}

.chat-item.active,
.room-item.active {
    background: var(--primary-light);
    color: white;
}

.chat-avatar,
.room-avatar,
.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.room-avatar {
    background: var(--success-color);
}

.chat-info,
.room-info,
.contact-info {
    flex: 1;
    min-width: 0;
}

.chat-name,
.room-name,
.contact-name {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-details,
.room-details,
.contact-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-last-message {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.chat-time {
    color: var(--text-muted);
    white-space: nowrap;
}

.unread-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--online-color);
    margin-right: 4px;
}

/* Empty States */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    flex: 1;
}

.empty-state.active {
    display: flex;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Headers */
.rooms-header,
.contacts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.rooms-header h3,
.contacts-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.contacts-header {
    gap: 8px;
}

.contacts-header .search-box {
    flex: 1;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
}

.connection-status.connecting .status-dot {
    background: var(--warning-color);
    animation: pulse 1.5s ease-in-out infinite;
}

.connection-status.error .status-dot {
    background: var(--error-color);
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--sidebar-background);
}

.back-btn {
    display: none;
}

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

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

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

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

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

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

/* Messages Container */
.messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.welcome-message h2 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Message Styles */
.message {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: var(--border-radius-lg);
    position: relative;
    word-wrap: break-word;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--sidebar-background);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-sender {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.message-content {
    margin-bottom: 4px;
    line-height: 1.4;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin: 0 16px 16px;
    background: var(--sidebar-background);
    border-radius: var(--border-radius-lg);
    align-self: flex-start;
}

.typing-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

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

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

.typing-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s ease-in-out infinite both;
}

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

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

/* Message Input */
.message-input-container {
    display: none;
    align-items: flex-end;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--sidebar-background);
}

.message-input-actions {
    display: flex;
    gap: 4px;
}

.message-input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 8px 12px;
    transition: var(--transition);
}

.message-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
    background: transparent;
    max-height: 120px;
    min-height: 20px;
}

.send-btn {
    background: var(--primary-color);
    color: white;
}

.send-btn:hover {
    background: var(--primary-dark);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--sidebar-background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-color);
}

.btn-full {
    width: 100%;
}

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

.icon-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.modal-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

.modal-tab:hover {
    background: var(--hover-color);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.selected-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--sidebar-background);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    background: var(--text-primary);
    color: white;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 320px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: var(--success-color);
}

.notification.warning {
    background: var(--warning-color);
}

.notification.error {
    background: var(--error-color);
}

.notification.info {
    background: var(--primary-color);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.mobile-active {
        transform: translateX(0);
    }

    .chat-area.mobile-hidden {
        display: none;
    }

    .back-btn {
        display: flex;
    }

    .message {
        max-width: 85%;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .welcome-actions {
        flex-direction: column;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Стили для звонков */
.incoming-call-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--background);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: slideInRight 0.3s ease;
    backdrop-filter: blur(10px);
    border-left: 6px solid var(--primary-color);
    max-width: 320px;
    width: 90%;
}

.call-alert {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.caller-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.caller-details {
    flex: 1;
    min-width: 0;
}

.caller-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.call-type {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.call-time {
    font-size: 12px;
    color: var(--warning-color);
    font-weight: 600;
}

.call-actions {
    display: flex;
    gap: 8px;
}

.btn-accept-call, .btn-reject-call {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-accept-call {
    background: var(--success-color);
    color: white;
}

.btn-accept-call:hover {
    background: #45a049;
    transform: scale(1.1);
}

.btn-reject-call {
    background: var(--error-color);
    color: white;
}

.btn-reject-call:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.call-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 3000;
    display: none;
    font-family: inherit;
}

.call-interface.active {
    display: flex;
    flex-direction: column;
}

.call-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #1a1a1a;
}

.call-header {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.call-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

#callStatus {
    font-size: 16px;
    font-weight: 600;
}

#callTimer {
    font-size: 14px;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
}

.call-header-actions {
    display: flex;
    gap: 8px;
}

.call-header-actions .icon-btn {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.call-header-actions .icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000000;
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000000;
}

#localVideo {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    background: #000000;
    z-index: 20;
    transition: all 0.3s ease;
}

#localVideo:hover {
    transform: scale(1.05);
}

.call-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.call-info .caller-avatar {
    width: 80px;
    height: 80px;
    font-size: 32px;
    background: rgba(255, 255, 255, 0.2);
}

.caller-details {
    text-align: center;
}

.caller-details .caller-name {
    font-size: 24px;
    margin-bottom: 8px;
    color: white;
}

.call-status {
    font-size: 16px;
    opacity: 0.8;
}

.call-controls {
    padding: 24px 20px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.call-control-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.call-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.call-control-btn.muted {
    background: var(--error-color);
}

.call-control-btn.disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
}

.call-control-btn.active {
    background: var(--primary-color);
}

.btn-end-call {
    background: var(--error-color) !important;
}

.btn-end-call:hover {
    background: #d32f2f !important;
    transform: scale(1.1);
}

.call-stats {
    position: absolute;
    bottom: 100px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 15;
    backdrop-filter: blur(10px);
    display: none;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    opacity: 0.8;
}

/* Анимации для звонков */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    80%, 100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--success-color);
    border-radius: 50%;
    animation: pulse-ring 1.5s ease-in-out infinite;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .incoming-call-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
    }

    .call-alert {
        gap: 12px;
    }

    .caller-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .caller-name {
        font-size: 14px;
    }

    .call-type {
        font-size: 12px;
    }

    .btn-accept-call, .btn-reject-call {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    #localVideo {
        width: 120px;
        height: 90px;
        bottom: 80px;
        right: 10px;
    }

    .call-controls {
        padding: 16px 10px;
        gap: 12px;
    }

    .call-control-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .call-header {
        padding: 12px 16px;
    }

    #callStatus {
        font-size: 14px;
    }

    #callTimer {
        font-size: 12px;
    }

    .call-info .caller-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .caller-details .caller-name {
        font-size: 18px;
    }

    .call-stats {
        bottom: 80px;
        left: 10px;
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* Полноэкранный режим */
.call-interface:fullscreen .video-container {
    width: 100vw;
    height: 100vh;
}

.call-interface:fullscreen #remoteVideo {
    object-fit: contain;
}

/* Состояния качества соединения */
.connection-quality.excellent {
    color: #4caf50;
}

.connection-quality.good {
    color: #ff9800;
}

.connection-quality.poor {
    color: #f44336;
}

.connection-quality.disconnected {
    color: #9e9e9e;
}

/* Минимизированный режим */
.call-interface.minimized {
    width: 300px;
    height: 200px;
    top: auto;
    bottom: 20px;
    right: 20px;
    left: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.call-interface.minimized .call-header,
.call-interface.minimized .call-controls,
.call-interface.minimized .call-stats {
    display: none;
}

.call-interface.minimized .video-container {
    height: 100%;
}

.call-interface.minimized #localVideo {
    width: 80px;
    height: 60px;
    bottom: 10px;
    right: 10px;
}

/* Индикатор загрузки для видео */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 16px;
    z-index: 15;
}

/* Улучшенные скроллбары для call-интерфейса */
.call-interface ::-webkit-scrollbar {
    width: 6px;
}

.call-interface ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.call-interface ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.call-interface ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}



/* Интерфейс записи аудио */
.recording-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.recording-container {
    background: var(--background);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 320px;
    width: 90%;
}

.recording-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.recording-indicator {
    position: relative;
    width: 50px;
    height: 50px;
}

.recording-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--error-color);
    font-size: 20px;
    z-index: 2;
}

.pulseRecording {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--error-color);
    border-radius: 50%;
    animation: pulseRecording 1.5s ease-in-out infinite;
}

.recording-text {
    font-weight: 600;
    color: var(--text-primary);
}

.recording-visualizer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 3px;
    height: 60px;
    margin: 20px 0;
    padding: 10px;
    background: var(--sidebar-background);
    border-radius: 8px;
}

.visualizer-bar {
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.recording-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Панель загрузки файлов */
.upload-panel {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

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

.upload-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

.upload-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--sidebar-background);
}

.upload-item:last-child {
    margin-bottom: 0;
}

.upload-item.completed {
    background: rgba(76, 175, 80, 0.1);
}

.upload-item.error {
    background: rgba(244, 67, 54, 0.1);
}

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

.upload-file-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.upload-file-details {
    flex: 1;
    min-width: 0;
}

.upload-file-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.upload-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 150px;
}

.upload-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.upload-progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 30px;
}

.upload-item-actions {
    display: flex;
    gap: 4px;
}

.upload-item-actions .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.upload-panel .upload-actions {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

/* Сообщения с файлами */
.file-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--sidebar-background);
    border-radius: 12px;
    margin: 8px 0;
    border: 1px solid var(--border-color);
}

.file-message .file-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
}

.file-message .file-info {
    flex: 1;
    min-width: 0;
}

.file-message .file-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
}

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

.file-download {
    color: var(--primary-color);
    text-decoration: none;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.file-download:hover {
    background: var(--hover-color);
}

/* Аудио сообщения */
.audio-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--sidebar-background);
    border-radius: 12px;
    margin: 8px 0;
}

.audio-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-play-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.audio-play-btn:hover {
    background: var(--primary-dark);
}

.audio-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.audio-progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s ease;
}

.audio-duration {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 40px;
}

/* Drag & Drop зона */
.drag-over {
    background: rgba(0, 136, 204, 0.1) !important;
    border: 2px dashed var(--primary-color) !important;
}

/* Анимации */
@keyframes pulseRecording {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    80%, 100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Темная тема для новых элементов */
[data-theme="dark"] .emoji-picker {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .upload-panel {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .upload-item {
    background: #4a5568;
}

[data-theme="dark"] .file-message {
    background: #4a5568;
    border-color: #718096;
}

[data-theme="dark"] .audio-message {
    background: #4a5568;
}

/* Стили для уведомлений о новых функциях */
.feature-notification {
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    color: white;
    border: none;
}

.feature-notification.success {
    background: linear-gradient(135deg, var(--success-color), #4facfe);
}

.feature-notification.warning {
    background: linear-gradient(135deg, var(--warning-color), #f093fb);
}

.feature-notification.error {
    background: linear-gradient(135deg, var(--error-color), #f5576c);
}

/* Улучшенные скроллбары */
.upload-list::-webkit-scrollbar {
    width: 6px;
}

.upload-list::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.upload-list::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 3px;
}

.upload-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

.emoji-picker::-webkit-scrollbar {
    width: 6px;
}

.emoji-picker::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.emoji-picker::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 3px;
}

.emoji-picker::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

/* Индикаторы статуса */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-online {
    background: var(--success-color);
}

.status-away {
    background: var(--warning-color);
}

.status-offline {
    background: var(--text-secondary);
}

.status-busy {
    background: var(--error-color);
}

/* Анимация появления новых сообщений */
.message.new-message {
    animation: messageSlideIn 0.3s ease-out;
}

/* Стили для превью изображений */
.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-preview:hover {
    transform: scale(1.05);
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex {
    display: flex !important;
}

.flex-column {
    flex-direction: column !important;
}

.justify-center {
    justify-content: center !important;
}

.align-center {
    align-items: center !important;
}

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 1rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Print Styles */
@media print {
    .sidebar,
    .call-interface,
    .incoming-call-notification,
    .notification {
        display: none !important;
    }
    
    .chat-area {
        width: 100% !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* responsive-call.css */
.call-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.call-interface.minimized {
    width: 300px;
    height: 200px;
    top: auto;
    bottom: 20px;
    right: 20px;
    left: auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.call-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.call-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 15px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.video-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

#localVideo {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 120px;
    height: 90px;
    border: 2px solid white;
    border-radius: 8px;
    object-fit: cover;
    background: #000;
    transition: all 0.3s ease;
}

.call-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.caller-avatar {
    font-size: 60px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
}

.call-control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid white;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.call-control-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.call-control-btn.muted {
    background: rgba(255,0,0,0.3);
    border-color: #ff4444;
}

.call-control-btn.disabled {
    background: rgba(255,255,255,0.1);
    opacity: 0.6;
}

.btn-end-call {
    background: #ff4444 !important;
    border-color: #ff4444 !important;
}

.btn-end-call:hover {
    background: #cc0000 !important;
    transform: scale(1.05);
}

.quality-indicator {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(255,255,255,0.2);
}

.quality-indicator.low { background: rgba(76,175,80,0.3); }
.quality-indicator.medium { background: rgba(255,152,0,0.3); }
.quality-indicator.high { background: rgba(33,150,243,0.3); }

/* Входящий звонок */
.incoming-call-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-alert {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 90vw;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.caller-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.caller-details {
    text-align: left;
}

.caller-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.call-type {
    color: #666;
    margin-bottom: 5px;
}

.call-time {
    color: #ff4444;
    font-weight: bold;
}

.call-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-accept-call, .btn-reject-call {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-accept-call {
    background: #4CAF50;
    color: white;
}

.btn-reject-call {
    background: #ff4444;
    color: white;
}

.btn-accept-call:hover, .btn-reject-call:hover {
    transform: scale(1.1);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .call-header {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    #localVideo {
        width: 100px;
        height: 75px;
        bottom: 70px;
        right: 10px;
    }
    
    .call-controls {
        padding: 15px;
        gap: 15px;
        bottom: 10px;
    }
    
    .call-control-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .caller-avatar {
        font-size: 40px;
        width: 80px;
        height: 80px;
    }
    
    .call-alert {
        padding: 20px;
        margin: 20px;
    }
    
    .caller-info {
        flex-direction: column;
        text-align: center;
    }
    
    .caller-details {
        text-align: center;
    }
}

@media (max-width: 480px) {
    #localVideo {
        width: 80px;
        height: 60px;
    }
    
    .call-controls {
        gap: 10px;
        padding: 10px;
    }
    
    .call-control-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .caller-name {
        font-size: 20px;
    }
}
/* Добавляем в responsive-call.css или styles.css */

/* Стили для эмодзи-пикера */
.emoji-picker {
    position: absolute;
    bottom: 100%;
    right: 10px;
    margin-bottom: 10px;
    max-width: 90vw;
    width: 300px;
    z-index: 1000;
}

.emoji-picker::before {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 8px solid transparent;
    border-top-color: white;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .emoji-picker {
        right: 5px;
        left: 5px;
        width: auto;
        max-width: calc(100vw - 10px);
    }
    
    .emoji-picker::before {
        right: 50%;
        transform: translateX(50%);
    }
}

/* Контейнер для кнопок сообщений */
.message-input-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

/* Кнопки действий */
.message-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-emoji, .btn-audio, .btn-attach {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    color: #666;
}

.btn-emoji:hover, .btn-audio:hover, .btn-attach:hover {
    background-color: #f0f0f0;
}

/* Поле ввода сообщения */
.message-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.message-input:focus {
    border-color: #007bff;
}

/* Кнопка отправки */
.btn-send {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-send:hover {
    background: #0056b3;
}

.btn-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}
/* Стили для аудиосообщений */
.audio-message {
    max-width: 250px;
    min-width: 200px;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 15px;
}

.btn-play-audio {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-play-audio:hover {
    background: #0056b3;
}

.audio-info {
    flex: 1;
}

.audio-duration {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.audio-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.wave-bar {
    width: 3px;
    background: #007bff;
    border-radius: 2px;
    animation: wave 1.5s ease-in-out infinite;
}

.wave-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 12px; animation-delay: 0.2s; }
.wave-bar:nth-child(3) { height: 16px; animation-delay: 0.4s; }
.wave-bar:nth-child(4) { height: 12px; animation-delay: 0.6s; }
.wave-bar:nth-child(5) { height: 8px; animation-delay: 0.8s; }

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.5); }
}

/* Интерфейс записи аудио */
.recording-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.pulsating-circle {
    width: 16px;
    height: 16px;
    background: #ff4444;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.recording-text {
    font-weight: bold;
}

.recording-time {
    color: #ff4444;
    font-weight: bold;
}

.recording-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-cancel-recording, .btn-send-recording {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel-recording {
    background: #6c757d;
    color: white;
}

.btn-send-recording {
    background: #28a745;
    color: white;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .audio-message {
        max-width: 200px;
    }
    
    .audio-player {
        padding: 8px;
    }
    
    .btn-play-audio {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}
/* Улучшения для мобильного ввода */
.message-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 16px; /* Предотвращает зум в iOS */
    line-height: 1.4;
}

/* Убираем подсветку в iOS */
.message-input:focus {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: text;
}

/* Исправление для автозаполнения в мобильных браузерах */
.message-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px white inset;
}

/* Предотвращение изменения размера шрифта в iOS */
@media (max-width: 768px) {
    .message-input {
        font-size: 16px;
        transform: scale(1); /* Фикс для масштабирования в iOS */
    }
    
    .emoji-item {
        font-size: 22px; /* Увеличиваем эмодзи для мобильных */
        padding: 10px;
    }
}

/* Плавная анимация появления */
.emoji-picker {
    animation: emojiSlideUp 0.3s ease-out;
}

.emoji-picker.top-position {
    animation: emojiSlideDown 0.3s ease-out;
}

@keyframes emojiSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes emojiSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.emoji-picker {
    position: fixed;
    width: 350px;
    max-height: 400px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 10000;
    overflow: hidden;
    animation: emojiPickerSlideUp 0.2s ease-out;
}

.emoji-picker-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.emoji-categories {
    display: flex;
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
    overflow-x: auto;
}

.emoji-category-btn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin: 0 2px;
}

.emoji-category-btn:hover {
    background: #e9ecef;
}

.emoji-category-btn.active {
    background: #007bff;
    color: white;
}

.emoji-search-container {
    position: relative;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.emoji-search {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.emoji-search:focus {
    border-color: #007bff;
}

.emoji-search-container .fa-search {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

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

.emoji-item {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.emoji-item:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.emoji-picker-footer {
    padding: 12px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.emoji-picker-close {
    padding: 8px 16px;
    border: 1px solid #dc3545;
    border-radius: 6px;
    background: white;
    color: #dc3545;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.emoji-picker-close:hover {
    background: #dc3545;
    color: white;
}

.no-recent-emojis,
.no-emojis-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

@keyframes emojiPickerSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .emoji-picker {
        width: calc(100vw - 40px);
        max-height: 350px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .emoji-item {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Стили для аудио-сообщений */
.audio-message {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 250px;
}

.audio-message audio {
    width: 100%;
    height: 40px;
    border-radius: 20px;
    outline: none;
}

.audio-message audio::-webkit-media-controls-panel {
    background-color: #f1f3f4;
    border-radius: 20px;
}

.audio-message audio::-webkit-media-controls-play-button {
    background-color: #007bff;
    border-radius: 50%;
}

.audio-duration {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Для отправленных сообщений */
.message.sent .audio-message audio {
    background-color: #007bff;
}

.message.sent .audio-message audio::-webkit-media-controls-panel {
    background-color: #007bff;
    color: white;
}

/* Для полученных сообщений */
.message.received .audio-message audio {
    background-color: #f1f3f4;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 20px;
    min-width: 200px;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #007bff;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.audio-play-btn:hover {
    background: #0056b3;
}

.audio-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audio-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.wave-bar {
    width: 3px;
    background: #007bff;
    border-radius: 2px;
    transition: height 0.1s;
}

.audio-duration {
    font-size: 12px;
    color: #666;
}

/* Для отправленных сообщений */
.message.sent .audio-player {
    background: #007bff;
}

.message.sent .audio-play-btn {
    background: white;
    color: #007bff;
}

.message.sent .wave-bar {
    background: white;
}

.message.sent .audio-duration {
    color: rgba(255,255,255,0.8);
}







/* CSS Variables for Themes */
:root {
    --primary-color: #0088cc;
    --primary-hover: #0077b3;
    --bg-color: #ffffff;
    --sidebar-bg: #f8f9fa;
    --chat-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e1e5e9;
    --hover-color: #f0f2f5;
    --message-sent: #0088cc;
    --message-received: #e8f4fd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #0088cc;
    --primary-hover: #0099e6;
    --bg-color: #1a1a1a;
    --sidebar-bg: #2d2d2d;
    --chat-bg: #1a1a1a;
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #404040;
    --hover-color: #3d3d3d;
    --message-sent: #0088cc;
    --message-received: #2d2d2d;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    overflow: hidden;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    background: var(--bg-color);
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    background-size: cover;
    background-position: center;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
}

.user-status {
    font-size: 13px;
    color: var(--text-muted);
}

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

/* Search */
.search-container {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.1);
}

.search-box i {
    color: var(--text-muted);
    margin-right: 8px;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    color: var(--text-color);
    font-size: 14px;
}

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

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-btn .badge {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    min-width: 18px;
    text-align: center;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-pane.active {
    display: flex;
}

/* Lists */
.chats-list,
.rooms-list,
.contacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.chat-item,
.room-item,
.contact-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.chat-item:hover,
.room-item:hover,
.contact-item:hover {
    background: var(--hover-color);
}

.chat-item.active,
.room-item.active {
    background: var(--hover-color);
}

.chat-avatar,
.room-avatar,
.contact-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    margin-right: 12px;
    flex-shrink: 0;
}

.chat-info,
.room-info,
.contact-info {
    flex: 1;
    min-width: 0;
}

.chat-name,
.room-name,
.contact-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
}

.chat-details,
.room-details,
.contact-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}

.chat-last-message {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.unread-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    min-width: 18px;
    text-align: center;
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00d600;
    border-radius: 50%;
    margin-right: 4px;
}

/* Empty States */
.empty-state {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state.active {
    display: flex;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* Headers */
.rooms-header,
.contacts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.rooms-header h3,
.contacts-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.contacts-header {
    gap: 10px;
}

.contacts-header .search-box {
    flex: 1;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00d600;
}

.connection-status.connecting .status-dot {
    background: #ffa500;
    animation: pulse 1.5s infinite;
}

.connection-status.error .status-dot {
    background: #ff4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    position: relative;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--sidebar-bg);
}

.back-btn {
    display: none;
    margin-right: 15px;
}

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

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.chat-details {
    flex: 1;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
}

.chat-status {
    font-size: 13px;
    color: var(--text-muted);
}

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

/* Messages Container */
.messages-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.welcome-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.7;
}

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

.welcome-message p {
    margin-bottom: 30px;
    font-size: 16px;
}

.welcome-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Messages */
.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message.sent {
    align-self: flex-end;
    background: var(--message-sent);
    color: white;
    border-bottom-right-radius: 6px;
}

.message.received {
    align-self: flex-start;
    background: var(--message-received);
    color: var(--text-color);
    border-bottom-left-radius: 6px;
}

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

.message-content {
    margin-bottom: 4px;
    line-height: 1.4;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

/* File Messages */
.file-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

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

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

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

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

.file-download {
    color: var(--primary-color);
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
}

.file-download:hover {
    background: var(--hover-color);
}

/* Audio Messages */
.audio-message {
    padding: 8px 0;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--hover-color);
    border-radius: 20px;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.audio-play-btn:hover {
    background: var(--primary-hover);
}

.audio-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audio-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.wave-bar {
    width: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: height 0.3s ease;
}

.audio-duration {
    font-size: 12px;
    color: var(--text-muted);
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--hover-color);
    margin: 0 20px 10px;
    border-radius: var(--radius);
}

.typing-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.typing-text {
    font-size: 14px;
    color: var(--text-muted);
    flex: 1;
}

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

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Message Input */
.message-input-container {
    display: none;
    align-items: flex-end;
    gap: 12px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--sidebar-bg);
}

.message-input-actions {
    display: flex;
    gap: 8px;
    align-self: flex-end;
    margin-bottom: 10px;
}

.message-input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 8px 15px;
    transition: var(--transition);
}

.message-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.1);
}

#messageInput {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    color: var(--text-color);
    font-size: 14px;
    resize: none;
    max-height: 120px;
    min-height: 20px;
    line-height: 1.4;
    font-family: inherit;
}

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

.send-btn {
    align-self: flex-end;
    margin-bottom: 10px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--hover-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-full {
    width: 100%;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 16px;
}

.icon-btn:hover {
    background: var(--hover-color);
    color: var(--text-color);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.modal-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.modal-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Selected User Info */
.selected-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--hover-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Avatar Upload */
.avatar-upload,
.wallpaper-upload {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.current-avatar,
.current-wallpaper {
    flex-shrink: 0;
}

.current-avatar .user-avatar {
    width: 80px;
    height: 80px;
    font-size: 32px;
}

.current-wallpaper {
    width: 120px;
    height: 80px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.wallpaper-preview {
    padding: 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.avatar-actions,
.wallpaper-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-actions .btn-secondary,
.wallpaper-actions .btn-secondary {
    width: 100%;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: #00c851;
}

.notification.error {
    background: #ff4444;
}

.notification.info {
    background: #33b5e5;
}

.notification.warning {
    background: #ffbb33;
}

/* Recording Interface */
.recording-interface {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.recording-container {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.recording-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.recording-indicator {
    position: relative;
    width: 60px;
    height: 60px;
}

.recording-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #ff4444;
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #ff4444;
    border-radius: 50%;
    animation: pulse-ring 1.5s ease-in-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.recording-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.recording-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 40px;
    margin-bottom: 20px;
}

.visualizer-bar {
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.recording-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-active {
        transform: translateX(0);
    }
    
    .chat-area.mobile-hidden {
        display: none;
    }
    
    .back-btn {
        display: flex;
    }
    
    .modal-content {
        margin: 0;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .message {
        max-width: 85%;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .welcome-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 200px;
        max-width: 100%;
    }
    
    .avatar-upload,
    .wallpaper-upload {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .avatar-actions,
    .wallpaper-actions {
        width: 100%;
    }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Animation for new messages */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: messageSlideIn 0.3s ease;
}



/* CSS Variables for Themes */
:root {
    --primary-color: #0088cc;
    --primary-hover: #0077b3;
    --bg-color: #ffffff;
    --sidebar-bg: #f8f9fa;
    --chat-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e1e5e9;
    --hover-color: #f0f2f5;
    --message-sent: #0088cc;
    --message-received: #e8f4fd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
    --accent-color: #ff6b6b;
}

[data-theme="dark"] {
    --primary-color: #0088cc;
    --primary-hover: #0099e6;
    --bg-color: #1a1a1a;
    --sidebar-bg: #2d2d2d;
    --chat-bg: #1a1a1a;
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #404040;
    --hover-color: #3d3d3d;
    --message-sent: #0088cc;
    --message-received: #2d2d2d;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --accent-color: #ff6b6b;
}

/* Custom Themes */
[data-theme="sunset"] {
    --primary-color: #FF6B6B !important;
    --primary-hover: #ff5252 !important;
    --bg-color: #2D2D2D !important;
    --sidebar-bg: #3D3D3D !important;
    --chat-bg: #2D2D2D !important;
    --text-color: #FFFFFF !important;
    --text-muted: #CCCCCC !important;
    --border-color: #4D4D4D !important;
    --hover-color: #4D4D4D !important;
    --message-sent: #FF6B6B !important;
    --message-received: #3D3D3D !important;
    --accent-color: #4ECDC4 !important;
}

[data-theme="forest"] {
    --primary-color: #2E8B57 !important;
    --primary-hover: #267349 !important;
    --bg-color: #1A1F1C !important;
    --sidebar-bg: #2D3B2D !important;
    --chat-bg: #1A1F1C !important;
    --text-color: #E8F4EA !important;
    --text-muted: #A0B8A0 !important;
    --border-color: #3D4B3D !important;
    --hover-color: #3D4B3D !important;
    --message-sent: #2E8B57 !important;
    --message-received: #2D3B2D !important;
    --accent-color: #FFD700 !important;
}

[data-theme="ocean"] {
    --primary-color: #1E90FF !important;
    --primary-hover: #0d8aff !important;
    --bg-color: #0F1A2A !important;
    --sidebar-bg: #1E2B3A !important;
    --chat-bg: #0F1A2A !important;
    --text-color: #E6F7FF !important;
    --text-muted: #A0C8FF !important;
    --border-color: #2E3B4A !important;
    --hover-color: #2E3B4A !important;
    --message-sent: #1E90FF !important;
    --message-received: #1E2B3A !important;
    --accent-color: #FF69B4 !important;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Добавьте базовые стили для текста, которые не будут переопределяться */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    overflow: hidden;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    background: var(--bg-color);
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    background-size: cover;
    background-position: center;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
}

.user-status {
    font-size: 13px;
    color: var(--text-muted);
}

/* Убедитесь, что все текстовые элементы наследуют цвет */
.user-name,
.chat-title,
.modal-header h3,
.form-group label,
.rooms-header h3,
.contacts-header h3,
.welcome-message h2,
.message-content,
.file-name,
.contact-name,
.chat-name,
.room-name {
    color: var(--text-color) !important;
}

/* Убедитесь, что второстепенный текст виден */
.user-status,
.chat-status,
.chat-last-message,
.room-details,
.contact-details,
.file-size,
.audio-duration,
.message-time,
.empty-state p,
.search-box input::placeholder,
.form-group input::placeholder {
    color: var(--text-muted) !important;
}


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

/* Search */
.search-container {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.1);
}

.search-box i {
    color: var(--text-muted);
    margin-right: 8px;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    color: var(--text-color);
    font-size: 14px;
}

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

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-btn .badge {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    min-width: 18px;
    text-align: center;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-pane.active {
    display: flex;
}

/* Lists */
.chats-list,
.rooms-list,
.contacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.chat-item,
.room-item,
.contact-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.chat-item:hover,
.room-item:hover,
.contact-item:hover {
    background: var(--hover-color);
}

.chat-item.active,
.room-item.active {
    background: var(--hover-color);
}

.chat-avatar,
.room-avatar,
.contact-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    margin-right: 12px;
    flex-shrink: 0;
}

.chat-info,
.room-info,
.contact-info {
    flex: 1;
    min-width: 0;
}

.chat-name,
.room-name,
.contact-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
}

.chat-details,
.room-details,
.contact-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}

.chat-last-message {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.unread-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    min-width: 18px;
    text-align: center;
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00d600;
    border-radius: 50%;
    margin-right: 4px;
}

/* Empty States */
.empty-state {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state.active {
    display: flex;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* Headers */
.rooms-header,
.contacts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.rooms-header h3,
.contacts-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.contacts-header {
    gap: 10px;
}

.contacts-header .search-box {
    flex: 1;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00d600;
}

.connection-status.connecting .status-dot {
    background: #ffa500;
    animation: pulse 1.5s infinite;
}

.connection-status.error .status-dot {
    background: #ff4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    position: relative;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--sidebar-bg);
}

.back-btn {
    display: none;
    margin-right: 15px;
}

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

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.chat-details {
    flex: 1;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
}

.chat-status {
    font-size: 13px;
    color: var(--text-muted);
}

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

/* Messages Container */
.messages-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.welcome-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.7;
}

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

.welcome-message p {
    margin-bottom: 30px;
    font-size: 16px;
}

.welcome-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Messages */
.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    transition: var(--transition);
}

.message.sent {
    align-self: flex-end;
    background: var(--message-sent);
    color: white;
    border-bottom-right-radius: 6px;
}

.message.received {
    align-self: flex-start;
    background: var(--message-received);
    color: var(--text-color);
    border-bottom-left-radius: 6px;
}

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

.message-content {
    margin-bottom: 4px;
    line-height: 1.4;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: var(--transition);
}

.message:hover .message-actions {
    opacity: 1;
}

.message-action {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0.7;
    transition: var(--transition);
}

.message-action:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.message.sent .message-action {
    color: rgba(255, 255, 255, 0.8);
}

/* Message Editing */
.message-editing {
    background: var(--hover-color) !important;
    border: 2px solid var(--primary-color) !important;
}

.edit-textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 8px;
}

.edit-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Reply System */
.reply-preview {
    background: var(--hover-color);
    border-left: 3px solid var(--primary-color);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 13px;
    position: relative;
}

.reply-preview-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.reply-text {
    flex: 1;
    color: var(--text-muted);
    font-style: italic;
}

.cancel-reply {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    margin-left: 8px;
}

/* File Messages */
.file-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

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

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

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

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

.file-download {
    color: var(--primary-color);
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
}

.file-download:hover {
    background: var(--hover-color);
}

/* Audio Messages */
.audio-message {
    padding: 8px 0;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--hover-color);
    border-radius: 20px;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.audio-play-btn:hover {
    background: var(--primary-hover);
}

.audio-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audio-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.wave-bar {
    width: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: height 0.3s ease;
}

.audio-duration {
    font-size: 12px;
    color: var(--text-muted);
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--hover-color);
    margin: 0 20px 10px;
    border-radius: var(--radius);
}

.typing-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.typing-text {
    font-size: 14px;
    color: var(--text-muted);
    flex: 1;
}

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

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Message Input */
.message-input-container {
    display: none;
    align-items: flex-end;
    gap: 12px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--sidebar-bg);
}

.message-input-actions {
    display: flex;
    gap: 8px;
    align-self: flex-end;
    margin-bottom: 10px;
}

.message-input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 8px 15px;
    transition: var(--transition);
}

.message-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.1);
}

#messageInput {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    color: var(--text-color);
    font-size: 14px;
    resize: none;
    max-height: 120px;
    min-height: 20px;
    line-height: 1.4;
    font-family: inherit;
}

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

.send-btn {
    align-self: flex-end;
    margin-bottom: 10px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--hover-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-full {
    width: 100%;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 16px;
}

.icon-btn:hover {
    background: var(--hover-color);
    color: var(--text-color);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.modal-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.modal-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox Labels */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 8px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Selected User Info */
.selected-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--hover-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Avatar Upload */
.avatar-upload,
.wallpaper-upload {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.current-avatar,
.current-wallpaper {
    flex-shrink: 0;
}

.current-avatar .user-avatar {
    width: 80px;
    height: 80px;
    font-size: 32px;
}

.current-wallpaper {
    width: 120px;
    height: 80px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.wallpaper-preview {
    padding: 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.avatar-actions,
.wallpaper-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-actions .btn-secondary,
.wallpaper-actions .btn-secondary {
    width: 100%;
}

/* Privacy Settings */
.privacy-settings {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: 15px;
}

.privacy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.privacy-item:last-child {
    border-bottom: none;
}

.privacy-item span {
    font-weight: 500;
}

.privacy-item select {
    width: auto;
    min-width: 150px;
}

/* Security Settings */
.security-settings {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: 15px;
}

.security-item {
    margin-bottom: 15px;
}

.security-item:last-child {
    margin-bottom: 0;
}

/* Theme Selector */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.theme-preview {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.theme-preview:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.theme-preview.active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-colors {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.theme-colors .color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.theme-preview span {
    font-size: 12px;
    font-weight: 600;
}

/* Status Selector */
.status-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.status-option {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 13px;
}

.status-option:hover {
    border-color: var(--primary-color);
    background: var(--hover-color);
}

.status-option.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: var(--sidebar-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-details {
    background: var(--sidebar-bg);
    padding: 15px;
    border-radius: 8px;
}

.stats-details h4 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.stats-details ul {
    list-style: none;
    padding: 0;
}

.stats-details li {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

.stats-details li:last-child {
    border-bottom: none;
}

/* Search */
.search-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
}

.result-sender {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.result-text {
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.result-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* Highlight Animation */
@keyframes highlight {
    0% { background: var(--primary-color); }
    100% { background: transparent; }
}

.highlight-message {
    animation: highlight 2s ease;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: #00c851;
}

.notification.error {
    background: #ff4444;
}

.notification.info {
    background: #33b5e5;
}

.notification.warning {
    background: #ffbb33;
}

/* Recording Interface */
.recording-interface {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.recording-container {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.recording-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.recording-indicator {
    position: relative;
    width: 60px;
    height: 60px;
}

.recording-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #ff4444;
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #ff4444;
    border-radius: 50%;
    animation: pulse-ring 1.5s ease-in-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.recording-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.recording-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 40px;
    margin-bottom: 20px;
}

.visualizer-bar {
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.recording-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-active {
        transform: translateX(0);
    }
    
    .chat-area.mobile-hidden {
        display: none;
    }
    
    .back-btn {
        display: flex;
    }
    
    .modal-content {
        margin: 0;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .message {
        max-width: 85%;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .welcome-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 200px;
        max-width: 100%;
    }
    
    .avatar-upload,
    .wallpaper-upload {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .avatar-actions,
    .wallpaper-actions {
        width: 100%;
    }
    
    .privacy-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .privacy-item select {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-selector {
        grid-template-columns: 1fr;
    }
    
    .status-selector {
        grid-template-columns: 1fr;
    }
    
    .search-filters {
        flex-direction: column;
    }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Animation for new messages */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: messageSlideIn 0.3s ease;
}

/* Pulse glow animation */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 5px var(--primary-color); }
    50% { box-shadow: 0 0 20px var(--primary-color); }
    100% { box-shadow: 0 0 5px var(--primary-color); }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* Bot message styles */
.bot-message {
    border-left: 4px solid var(--accent-color);
}

.bot-message .message-sender {
    color: var(--accent-color);
}

/* Encryption indicator */
.encrypted-indicator {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 5px;
}

/* Self-destruct timer */
.self-destruct-timer {
    font-size: 10px;
    color: var(--accent-color);
    margin-left: 5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* Принудительное применение цветов для критических элементов */
.sidebar-header,
.chat-header,
.modal-header {
    background: var(--sidebar-bg) !important;
    border-color: var(--border-color) !important;
}

.search-box,
.message-input-wrapper,
.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

.chat-item,
.room-item,
.contact-item {
    background: transparent !important;
}

.chat-item:hover,
.room-item:hover,
.contact-item:hover {
    background: var(--hover-color) !important;
}

.message.sent {
    background: var(--message-sent) !important;
    color: white !important;
}

.message.received {
    background: var(--message-received) !important;
    color: var(--text-color) !important;
}


/* Стили для баннера установки PWA */
.pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    animation: slideUpBanner 0.5s ease-out;
}

@keyframes slideUpBanner {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.pwa-banner-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.pwa-banner-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.pwa-banner-text h4 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.pwa-banner-text p {
    margin: 0 0 10px 0;
    opacity: 0.9;
}

.pwa-banner-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.pwa-banner-text li {
    margin: 5px 0;
    font-size: 0.9em;
}

.pwa-banner-actions {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.pwa-install-help details {
    margin-top: 10px;
}

.pwa-install-help summary {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.9;
}

.install-steps {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.9em;
}

.install-steps ol {
    margin: 10px 0;
    padding-left: 20px;
}

.install-steps li {
    margin: 5px 0;
}

/* Стили для инструкций по установке */
.install-instructions {
    max-height: 60vh;
    overflow-y: auto;
}

.instruction-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.instruction-section:last-child {
    border-bottom: none;
}

.instruction-section h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.instruction-section ol {
    padding-left: 20px;
}

.instruction-section li {
    margin: 8px 0;
    line-height: 1.4;
}

.icon {
    font-weight: bold;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.benefit-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.benefit-text {
    font-size: 0.9em;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .pwa-banner {
        width: 95%;
        bottom: 10px;
    }
    
    .pwa-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .pwa-banner-actions {
        justify-content: center;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
}

/* Telegram Welcome Modal Styles */
.welcome-modal .modal-content {
    max-width: 500px;
    border-radius: 20px;
    overflow: hidden;
}

.telegram-welcome-modal .welcome-hero {
    text-align: center;
    padding: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: -20px -20px 20px -20px;
}

.telegram-welcome-modal .welcome-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.telegram-welcome-modal .welcome-features {
    display: grid;
    gap: 15px;
    margin: 25px 0;
}

.feature-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.feature-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.feature-text strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.feature-text p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.subscription-benefits {
    background: #f0f8ff;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.steps {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
}

.step-number {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.telegram-subscribe-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 15px 25px;
    font-size: 1.1em;
    width: 100%;
    margin: 15px 0;
}

.telegram-subscribe-btn.large {
    padding: 20px;
    font-size: 1.2em;
}

.btn-subtext {
    display: block;
    font-size: 0.8em;
    opacity: 0.9;
    margin-top: 5px;
}

.alternative-actions {
    text-align: center;
    margin: 20px 0;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.btn-share {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.telegram-share { border-color: #0088cc; color: #0088cc; }
.whatsapp-share { border-color: #25D366; color: #25D366; }
.copy-link { border-color: #6c757d; color: #6c757d; }

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.benefit-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.benefit-icon {
    font-size: 1.5rem;
}

.benefit-content strong {
    display: block;
    font-size: 0.9em;
}

.benefit-content span {
    font-size: 0.8em;
    color: #666;
}

.urgency-badge {
    background: #ff4757;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    display: inline-block;
    margin-bottom: 15px;
}

.or-divider {
    text-align: center;
    margin: 15px 0;
    color: #666;
    position: relative;
}

.or-divider:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.or-divider span {
    background: white;
    padding: 0 10px;
    position: relative;
}

.share-buttons-small {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-share-small {
    width: 40px;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    background: white;
    font-size: 1.2em;
}

.footer-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Invite Modal Styles */
.invite-link {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

#inviteText {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9em;
}

.share-buttons-large {
    display: grid;
    gap: 10px;
}

.btn-share-large {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-share-large:hover {
    transform: translateY(-2px);
}

.btn-share-large.telegram { border-color: #0088cc; color: #0088cc; }
.btn-share-large.whatsapp { border-color: #25D366; color: #25D366; }
.btn-share-large.copy { border-color: #6c757d; color: #6c757d; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        flex-direction: column;
        text-align: center;
    }
    
    .feature-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .share-buttons {
        flex-direction: column;
    }
}


.system-message {
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.system-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.system-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.system-text {
    text-align: left;
    flex: 1;
}

.system-text strong {
    color: #ffeb3b;
}

.system-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-telegram {
    background: #0088cc;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn-telegram:hover {
    background: #0077b3;
}

.telegram-icon {
    font-size: 18px;
}