/* chat-widget.css */

:root {
    --chat-width: 360px;
    --chat-height: 485px;
    --primary-color: #e60000;
    --bot-message-bg: #f5f5f5;
    --user-message-bg: #e8e8e8;
    --border-radius: 12px;
    --font-system: system-ui, -apple-system, sans-serif;
}

#chat-widget-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease;
    z-index: 1000;
    font-size: 20px;
}

#chat-widget-button:hover {
    background-color: var(--primary-color);
    opacity: 0.9;
}

#chat-widget-button.active {
    transform: scale(0.95);
}

#chat-widget-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: var(--chat-width);
    height: var(--chat-height);
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    font-family: var(--font-system);
    transition: width 0.3s ease, height 0.3s ease;
}

#chat-widget-window.active {
    display: flex;
}

#chat-widget-header {
    background-color: var(--primary-color);
    color: white;
    padding: 16px;
    text-align: left;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chat-widget-header-left {
    display: flex;
    align-items: center;
}

#chat-widget-header-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-widget-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

#chat-widget-header-text {
    flex-grow: 1;
}

#chat-widget-header-name {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 4px;
}

#chat-widget-header-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

#chat-widget-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    position: absolute;
    right: 10px;
    top: 10px;
}

#chat-widget-close-button:hover {
    opacity: 1;
}


#chat-widget-messages {
    padding: 12px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    border-radius: 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

#chat-widget-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-widget-messages::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.chat-message {
    background-color: var(--bot-message-bg);
    border-radius: var(--border-radius) var(--border-radius) var(--border-radius) 0;
    padding: 12px 16px;
    margin-bottom: 12px;
    word-wrap: break-word;
    max-width: 85%;
    position: relative;
    border: 1px solid #e0e0e0;
}

.chat-message.bot {
    background-color: var(--bot-message-bg);
    align-self: flex-start;
    border-color: #e0e0e0;
}

.chat-message.user {
    background-color: var(--user-message-bg);
    align-self: flex-end;
    border-radius: var(--border-radius) var(--border-radius) 0 var(--border-radius);
    border-color: #e0e0e0;
}

.message-time {
    position: absolute;
    bottom: -5px;
    right: 10px;
    font-size: 11px;
    color: #777;
    opacity: 0.8;
    display: none; /* Скрываем время */
}


#chat-widget-input-area {
    padding: 10px 12px;
    border-top: 1px solid #dee2e6;
    display: flex;
    background-color: #f8f9fa;
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

#chat-widget-input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    margin-right: 10px;
    font-size: 14px;
}

#chat-widget-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(230, 0, 0, 0.25);
}


#chat-widget-send-button,
#chat-widget-send-button:focus,
#chat-widget-send-button:active,
#chat-widget-send-button:hover,
#chat-widget-send-button:visited,
#chat-widget-send-button i,
#chat-widget-send-button::before,
#chat-widget-send-button::after {
    background-color: transparent !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    -ms-box-shadow: none !important;
    -o-box-shadow: none !important;
    text-shadow: none !important;
    -webkit-text-shadow: none !important;
    -moz-text-shadow: none !important;
	color: #e60000 !important;
    border: none !important;
    border: 0 !important;
    outline: none !important;
    outline: 0 !important;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: none !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    font-size: 1.2rem;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
    line-height: normal !important;
    font-weight: normal !important;
    filter: none !important;
    -webkit-filter: none !important;
}




#contact-form-area {
    display: none;
    padding: 12px;
    border-top: 1px solid #dee2e6;
    background-color: #fff;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

#contact-form-area.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.privacy-policy-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.privacy-policy-group input[type="checkbox"] {
    margin-right: 10px;
}

.privacy-policy-label {
    font-size: 12px;
    color: #777;
}

.privacy-policy-label a {
    color: #0073aa;
    text-decoration: none;
}



.privacy-policy-label a:hover {
    text-decoration: underline;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea {
    width: calc(100% - 20px);
    padding: 12px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(230, 0, 0, 0.25);
}

#contact-submit-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
    font-weight: bold;
    display: block;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    height: 40px;
}

#contact-submit-button:hover {
    background-color: var(--primary-color);
    opacity: 0.9;
}

#chat-widget-venyoo-label {
    text-align: center;
    padding: 8px 10px;
    font-size: 0.8rem;
    color: white;
    background-color: var(--primary-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

#chat-loading-animation {
    display: none; /* Скрыто по умолчанию */
    flex-direction: column;
    align-items: center;
    padding: 15px;
}

.loading-dots {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #bbb; /* Серый цвет точек */
    margin: 0 5px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.24s;
}

.loading-dot:nth-child(3) {
    animation-delay: -0.12s;
}

#loading-text {
    font-size: 0.9rem;
    color: #777;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
}


/* --- Адаптация для мобильных устройств (Media Query) --- */
@media (max-width: 400px) {
    #chat-widget-window {
        width: calc(100% - 40px);
        height: calc(100% - 40px);
        bottom: 20px;
        right: 20px;
        left: 20px;
        border-radius: var(--border-radius);
    }
}

@media (max-width: 768px) { /* Media query для экранов меньше 768px (обычно планшеты и смартфоны) */
    #chat-widget-button {
        bottom: 15px; /* Немного выше на мобильных */
        right: 15px;
    }

    /* --- Стили для полноэкранного режима на смартфонах --- */
    body #chat-widget-container #chat-widget-window.active { /* Увеличена специфичность */
        position: fixed; /* Фиксированное позиционирование на весь экран */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%; /* Ширина на весь экран */
        height: 100%; /* Высота на весь экран */
        max-height: 100%; /* Убираем ограничение максимальной высоты */
        border-radius: 0; /* Убираем скругление углов */
        box-shadow: none; /* Убираем тень */
        border-left-width: 0; /* Убираем боковые красные полосы */
        border-right-width: 0;
    }

    #chat-widget-header {
        border-radius: 0; /* Шапка на всю ширину, без скруглений */
        border-bottom: 1px solid var(--primary-color); /* Добавляем разделитель снизу шапки */
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    #chat-widget-messages {
        border-radius: 0; /* Сообщения на всю ширину, без скруглений */
    }

    #chat-widget-input-area {
        border-radius: 0; /* Область ввода на всю ширину, без скруглений */
        border-bottom: none; /* Убираем нижнюю границу области ввода */
    }

    #contact-form-area {
        border-radius: 0; /* Форма на всю ширину, без скруглений */
    }

    #chat-widget-venyoo-label {
        border-radius: 0; /* Подпись Venyoo на всю ширину, без скруглений */
        border-top: 1px solid #eee; /* Возвращаем разделительную линию подписи */
    }
}