/* === Чат с поддержкой (адаптивный под тему) === */
.support-chat {

    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 400px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: var(--bg);
    display: none;
    flex-direction: column;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.support-chat.open {
    display: flex;
}

.support-chat.minimized {
    height: 60px;
    overflow: hidden;
}

/* Переменные темы */
.support-chat,
.support-chat .support-chat-header,
.support-chat .support-chat-body,
.support-chat .support-chat-footer {
    --bg: #ffffff;           /* Светлый фон */
    --text: #333333;         /* Тёмный текст */
    --border: #dddddd;       /* Светлая граница */
    --user-bg: #007bff;      /* Цвет пользователя */
    --bot-bg: #e9ecef;       /* Цвет бота */
    --input-bg: #ffffff;     /* Фон инпута */
    --input-border: #ddd;
}

/* Тёмная тема */
.dark-theme .support-chat,
.dark-theme .support-chat .support-chat-header,
.dark-theme .support-chat .support-chat-body,
.dark-theme .support-chat .support-chat-footer {
    --bg: #1e1e1e;           /* Тёмный фон */
    --text: #f0f0f0;         /* Светлый текст */
    --border: #444444;       /* Тёмная граница */
    --user-bg: #0a5bcf;      /* Менее яркий синий */
    --bot-bg: #3a3a3a;       /* Тёмный фон бота */
    --input-bg: #2d2d2d;     /* Тёмный инпут */
    --input-border: #555;
}

/* Шапка */
.support-chat-header {
    background: var(--user-bg);
    color: white;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    line-height: 1;
    padding: 0;
}

.support-chat-header button:hover {
    opacity: 0.8;
}

/* Тело */
.support-chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    color: var(--text);
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.bot {
    align-self: flex-start;
    background: var(--bot-bg);
    color: var(--text);
}

.message.user {
    align-self: flex-end;
    background: var(--user-bg);
    color: white;
}

/* Футер */
.support-chat-footer {
    display: flex;
    padding: 10px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

#support-chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text);
    transition: border 0.2s ease;
}

#support-chat-input:focus {
    border-color: var(--user-bg);
}

#support-chat-send {
    width: 40px;
    height: 40px;
    margin-left: 8px;
    background: var(--user-bg);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

#support-chat-send:hover {
    background: #0056b3;
}

/* Для тёмной темы — чуть мягче */
.dark-theme #support-chat-send:hover {
    background: #0a4a9c;
}