﻿/*.chat-popup-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}*/
.chat-popup-container {
    border: 1px solid red; /* Solo per debug */
    position: fixed;
    bottom: 200px;
    right: 20px;
    z-index: 1050;
}
/* Stile per il contenitore del contatto e del pulsante */
.chat-contact-container {
    position: fixed;
    bottom: 60px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 1000;
    background-color: transparent;
}

.client-name {
    background-color: white;
    color: black;
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

/* Stile base per il pulsante di toggle */
.chat-toggle-button {
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 20px;
}

/* Stile per WhatsApp (verde) */
.whatsapp .chat-toggle-button {
    background-color: #25D366; /* Verde WhatsApp */
    color: white;
}

/* Stile per Email (nero) */
.email .chat-toggle-button {
    background-color: #000000; /* Nero */
    color: white;
}

/* Stile per SMS (blu) */
.sms .chat-toggle-button {
    background-color: #0078D4; /* Blu */
    color: white;
}


/* Stile base per il popup */
.chat-popup {
    position: fixed;
    bottom: 130px;
    right: 20px;
    width: 60vw; /* 50% della larghezza della finestra */
    /*max-width: 500px;*/ /* Larghezza massima */
    height: 0;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    display: none;
    background-color: white;
    z-index: 1000;
}

    .chat-popup.open {
        height: 60vh; /* 50% dell'altezza della finestra */
        display: block;
        opacity: 1;
    }

/* Media query per dispositivi mobili */
@media (max-width: 768px) {
    .chat-popup {
        width: 80vw; /* 80% della larghezza della finestra */
        right: 10px;
    }

        .chat-popup.open {
            height: 80vh; /* 80% dell'altezza della finestra */
        }
}


/* Stile per il popup di WhatsApp (verde) */
.whatsapp .chat-popup.open {
    border: 2px solid #25D366;
}

/* Stile per il popup di Email (nero) */
.email .chat-popup.open {
    border: 2px solid #000000;
}

/* Stile per il popup di SMS (blu) */
.sms .chat-popup.open {
    border: 2px solid #0078D4;
}

/* Stile per l'intestazione del popup */
.chat-header {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

/* Stile per l'intestazione di WhatsApp (verde) */
.whatsapp .chat-header {
    background-color: #25D366;
}

/* Stile per l'intestazione di Email (nero) */
.email .chat-header {
    background-color: #000000;
}

/* Stile per l'intestazione di SMS (blu) */
.sms .chat-header {
    background-color: #0078D4;
}


.chat-header h3 {
    margin: 0; /* Rimuove il margine predefinito dell'h3 */
    font-size: 16px; /* Dimensione del testo ridotta */
    margin-right: auto; /* Spinge il menù a tendina a destra */
}

.channel-selector {
    margin-left: 10px; /* Aggiunge uno stacco tra il nominativo e il menù a tendina */
}

    .channel-selector select {
        padding: 5px;
        border-radius: 5px;
        border: 1px solid #ccc;
        background-color: white;
        color: black;
    }

        .channel-selector select option {
            background-color: white;
            color: black;
        }

/* Stile per i messaggi */
.chat-messages {
    padding: 10px;
    height: calc(100% - 120px); /* Altezza dei messaggi */
    overflow-y: auto;
}

.message {
    margin-bottom: 10px;
    max-width: 80%;
    padding: 8px;
    border-radius: 8px;
    position: relative;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.message-icon {
    font-size: 12px;
    margin-right: 5px;
}

.direction-icon {
    font-size: 10px;
    margin-right: 5px;
}

.direction-out {
    color: #4CAF50; /* Verde per i messaggi in uscita */
}

.direction-in {
    color: #F44336; /* Rosso per i messaggi in entrata */
}

.whatsapp-icon {
    color: #25D366; /* Verde WhatsApp */
}

.email-icon {
    color: #000000; /* Nero */
}

.sms-icon {
    color: #0078D4; /* Blu SMS */
}

.message-date {
    font-size: 10px;
    color: #999;
}


.message.sent {
    background-color: #dcf8c6; /* Colore di sfondo per i messaggi inviati */
    margin-left: auto;
}

.message.received {
    background-color: #ffffff; /* Colore di sfondo per i messaggi ricevuti */
    border: 1px solid #e0e0e0;
}

.message.whatsapp-received {
    background-color: #e6f7e6; /* Verde più chiaro per i messaggi WhatsApp in entrata */
    border: 1px solid #dcf8c6;
}

.message.email-received {
    background-color: #fff8f0; /* Bianco panna per i messaggi email in entrata */
    border: 1px solid #f0e6d2;
}

.message.email-sent {
    background-color: #ffffff; /* Bianco per i messaggi email in uscita */
    border: 1px solid #e0e0e0;
    margin-left: auto;
}

.message.sms-received {
    background-color: #b3e5fc; /* Celeste per i messaggi SMS in entrata */
    border: 1px solid #81d4fa;
}

.message.sms-sent {
    background-color: #e1f5fe; /* Celeste più chiaro per i messaggi SMS in uscita */
    border: 1px solid #b3e5fc;
    margin-left: auto;
}

.message-content {
    word-wrap: break-word;
}

.message-media {
    max-width: 200px;
    max-height: 200px;
    border-radius: 5px;
    margin-top: 5px;
}

/* Stile per l'input */
/*.chat-input {
    display: flex;
    padding: 10px;
    background-color: #f0f0f0;
    position: absolute;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
}*/
.chat-input {
    position: relative;
    display: flex;
    padding: 10px;
    background-color: #f0f0f0;
}

    .chat-input input {
        flex: 1;
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 20px;
        outline: none;
    }

    .chat-input button {
        background-color: inherit;
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 20px;
        cursor: pointer;
        margin-left: 10px;
    }

/* Stile per il pulsante di invio in base al canale */
.whatsapp .chat-input button {
    background-color: #25D366;
}

.email .chat-input button {
    background-color: #000000;
}

.sms .chat-input button {
    background-color: #0078D4;
}


.error-popup {
    position: absolute;
    bottom: 100%;
    right: 0;
    background-color: #ffebee;
    color: #d32f2f;
    padding: 6px 10px; /* Ridotto il padding */
    border-radius: 4px; /* Ridotto il border-radius */
    margin-bottom: 8px; /* Ridotto il margine */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); /* Ombra leggermente ridotta */
    display: flex;
    align-items: center;
    z-index: 1000;
    white-space: nowrap;
    font-size: 12px; /* Dimensione del testo ridotta */
}

    .error-popup .close-error-popup {
        margin-left: 8px; /* Ridotto il margine */
        background: none;
        border: none;
        cursor: pointer;
        color: #d32f2f;
        font-size: 12px; /* Dimensione del pulsante di chiusura ridotta */
        padding: 0 2px; /* Ridotto il padding */
    }

.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.selected-option {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    color: #333; /* Colore scuro per il testo */
}

    .selected-option i {
        margin-right: 8px;
    }

.dropdown-arrow {
    margin-left: auto;
}

.options-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff; /* Sfondo bianco */
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.option {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    color: #333; /* Colore scuro per il testo */
}

    .option:hover {
        background-color: #f0f0f0;
    }

    .option i {
        margin-right: 8px;
    }
