/* Lazaret Chat Widget Styles */

#lazaret-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Поднимаем чат над мобильным меню (высота меню ~60px + 24px отступ) */
@media screen and (max-width: 1024px) {
    #lazaret-chat-widget {
        bottom: 84px;
    }
}

/* Кнопка открытия чата */
#lazaret-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0092DB 0%, #0078B5 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 146, 219, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

#lazaret-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 146, 219, 0.5);
}

#lazaret-chat-toggle svg {
    width: 28px;
    height: 28px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Окно чата */
#lazaret-chat-box {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#lazaret-chat-box.lazaret-chat-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Заголовок чата */
.lazaret-chat-header {
    background: linear-gradient(135deg, #0092DB 0%, #0078B5 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lazaret-chat-header span {
    font-size: 16px;
    font-weight: 600;
}

#lazaret-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

#lazaret-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Тело чата */
.lazaret-chat-body {
    padding: 20px;
}

.lazaret-chat-intro {
    margin-bottom: 20px;
}

.lazaret-chat-intro p {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Форма */
#lazaret-chat-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lazaret-chat-field input,
.lazaret-chat-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.lazaret-chat-field input:focus,
.lazaret-chat-field textarea:focus {
    outline: none;
    border-color: #0092DB;
    box-shadow: 0 0 0 3px rgba(0, 146, 219, 0.1);
}

.lazaret-chat-field textarea {
    resize: vertical;
    min-height: 80px;
}

.lazaret-chat-field input::placeholder,
.lazaret-chat-field textarea::placeholder {
    color: #999;
}

/* Кнопка отправки */
.lazaret-chat-submit {
    background: linear-gradient(135deg, #0092DB 0%, #0078B5 100%);
    color: white !important;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lazaret-chat-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 146, 219, 0.3);
}

.lazaret-chat-submit:active {
    transform: translateY(0);
}

.lazaret-chat-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Экран успеха */
#lazaret-chat-success {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #e8f5e9;
    color: #0092DB;
    border-radius: 50%;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

#lazaret-chat-success p {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 20px;
}

#lazaret-chat-new {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #333;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#lazaret-chat-new:hover {
    background: #eeeeee;
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    #lazaret-chat-widget {
        bottom: 84px;
        right: 15px;
    }

    #lazaret-chat-toggle {
        width: 55px;
        height: 55px;
    }

    #lazaret-chat-box {
        width: calc(100vw - 30px);
        bottom: 65px;
        right: -15px;
    }

    .lazaret-chat-header {
        padding: 15px;
    }

    .lazaret-chat-body {
        padding: 15px;
    }
}

/* Анимация загрузки */
@keyframes lazaret-spin {
    to {
        transform: rotate(360deg);
    }
}

.lazaret-chat-submit.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    margin-left: 8px;
    animation: lazaret-spin 0.8s linear infinite;
    vertical-align: middle;
}
