/* Базові стилі для кнопки запуску чату */
button.launch-button {
    position: fixed;
    z-index: 1000;
    right: 10px;
    bottom: 80px;
    display: flex;
    overflow: hidden;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-image: linear-gradient(45deg, #3b2c4c, #140e19);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Основний контейнер чату */
#chat-container {
    position: fixed;
    z-index: 1000;
    right: 20px;
    bottom: 20px;
    display: none;
    overflow: hidden;
    flex-direction: column;
    width: 350px;
    height: 500px;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 105, 180, 0.2);
    border: 1px solid rgba(255, 105, 180, 0.3);
}

#chat-container input[type="text"] {
    margin: 5px;
    padding: 10px;
    font-size: 14px;
}

#chat-container button:hover {
    opacity: 0.9;
}

#chat-container button.close-button {
    position: relative;
    right: 10px;
    padding: 5px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#chat-container button.close-button:hover {
    transform: rotate(90deg);
    filter: drop-shadow(0 0 3px #ff69b4);
}

/* Область повідомлень */
#messages {
    display: flex;
    overflow-y: auto;
    flex-direction: column;
    flex: 1;
    min-height: 100px;
    padding: 15px;
    background: rgba(26, 26, 26, 0.8);
    color: #fff;
}

#messages ul {
    padding-inline-start: 25px;
    margin-top: 5px;
}

/* Стилі скролбару */
#messages::-webkit-scrollbar {
    width: 6px;
    height: 8px;
    padding-left: 20px;
}

#messages::-webkit-scrollbar-track {
    border-radius: 10px;
    background: rgba(221, 238, 246, 0.2);
}

#messages::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: rgba(28, 128, 162, 0.7);
}

#messages::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Форма введення повідомлення */
.message-input-wrapper {
    display: flex;
    background: rgba(34, 34, 34, 0.8);
    border-top: 1px solid rgba(255, 105, 180, 0.3);
    padding: 10px;
    position: relative;
    flex-shrink: 0;
    height: 60px;
    align-items: center;
}

.message-input {
    flex: 1;
    background: rgba(51, 51, 51, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 105, 180, 0.3);
    border-radius: 20px;
    padding: 12px 15px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    width: calc(100% - 50px); /* Зменшено ширину для створення відступу */
    margin-right: 10px; /* Додано відступ праворуч */
}

.message-input:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.4);
}

/* Кнопки відправлення */
.send-button {
    padding: 10px 20px;
    border: none;
    background-image: linear-gradient(
        94.84deg,
        #2e2050 12.26%,
        #4c3069 37.68%,
        #5a3881 61.1%
    );
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

button.chat-send-button {
    position: relative;
    border: none;
    background: transparent;
    color: #ff69b4;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 5px; /* Додано відступ ліворуч */
}

button.chat-send-button:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px #ff69b4);
}

/* Стилі повідомлень */
.message {
    margin-bottom: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    max-width: 85%;
    animation: messageSlide 0.5s ease forwards;
    position: relative;
    overflow: hidden;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Футуристична підсвітка для повідомлень */
.message::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 105, 180, 0.05),
        transparent
    );
    transform: translateX(-100%);
    animation: messageScan 3s infinite;
}

@keyframes messageScan {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* #chat-container .message.user,
.integrated-chat .message.user {
    align-self: flex-end;
    background-color: rgba(255, 105, 180, 0.3);
    color: #fff;
    border-right: 3px solid #ff69b4;
    margin-left: auto;
} */

/* #chat-container .message.bot,
.integrated-chat .message.bot {
    align-self: flex-start;
    background-color: rgba(240, 230, 247, 0.1);
    color: #f0f0f0;
    border-left: 3px solid #ff69b4;
} */

.message.question {
    max-width: 150px;
    margin-left: auto;
    border-radius: 10px 3px 10px 10px;
    background: #ddeef6;
    font-size: 14px;
    line-height: 20px;
}

.message.answer {
    margin-bottom: 4px;
    border-radius: 3px 10px 10px 10px;
    background-color: #1c80a2;
    color: #ffffff;
    font-size: 14px;
    line-height: 20px;
}

/* Хедер чату */
.chat-avatar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-image: linear-gradient(45deg, #614f75, #140e19);
}

.chat-avatar-wrapper:after {
    content: "";
    position: absolute;
    top: 12px;
    left: 68px;
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #00c9aa;
}

.chat-avatar-wrapper img {
    width: 50px;
    height: auto;
    padding: 10px;
}

h4.chat-status-icon {
    padding-left: 15px;
    color: #00c9aa;
    font-size: 12px;
}

/* Стилі для інтегрованого чату */
/* .integrated-chat {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 25vw;
    min-width: 350px;
    max-height: 80vh;
    height: 0;
    background-color: rgba(20, 14, 25, 0.95);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(255, 105, 180, 0.3);
    border: 1px solid rgba(255, 105, 180, 0.5);
    backdrop-filter: blur(10px);
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
} */

/* .integrated-chat.expanded {
    height: 80vh;
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
} */

/* Футуристична анімація появи чату */
/* .integrated-chat::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #ff69b4, #ff1493);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.5s ease-out;
}

.integrated-chat.expanded::before {
    transform: scaleX(1);
}

/* Стиль для хедера чату з градієнтом */
/* .chat-top-bar {
    background-image: linear-gradient(45deg, #614f75, #140e19);
    border-bottom: 1px solid rgba(255, 105, 180, 0.3);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Контейнер для заголовка чату */
.chat-title-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Контейнер для кнопок керування */
.chat-controls {
    display: flex;
    gap: 12px;
    margin-right: 5px;
    z-index: 10;
}

/* Стилі кнопок керування */
/* .chat-control-btn {
    background: transparent;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.chat-control-btn:hover {
    color: #ff69b4;
    transform: scale(1.1);
}

.chat-control-btn svg {
    width: 16px;
    height: 16px;
} */
*/ */

/* Повноекранний режим */
/* .integrated-chat.fullscreen {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    z-index: 9999;
}

.integrated-chat.fullscreen #messages {
    height: calc(100% - 125px);
} */

/* Анімація кнопки при натисканні */
.ai-button-pressed {
    animation: buttonPress 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes buttonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.92);
    }
    100% {
        transform: scale(1);
    }
}
/* Стилі для контейнера аватара користувача */
.user-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    position: relative;
    overflow: visible !important;
}

.avatar-buttons-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: visible !important;
}

.user-avatar,
.user-avatar-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(255, 105, 180, 0.3);
    z-index: 2;
}

/* User info positioning */
.user-info {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    overflow: visible !important;
}

/* Адаптивні стилі */
@media (max-width: 768px) {
    .integrated-chat {
        width: 90vw;
        right: 5vw;
        left: 5vw;
    }

    .ai-greeting-bubble {
        font-size: 16px;
        bottom: 40px;
    }
}

@media (max-width: 480px) {
    .avatar-buttons-row {
        gap: 5px;
    }


    .ai-greeting-bubble {
        font-size: 14px;
        bottom: 35px;
    }
}
