.network-status-widget {
    position: fixed;
    bottom: 20px; /* Стандартное расстояние от низа */
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    color: #495057;
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    z-index: 99; /* Пониженный z-index, чтобы не перекрывать футер и другие элементы */
    font-size: 12px;
    min-width: 160px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1); /* Единая граница для лучшей видимости на светлом фоне */
    transition: all 0.3s ease; /* Плавные переходы для анимации позиции */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Добавляем легкую анимацию появления */
    opacity: 0.95;
    /* Добавляем легкую анимацию появления при загрузке */
    animation: fadeInUp 0.5s ease-out;
    /* Убираем возможные проблемы с переполнением */
    overflow: hidden;
    max-width: 200px;
    /* Улучшаем взаимодействие с пользователем */
    cursor: default;
    /* Улучшаем стабильность позиционирования */
    will-change: bottom;
    /* Устанавливаем максимальную высоту, чтобы избежать перекрытия футера */
    max-height: 70px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.95;
        transform: translateY(0);
    }
}

.network-status-widget:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    opacity: 1;
    /* Улучшаем визуальный эффект при наведении */
    backdrop-filter: blur(12px);
    /* Улучшаем плавность анимации при наведении */
    transition: all 0.2s ease;
}

.network-status-widget .server-info,
.network-status-widget .ping-info {
    margin: 2px 0;
    display: flex;
    align-items: center;
    font-size: 13px;
    white-space: nowrap;
    min-height: 18px;
    padding: 1px 0;
    width: 100%;
    /* Улучшаем выравнивание элементов */
    justify-content: flex-start;
    /* Улучшаем внутренние отступы */
    gap: 2px;
    /* Улучшаем выравнивание текста */
    text-align: left;
    /* Улучшаем выравнивание по вертикали */
    align-items: center;
}

.network-status-widget .server-name,
.network-status-widget .ping-value,
.network-status-widget .status-text {
    font-weight: 500;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    flex: 1;
    max-width: calc(100% - 2px);
}

.network-status-widget .fa-server {
    color: #6c757d;
    margin-right: 1px;
    flex-shrink: 0;
    vertical-align: middle;
}

.network-status-widget .fa-bolt {
    color: #ffc107;
    margin-right: 1px;
    flex-shrink: 0;
    vertical-align: middle;
}

.network-status-widget .server-info i,
.network-status-widget .ping-info i {
    font-size: 12px;
    flex-shrink: 0;
    vertical-align: middle;
    /* Улучшаем выравнивание иконок */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Улучшаем размер иконок */
    width: 14px;
    height: 14px;
    /* Улучшаем центрирование иконок */
    text-align: center;
    /* Улучшаем выравнивание по базовой линии */
    line-height: 1;
    /* Улучшаем отображение иконок */
    min-width: 14px;
    /* Улучшаем выравнивание содержимого */
    align-self: center;
}

.connection-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 1px;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}

.connected {
    background-color: #198754;
}

.disconnected {
    background-color: #dc3545;
}

/* Убираем строку статуса подключения, так как она больше не используется */
.network-status-widget .connection-status {
    display: none;
}

/* Support Chat FAB (Floating Action Button) */
.support-chat-fab {
    position: fixed;
    bottom: 95px; /* Чуть выше виджета с пингом */
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
    transition: all 0.3s ease;
    z-index: 98;
    padding: 0;
}

.support-chat-fab:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 6px 25px rgba(13, 110, 253, 0.5);
}

.support-chat-fab i {
    font-size: 22px;
}

/* Анимация пульсации для кнопки */
.support-chat-fab::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.4);
    animation: fabPulse 2s infinite;
    z-index: -1;
}

@keyframes fabPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Live Support Widget */
.live-support-widget {
    position: fixed;
    bottom: 165px; /* Выше кнопки */
    right: 20px;
    width: 350px;
    max-height: 450px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.3s ease-out;
}

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

.live-support-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
}

.live-support-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.live-support-header-title i {
    font-size: 16px;
}

.live-support-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-support-status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.live-support-close-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.live-support-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.live-support-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.live-support-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    min-height: 250px;
    max-height: 320px;
}

.live-support-welcome {
    text-align: center;
    padding: 30px 15px;
    color: #6c757d;
}

.live-support-welcome i {
    font-size: 48px;
    color: #0d6efd;
    margin-bottom: 15px;
    display: block;
}

.live-support-welcome p {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 5px 0;
    color: #212529;
}

.live-support-welcome small {
    font-size: 12px;
    color: #6c757d;
}

/* Message bubbles */
.support-message {
    margin-bottom: 12px;
    max-width: 85%;
}

.support-message.user-message {
    margin-left: auto;
}

.support-message.admin-message {
    margin-right: auto;
}

.support-message .message-content {
    padding: 10px 12px;
    border-radius: 12px;
    position: relative;
}

.support-message.user-message .message-content {
    background: transparent;
    color: #212529;
    border-bottom-right-radius: 0;
}

.support-message.admin-message .message-content {
    background: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 4px;
}

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

.support-message.user-message .message-sender {
    text-align: right;
}

.support-message .message-text {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.support-message.user-message .message-text {
    text-align: right;
}

.support-message .message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.support-message.user-message .message-time {
    text-align: left;
}

.live-support-input-area {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.live-support-input-area form {
    display: flex;
    gap: 8px;
}

.live-support-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.live-support-input:focus {
    border-color: #0d6efd;
}

.live-support-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.live-support-send-btn:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.live-support-send-btn i {
    font-size: 14px;
}

/* Scrollbar styling */
.live-support-messages::-webkit-scrollbar {
    width: 6px;
}

.live-support-messages::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 3px;
}

.live-support-messages::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

.live-support-messages::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Loading state */
.support-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 12px;
    background: #e9ecef;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.support-typing-indicator .typing-dot {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.support-typing-indicator .typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.support-typing-indicator .typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Error message */
.support-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
}

/* Session closed message */
.support-session-closed {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 13px;
}