:root {
    --primary-color: #b00000;
    --secondary-color: #d00000;
    --accent-color: #e53935;
    --light-color: #f5f5f5;
    --dark-color: #212121;
    --text-light: #ffffff;
    --text-dark: #333333;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}


.user-info-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-info-form h4 {
    margin: 0 0 15px 0;
    color: #b00000;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
/*    border-color: #b00000;*/
/*    box-shadow: 0 0 0 2px rgba(176, 0, 0, 0.1);*/
}

.submit-btn {
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* Кнопка вызова чата */
.chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
    border: none;
    animation: pulse 2s infinite;
}

/* Класс для отключения анимации */
.chat-toggle.no-pulse {
    animation: none;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(176, 0, 0, 0.5); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(176, 0, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(176, 0, 0, 0); }
}

.chat-toggle:hover {
    transform: scale(1.1);
  /*  box-shadow: 0 6px 16px rgba(176, 0, 0, 0.3);*/
}


.chat-toggle i {
    font-size: 24px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Контейнер чата */
.chat-container {
    position: fixed;
    bottom: 130px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}



.chat-container.active {
    opacity: 1;
    visibility: visible;
}

/* Шапка чата */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-chat {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.close-chat:hover {
    transform: rotate(90deg);
}

/* Тело чата */
.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: var(--light-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--secondary-color);
    gap: 10px;
}

/* Сообщения */

/* Стили для сообщений */
.message {
    max-width: 80%;
    margin-bottom: 15px;
    clear: both;
    position: relative;
    border-radius: var(--border-radius);
    font-size: 14px;
    line-height: 1.4;
}

.message .text {
    padding: 10px 15px;
    border-radius: 18px;
    display: inline-block;
    word-wrap: break-word;
}

.message .time {
    font-size: 11px;
    color: #696969;
    margin-top: 5px;
}

/* Сообщения пользователя (справа) */
.message.user {
    float: right;
    margin-right: 10px;
}

.message.user .text {
    background: #b00000;
    color: white;
    border-top-right-radius: 0;
}

.message.user .time {
    text-align: right;
}

/* Сообщения оператора и системы (слева) */
.message.operator,
.message.system {
    float: left;
    margin-left: 10px;
}

.message.operator .text,
.message.system .text {
    background: #e5e5ea;
    color: black;
    border-top-left-radius: 0;
}

/* Дополнительный стиль для системных сообщений */
.message.system .text {
    background: #f0f0f0;
    font-style: italic;
}


/* Поле ввода */
.chat-input {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    resize: none;
    min-height: 60px;
    font-size: 14px;
    transition: var(--transition);
}

.chat-input textarea:focus {
    outline: none;
    /*border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(176, 0, 0, 0.1);
     */
}

.chat-input button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chat-input button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.chat-input button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Уведомление о новом сообщении */
.new-message-notification {
    position: fixed;
    bottom: 160px;
    right: 30px;
    background: var(--accent-color);
    color: white;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 480px) {
    .chat-container {
        width: 90vw;
        right: 5vw;
        bottom: 140px;
        height: 60vh;
    }

    .chat-toggle {
        bottom: 60px;
        right: 20px;
        width: 50px;
        height: 50px;
        -webkit-tap-highlight-color: transparent;
    }
}

.close-dialog-btn {
    width: 100%;
    background-color: #b00000;
    color: white;
    border: none;
    padding: 8px 16px;
    margin-top: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}
