/* CosmoAir Contact Frontend CSS */
/* Version: 3.54 */
/* Description: Панель мессенджеров прилипает к правому краю экрана, камера всегда сверху, мобильные позиции, скрытие по умолчанию */
/* Last Updated: 2025-10-26 */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

* {
    box-sizing: border-box !important;
}

/* Анимации */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Основные контейнеры */
.ccb-chat-wrapper {
    position: fixed !important;
    z-index: 10000 !important;
}

.ccb-fab-buttons {
    position: fixed !important;
    z-index: 10001 !important;
}

/* Главная кнопка */
#prime.ccb-fab {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: #42a5f5 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    cursor: pointer !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.5s ease !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
    animation: pulse 2s infinite ease-in-out, bounce 3s infinite ease-in-out !important;
}

.ccb-chat_login-active #prime.ccb-fab {
    animation: none !important;
}

#prime.ccb-fab:hover,
#prime.ccb-fab:focus,
#prime.ccb-fab:active {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), 0 0 0 8px rgba(66, 165, 245, 0.3) !important;
    transform: scale(1.1) !important;
}

#prime.ccb-fab.is-active {
    transform: rotate(45deg) !important;
    animation: none !important;
}

#prime.ccb-fab.attention {
    animation: pulse 0.5s 2 !important;
    background: #ff5722 !important;
}

#prime.ccb-fab > i.prime {
    font-family: "Font Awesome 7 Free" !important;
    font-weight: 900 !important;
    font-size: 2.2em !important;
    display: inline-block !important;
    width: 36px !important;
    height: 36px !important;
    text-align: center !important;
    transition: transform 0.3s ease-out !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 36px !important;
}

#prime.ccb-fab > i.prime.fa-whatsapp {
    font-family: "Font Awesome 7 Brands" !important;
    font-weight: 400 !important;
}

#prime.ccb-fab.is-active > i.prime.fa-circle-xmark {
    font-family: "Font Awesome 7 Free" !important;
    font-weight: 900 !important;
    font-size: 2.2em !important;
    transform: rotate(-45deg) !important;
}

/* Tooltip */
#prime.ccb-fab::before {
    content: attr(data-tooltip) !important;
    position: absolute !important;
    top: -30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(0, 0, 0, 0.9) !important;
    color: #fff !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease, top 0.3s ease !important;
    pointer-events: none !important;
    font-family: 'Lato', sans-serif !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3) !important;
}

#prime.ccb-fab:hover::before {
    opacity: 1 !important;
    top: -45px !important;
}

/* Кнопки мессенджеров */
.ccb-contact-fab {
    width: 40px !important;
    height: 40px !important;
    display: none !important;
    background: #42a5f5 !important;
    border-radius: 50% !important;
    text-align: center !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.ccb-fab-buttons-container.is-visible .ccb-contact-fab {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.ccb-contact-fab:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25) !important;
}

.ccb-contact-fab > i.fa {
    font-family: "Font Awesome 7 Free" !important;
    font-weight: 900 !important;
    font-size: 1.5em !important;
    line-height: 40px !important;
    color: #ffffff !important;
}

.ccb-contact-fab.whatsapp-link > i.fa.fa-whatsapp,
.ccb-contact-fab.telegram-link > i.fa.fa-telegram {
    font-family: "Font Awesome 7 Brands" !important;
    font-weight: 400 !important;
    font-size: 1.5em !important;
    line-height: 40px !important;
    color: #ffffff !important;
}

.ccb-contact-fab.phone-link > i.fa.fa-phone,
.ccb-contact-fab.email-link > i.fa.fa-envelope {
    font-family: "Font Awesome 7 Free" !important;
    font-weight: 900 !important;
    font-size: 1.5em !important;
    line-height: 40px !important;
    color: #ffffff !important;
}

