/* WhatsApp Style Chat Widget */
#konnection-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: "Roboto", sans-serif;
}
.file-upload-container {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.upload-button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #075e54;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 8px;
}

.upload-preview {
    display: flex;
    gap: 5px;
    margin-right: 8px;
}

.preview-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.preview-item img {
    object-fit: cover;
}

.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.message-images img {
    border-radius: 8px;
    object-fit: cover;
}
/* Chat Button */
.konnection-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #075e54;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
    position: relative;
}

/* Icona chat e chiusura */
.chat-icon {
    display: block;
    font-size: 26px;
    transition: opacity 0.3s ease-in-out;
}

.close-icon {
    display: none;
    font-size: 26px;
    transition: opacity 0.3s ease-in-out;
}

/* Effetto di cambio icona quando la chat è aperta */
.konnection-chat-open .chat-icon {
    display: none;
}

.konnection-chat-open .close-icon {
    display: block;
}

/* Chat Container */
#konnection-chat-container {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #efe7dd;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

/* Quando la chat è aperta */
.konnection-chat-open #konnection-chat-container {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

/* Chat Header */
.chat-header {
    padding: 15px;
    background: #075e54;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}
.chat-header h3{
    color: white;
}
/* Chat Messages */
#konnection-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background: #efe7dd;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

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

#konnection-chat-messages::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 3px;
}

/* Input Area */
.chat-input-container {
    padding: 12px;
    border-top: 1px solid #ddd;
    background: #ffffff;
    display: flex;
    align-items: center;
}

#konnection-chat-input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    background: #f2f2f2;
    font-size: 14px;
    outline: none;
}

/* Pulsante di invio */
#konnection-chat-send {
    width: 45px;
    height: 45px;
    background: #075e54;
    color: white;
    border: none;
    border-radius: 50%;
    margin-left: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#konnection-chat-send:hover {
    background: #075e54;
}

/* Message Bubbles */
.message {
    padding: 10px 14px;
    border-radius: 15px;
    max-width: 75%;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    display: inline-block;
    position: relative;
    margin-bottom: 6px;
}

/* User Messages */
.user-message {
    background: #dcf8c6;
    color: black;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.user-message:after {
    content: "";
    position: absolute;
    right: -5px;
    top: 10px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent transparent #dcf8c6;
}

/* Bot Messages */
.bot-message {
    background: white;
    color: black;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.bot-message:after {
    content: "";
    position: absolute;
    left: -5px;
    top: 10px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
}

/* Mobile Responsive */
@media (max-width: 400px) {
    #konnection-chat-container {
        width: 100%;
        right: 0;
        left: 0;
        bottom: 0;
        height: 100%;
        border-radius: 0;
    }

    .konnection-chat-button {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
}
