/* ========================================
   EEA Messenger - Віджет месенджерів та розумного чату
   ======================================== */

/* CSS змінні для кольорової схеми (значення за замовчуванням) */
.eea-messenger-widget {
    --eea-color-primary: #667eea;
    --eea-color-secondary: #764ba2;
    --eea-color-user-bubble: #667eea;
    --eea-color-bot-bubble: #f0f0f0;
    --eea-color-button: #667eea;
}

/* Критичні стилі для позиціонування чату - максимальна специфічність */
body .eea-chat-window,
html body .eea-chat-window,
div.eea-chat-window {
    position: fixed !important;
    bottom: 110px !important;
    right: 35px !important;
    display: flex !important;
    z-index: 9998 !important;
}

/* Основний контейнер віджета */
.eea-messenger-widget {
    position: fixed !important;
    right: 35px !important;
    bottom: 35px !important;
    z-index: 9999 !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    transform: none !important;
}

.eea-messenger {
    width: 60px;
    height: 60px;
    position: relative;
}

/* Головна кнопка віджета */
.eea-messenger-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--eea-color-primary, #667eea) 0%, var(--eea-color-secondary, #764ba2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: eea-pulse 2s infinite;
    position: relative;
    z-index: 2;
}

.eea-messenger-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.eea-messenger-btn img {
    border-radius: 50%;
}

/* Пульсуюче коло */
.eea-circle-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    animation: eea-pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    z-index: 1;
}

@keyframes eea-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes eea-pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}


/* ========================================
   Chat Menu Items - Unified Style
   ======================================== */

.eea-chat-screen {
    padding: 15px;
}

/* FAQ Container - ідентичний до welcome блоку */
.eea-faq-container {
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 12px;
}

.eea-faq-question-item {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    line-height: 1.4;
    position: relative;
}

.eea-faq-question-item:hover {
    transform: translateX(5px);
    transition: all 0.3s ease;
}

.eea-faq-question-item:first-child {
    margin-top: 0;
}

.eea-faq-question-item:last-child {
    margin-bottom: 0;
}

/* Action buttons section */
.eea-chat-menu-section {
    margin-bottom: 20px;
}

.eea-menu-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding: 0 5px;
    letter-spacing: 0.5px;
}

.eea-chat-menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 15px;
    margin: 6px 0;
    background: #f9f9f9;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    border: 2px solid transparent;
}

