/* Основные стили поддержки */
#support-bot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1200;
}

/* Группировка сообщений */
.support-message-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 10px;
}

#support-bot-button {
    padding: 10px 16px;
    font-size: 15px;
    border-radius: 25px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

#support-bot-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    background: #0069d9;
}

#support-bot-window {
    width: 380px;
    height: 500px; /* Фиксированная высота */
    display: none;
    position: absolute;
    bottom: calc(100% + 15px);
    right: 0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    background: #fff;
    border: none;
    flex-direction: column;
}

#support-bot-window.active {
    display: flex;
}

/* Стили карточки */
.support-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.support-card-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.support-card-title {
    font-size: 18px;
    margin: 0;
    color: #333;
}

.support-card-tools .support-btn {
    padding: 4px 8px;
    font-size: 14px;
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
}

.support-card-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.support-card-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* Стили сообщений */
.support-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9fafc;
    display: flex;
    flex-direction: column;
}

.support-message {
    max-width: 85%;
    margin-bottom: 2px;
}

.support-message.new-group {
    margin-top: 15px;
}

.support-message.first-in-group {
    margin-top: 5px;
}

/* Сообщения пользователя */
.support-message.user-message {
    align-self: flex-end;
    margin-left: auto;
}

.support-message-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
}

/* Сообщения бота */
.support-message.bot-message {
    align-self: flex-start;
    margin-right: auto;
}

.support-message.bot-message .support-message-content {
    background: #e3f2fd;
    color: #1a3e72;
    border-radius: 0 12px 12px 12px;
}

.support-message.bot-message.first-in-group .support-message-content {
    border-top-left-radius: 4px;
}

.support-message-content {
    padding: 12px 15px;
    border-radius: 12px;
    position: relative;
    margin-top: 5px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

/* Сообщение от бота */
.support-message .support-message-content {
    background: #e3f2fd;
    color: #1a3e72;
    border-top-left-radius: 4px;
}

/* Сообщение от пользователя */
.support-message.user-message .support-message-content {
    background: #007bff;
    color: #fff;
    border-radius: 12px 0 12px 12px;
}

.support-message.user-message.new-group .support-message-content {
    border-top-right-radius: 4px;
}

/* Индикатор набора */
.typing-message {
    align-self: flex-start;
    margin-right: auto;
}

/* Индикатор набора сообщения */
.support-typing-indicator {
    display: inline-flex;
    padding: 10px 15px;
    background: #e3f2fd;
    border-radius: 18px;
    margin-bottom: 15px;
    align-items: center;
}

.support-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #4a89dc;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: supportTypingAnimation 1.4s infinite ease-in-out;
}

@keyframes supportTypingAnimation {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-3px); opacity: 1; }
}

/* Контейнер для поля ввода и кнопки */
.support-input-group {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 25px;
    padding: 5px;
    border: 1px solid #ddd;
    transition: all 0.3s;
}
.support-input-group:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* Иконка в кнопке */
#send-support-message i {
    font-size: 18px;
    margin-left: -1px; /* Небольшая корректировка выравнивания */
}

/* Автоматическое увеличение textarea */
#support-user-message {
    resize: none;
    min-height: 45px;
    max-height: 120px;
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
    background: #f9f9f9;
}

/* Минимизированное состояние */
#support-bot-window.minimized {
    height: 40px !important;
    overflow: hidden;
}

#support-bot-window.minimized .support-card-body,
#support-bot-window.minimized .support-card-footer,
#support-bot-window.minimized .support-contacts-footer {
    display: none;
}

#support-user-message:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
    background: #fff;
}

/* Стилизация кнопки отправки */
#send-support-message {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: none;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-support-message:hover {
    background: #0069d9;
    transform: translateY(-2px);
}

#send-support-message:active {
    transform: translateY(0);
}

.support-input-append {
    margin-left: 10px;
}

.support-quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.support-quick-action {
    border-radius: 15px;
    padding: 4px 12px;
    font-size: 13px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

/* Контакты поддержки */
.support-contacts-footer {
    padding: 12px 15px;
    background: #f8f9fa;
    font-size: 13px;
    border-top: 1px solid #eee;
}

.support-contact-info {
    margin-bottom: 8px;
    color: #555;
}

.support-contact-item {
    margin-bottom: 6px;
    color: #666;
}

.support-contact-item a {
    color: #007bff;
    text-decoration: none;
}

.support-contact-item a:hover {
    text-decoration: underline;
}



/* Адаптивность */
@media (max-width: 576px) {
    #support-bot-container {
        right: 10px;
        bottom: 10px;
    }
    
    #support-bot-window {
        width: calc(100vw - 40px);
        right: 10px;
        bottom: 70px;
    }
}