/* Панель мессенджеров — ПРИЛИПАЕТ К ПРАВОМУ КРАЮ ЭКРАНА */
.chat-wrapper.ccb-chat-wrapper .fab-buttons-container.ccb-fab-buttons-container {
    position: fixed !important;
    display: none !important;
    flex-direction: column !important;
    gap: 10px !important;
    z-index: 10002 !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.chat-wrapper.ccb-chat-wrapper .fab-buttons-container.ccb-fab-buttons-container.is-visible {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: fadeIn 0.3s ease forwards !important;
    right: 20px !important; /* Прилипает к правому краю экрана */
    left: auto !important;
}

.chat-wrapper.ccb-chat-wrapper .fab-buttons-container.ccb-fab-buttons-container .ccb-contact-fab {
    display: none !important;
    position: relative !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.chat-wrapper.ccb-chat-wrapper .fab-buttons-container.ccb-fab-buttons-container.is-visible .ccb-contact-fab {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Чат */
.ccb-chat-container {
    background-color: rgba(0, 0, 0, 0.85) !important;
    border-radius: 20px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden !important;
    padding: 20px !important;
    position: fixed !important;
    width: 340px !important;
    max-width: 100% !important;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: 10000 !important;
    font-family: 'Lato', sans-serif !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

.ccb-chat-container.is-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    animation: fadeIn 0.3s ease forwards !important;
}

/* Скрытие экранов */
.ccb-chat-container .chat-login,
.ccb-chat-container .call-back-form,
.ccb-chat-container .call-back-success,
.ccb-chat-container #chatMessages,
.ccb-chat-container .text_input,
.ccb-chat-container #fab_camera {
    display: none !important;
}

.ccb-chat-container.is-visible .chat-login.visible,
.ccb-chat-container.is-visible .call-back-form.visible,
.ccb-chat-container.is-visible .call-back-success.visible,
.ccb-chat-container.is-visible #chatMessages.visible,
.ccb-chat-container.is-visible .text_input.visible,
.ccb-chat-container.is-visible #fab_camera.visible {
    display: block !important;
}

/* Сообщения */
#chatMessages {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 0 60px 0 !important;
    max-height: 350px !important;
    overflow-y: auto !important;
    background: transparent !important;
}

.message {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-radius: 20px !important;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    margin-bottom: 20px !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    max-width: 80% !important;
}

.message.client {
    padding: 12px 18px 12px 60px !important;
    align-self: flex-end !important;
    background-color: #e3f2fd !important;
}

.message.manager {
    padding: 12px 60px 12px 18px !important;
    align-self: flex-start !important;
    background-color: #ffffff !important;
}

.logo {
    border-radius: 50% !important;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2) !important;
    object-fit: cover !important;
    position: absolute !important;
    left: 8px !important;
    top: -8px !important;
    width: 40px !important;
    height: 40px !important;
}

.message.manager .logo {
    left: auto !important;
    right: 8px !important;
}

.message p {
    margin: 0 !important;
    color: #333 !important;
}

.message img {
    max-width: 100% !important;
    border-radius: 10px !important;
}

/* Поле ввода */
.text_input {
    font-size: 16px !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 10px 15px !important;
    width: 100% !important;
    background: transparent !important;
    align-items: center !important;
    gap: 10px !important;
}

.ccb-chat-container.is-visible .text_input.visible {
    display: flex !important;
}

.ccb-chat-wrapper .ccb-chat-container.is-visible textarea#chatSend {
    width: calc(100% - 50px) !important;
    height: 40px !important;
    max-height: 40px !important;
    min-height: 40px !important;
    padding: 8px 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15) !important;
    resize: none !important;
    font-family: 'Lato', sans-serif !important;
    transition: border-color 0.3s ease !important;
}

.ccb-chat-wrapper .ccb-chat-container.is-visible textarea#chatSend:focus {
    border-color: #42a5f5 !important;
    outline: none !important;
}

.ccb-chat-wrapper .ccb-chat-container.is-visible textarea#chatSend::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

.ccb-chat-wrapper .ccb-chat-container.is-visible button#send_message {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: #42a5f5 !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.3s ease, transform 0.3s ease !important;
}

.ccb-chat-wrapper .ccb-chat-container.is-visible button#send_message:hover,
.ccb-chat-wrapper .ccb-chat-container.is-visible button#send_message:focus {
    background: #2196f3 !important;
    transform: scale(1.05) !important;
}

.ccb-chat-wrapper .ccb-chat-container.is-visible button#send_message i {
    font-family: "Font Awesome 7 Free" !important;
    font-weight: 900 !important;
    font-size: 1.2em !important;
}