.eea-chat-menu-item > span:first-child {
    flex: 0 0 10%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.eea-chat-menu-item > span:last-child {
    flex: 0 0 90%;
    text-align: right;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding-right: 5px;
}

.eea-chat-menu-item:hover {
    background: #f0f0f0;
    border-color: var(--eea-color-button, #667eea);
    transform: translateX(-3px);
    text-decoration: none;
    color: #333;
}

/* Вигляд 2: тільки іконки */
.eea-messenger-icon-only:hover {
    transform: scale(1.15);
}

.eea-messenger-icon-only {
    position: relative;
}

.eea-chat-menu-item.eea-primary {
    background: linear-gradient(135deg, var(--eea-color-primary, #667eea) 0%, var(--eea-color-secondary, #764ba2) 100%);
    color: #ffffff;
}

.eea-chat-menu-item.eea-primary:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Виключаємо підкреслення та глобальні стилі для посилань */
a.eea-chat-menu-item.eea-primary {
    text-decoration: none !important;
    color: #ffffff !important;
}

a.eea-chat-menu-item.eea-primary:hover {
    text-decoration: none !important;
    color: #ffffff !important;
}

a.eea-chat-menu-item.eea-primary:focus {
    text-decoration: none !important;
    color: #ffffff !important;
    outline: none !important;
}

a.eea-chat-menu-item.eea-primary span {
    text-decoration: none !important;
    color: #ffffff !important;
}

a.eea-chat-menu-item.eea-primary:hover span {
    color: #ffffff !important;
}

.eea-chat-menu-item.eea-secondary {
    background: #ffffff;
    border-color: var(--eea-color-button, #667eea);
    color: var(--eea-color-button, #667eea);
    font-weight: 600;
}

.eea-chat-menu-item.eea-secondary:hover {
    background: var(--eea-color-button, #667eea);
    color: #ffffff;
    border-color: var(--eea-color-button, #667eea);
}

.eea-chat-menu-item svg,
.eea-chat-menu-item img {
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.eea-chat-menu-item span {
    flex: 1;
    line-height: 1.4;
}



/* ========================================
   Вікно розумного чату
   ======================================== */

.eea-chat-window {
    position: fixed !important;
    bottom: 110px !important;
    right: 35px !important;
    width: 380px !important;
    height: 500px !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: scale(0.8) translateY(20px) !important;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    z-index: 9998 !important;
    overflow: hidden !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
}

.eea-chat-window.eea-chat-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) translateY(0) !important;
}

/* Заголовок чату */
.eea-chat-header {
    background: linear-gradient(135deg, var(--eea-color-primary, #667eea) 0%, var(--eea-color-secondary, #764ba2) 100%);
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
    gap: 10px;
}

.eea-chat-back {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.eea-chat-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

.eea-chat-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eea-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.eea-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Тіло чату */
.eea-chat-body {
    flex: 1;
    overflow-y: auto;
    background: #f9f9f9;
}

.eea-chat-body::-webkit-scrollbar {
    width: 6px;
}

.eea-chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.eea-chat-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.eea-chat-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Привітальне повідомлення */
.eea-chat-welcome {
    background: #ffffff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 15px;
    text-align: center;
}

.eea-chat-welcome p {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Bot Avatar */
.eea-bot-avatar {
    font-size: 48px;
    text-align: center;
    margin-bottom: 10px;
}

.eea-bot-avatar svg {
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto;
}

.eea-bot-avatar-small {
    font-size: 24px;
    margin-right: 8px;
    flex-shrink: 0;
}

.eea-bot-avatar-small svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Запобігання миганню іконок */
.eea-bot-avatar,
.eea-bot-avatar-small {
    opacity: 1;
    transition: none;
}

/* Повідомлення в чаті */
.eea-chat-message {
    margin: 10px 0;
    animation: eea-message-appear 0.3s ease;
}

@keyframes eea-message-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.eea-chat-message-user {
    display: flex;
    justify-content: flex-end;
}

.eea-chat-message-user .eea-message-text {
    background: var(--eea-color-user-bubble, #667eea);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    max-width: 75%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.eea-chat-message-bot {
    display: flex;
    align-items: flex-start;
}

.eea-chat-message-bot .eea-message-text {
    background: var(--eea-color-bot-bubble, #f0f0f0);
    color: #333;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    max-width: 75%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

/* Індикатор набору тексту */
.eea-chat-typing {
    display: flex !important;
    align-items: center !important;
    margin: 10px 0 !important;
}

.eea-typing-dots {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    padding: 12px 16px !important;
    background: #f0f0f0 !important;
    border-radius: 18px !important;
    align-items: center !important;
}

.eea-typing-dots span {
    width: 8px !important;
    height: 8px !important;
    background: #999 !important;
    border-radius: 50% !important;
    display: inline-block !important;
    animation: eea-typing-bounce 1.4s infinite ease-in-out !important;
}

.eea-typing-dots span:nth-child(2) {
    animation-delay: 0.2s !important;
}

.eea-typing-dots span:nth-child(3) {
    animation-delay: 0.4s !important;
}

@keyframes eea-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Футер чату (поле вводу) */
.eea-chat-footer {
    padding: 15px 20px;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 10px;
    align-items: center;
}

.eea-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.eea-chat-input:focus {
    border-color: var(--eea-color-button, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.eea-chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--eea-color-primary, #667eea) 0%, var(--eea-color-secondary, #764ba2) 100%);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.eea-chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--eea-color-primary-shadow, rgba(102, 126, 234, 0.4));
}

.eea-chat-send-btn:active {
    transform: scale(0.95);
}

/* ========================================
   Стрілочка для скролу вниз
   ======================================== */

.eea-scroll-down-arrow {
    position: absolute;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--eea-color-scroll-arrow, #667eea);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.eea-scroll-down-arrow.visible {
    opacity: 1;
    visibility: visible;
}

.eea-scroll-down-arrow:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.eea-scroll-down-arrow svg,
.eea-scroll-down-arrow div svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    animation: bounce-arrow 1.5s infinite;
}

.eea-scroll-down-arrow > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

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

/* ========================================
   Адаптивність
   ======================================== */

@media (max-width: 768px) {
    .eea-messenger-widget {
        right: 20px;
        bottom: 20px;
    }
    
    .eea-chat-window {
        right: 20px !important;
        bottom: 95px !important;
        width: calc(100vw - 40px) !important;
        max-width: 380px !important;
        height: 550px !important;
    }
    
    .eea-messenger-menu {
        right: 0;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .eea-chat-window {
        width: calc(100vw - 30px) !important;
        height: 500px !important;
        right: 15px !important;
        bottom: 95px !important;
        max-width: 350px !important;
    }
    
    .eea-messenger-btn {
        width: 50px;
        height: 50px;
    }
    
    .eea-circle-pulse {
        width: 50px;
        height: 50px;
    }
    
    .eea-messenger-btn img {
        width: 28px !important;
        height: 28px !important;
    }
}

/* Видаляємо спеціальні позиції для сторінки товару - використовуємо єдину позицію */