/* Форма логина */
.ccb-chat-login {
    padding: 20px !important;
    text-align: center !important;
    color: #fff !important;
    font-family: 'Lato', sans-serif !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.ccb-chat-login label {
    display: block !important;
    margin-bottom: 5px !important;
    font-size: 14px !important;
    color: #fff !important;
    text-align: left !important;
    width: 100% !important;
}

.ccb-chat-login input {
    width: 100% !important;
    padding: 10px !important;
    margin: 0 0 10px 0 !important;
    border: none !important;
    border-radius: 8px !important;
    color: #333 !important;
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: box-shadow 0.3s ease !important;
    display: block !important;
    box-sizing: border-box !important;
}

.ccb-chat-login input:focus {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    outline: none !important;
}

.ccb-chat-login input.neutral-input {
    width: 100% !important;
    padding: 10px !important;
    margin: 0 0 10px 0 !important;
    border: none !important;
    border-radius: 8px !important;
    color: #333 !important;
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    box-sizing: border-box !important;
}

.ccb-chat-login input.error {
    border: 2px solid #dc3545 !important;
}

.ccb-chat-login .error-message {
    color: #dc3545 !important;
    font-size: 12px !important;
    margin-top: -8px !important;
    margin-bottom: 8px !important;
    text-align: left !important;
    width: 100% !important;
}

.ccb-chat-login input::placeholder {
    color: #888 !important;
}

.ccb-chat-login button {
    background: #42a5f5 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    margin-top: 10px !important;
    transition: background 0.3s ease, transform 0.3s ease !important;
}

.ccb-chat-login button:hover {
    background: #2196f3 !important;
    transform: translateY(-2px) !important;
}

/* Форма обратного звонка */
.ccb-call-back-form,
.call-back-success {
    color: #fff !important;
    padding: 20px !important;
    text-align: center !important;
    font-family: 'Lato', sans-serif !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.ccb-call-back-form label {
    display: block !important;
    margin-bottom: 5px !important;
    text-align: left !important;
    width: 100% !important;
}

.ccb-call-back-form label font[color="#E0FFFF"] {
    color: #E0FFFF !important;
}

.ccb-call-back-form input {
    width: 100% !important;
    padding: 10px !important;
    margin: 0 0 10px 0 !important;
    border: none !important;
    border-radius: 8px !important;
    color: #333 !important;
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    display: block !important;
    box-sizing: border-box !important;
}

.ccb-call-back-form input.neutral-input {
    width: 100% !important;
    padding: 10px !important;
    margin: 0 0 10px 0 !important;
    border: none !important;
    border-radius: 8px !important;
    color: #333 !important;
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    box-sizing: border-box !important;
}

.ccb-call-back-form input.error {
    border: 2px solid #dc3545 !important;
}

.ccb-call-back-form .error-message {
    color: #dc3545 !important;
    font-size: 12px !important;
    margin-top: -8px !important;
    margin-bottom: 8px !important;
    text-align: left !important;
    width: 100% !important;
}

.ccb-call-back-form button {
    background: #42a5f5 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    margin-top: 10px !important;
    transition: background 0.3s ease, transform 0.3s ease !important;
}

.ccb-call-back-form button:hover {
    background: #2196f3 !important;
    transform: translateY(-2px) !important;
}

.call-back-success {
    color: #fff !important;
    padding: 20px !important;
    text-align: center !important;
    font-family: 'Lato', sans-serif !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.call-back-success h3 {
    color: #fff !important;
    margin: 0 !important;
}

.call-back-success p {
    color: #ccc !important;
    margin: 0 !important;
}

.call-back-success button#close_call_success {
    background: #42a5f5 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    margin-top: 10px !important;
    transition: background 0.3s ease, transform 0.3s ease !important;
}

.call-back-success button#close_call_success:hover {
    background: #2196f3 !important;
    transform: translateY(-2px) !important;
}

/* Кнопка камеры — ВСЕГДА ПОВЕРХ */
#fab_camera {
    position: absolute !important;
    bottom: 60px !important;
    right: 20px !important;
    background: #42a5f5 !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.3s ease, transform 0.3s ease !important;
    z-index: 10005 !important;
}

#fab_camera:hover {
    background: #2196f3 !important;
    transform: scale(1.05) !important;
}

#fab_camera i {
    font-family: "Font Awesome 7 Free" !important;
    font-weight: 900 !important;
    font-size: 1.5em !important;
    color: #ffffff !important;
}

/* МОБИЛЬНЫЕ СТИЛИ */
@media (max-width: 768px) {
    .ccb-chat-wrapper {
        right: 10px !important;
        bottom: 10px !important;
        left: auto !important;
    }

    .ccb-fab-buttons-container.is-visible {
        right: 20px !important;
        bottom: 80px !important;
        left: auto !important;
    }

    .ccb-chat-container.is-visible {
        left: 80px !important;
        bottom: 80px !important;
        right: auto !important;
        width: calc(100% - 100px) !important;
        max-width: 300px !important;
    }

    #prime.ccb-fab {
        width: 50px !important;
        height: 50px !important;
    }

    #prime.ccb-fab > i.prime {
        font-size: 1.8em !important;
        width: 30px !important;
        height: 30px !important;
        line-height: 30px !important;
    }

    #prime.ccb-fab.is-active > i.prime.fa-circle-xmark {
        font-size: 1.8em !important;
    }

    #prime.ccb-fab::before {
        font-size: 12px !important;
        top: -25px !important;
        padding: 5px 10px !important;
    }

    #prime.ccb-fab:hover::before {
        top: -35px !important;
    }

    #fab_camera {
        z-index: 10005 !important;
    }
}