﻿/* =============================================
   its-dialogs-chat2.css
   Stili condivisi dialog Chat2:
   struttura, card contatto, template WA
   ============================================= */

/* Struttura dialog */
.lc2-dialog .mud-dialog-title {
    padding: 16px 20px 8px;
    border-bottom: 1px solid #e0e3ed;
}

.lc2-dialog__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1d2e;
}

.lc2-dialog .mud-button-close {
    padding: 4px;
    color: #8a93b8;
    transition: background-color 0.2s, color 0.2s;
}

.lc2-dialog .mud-dialog-content {
    padding: 16px 20px;
}

.lc2-dialog .mud-dialog-actions {
    padding: 8px 20px 16px;
    gap: 8px;
    border-top: 1px solid #e0e3ed;
}

/* Loading inline */
.lc2-dialog__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

/* Card contatto */
.lc2-contatto-card {
    border-radius: 10px !important;
    border: 1px solid #e0e3ed !important;
}

.lc2-contatto-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.lc2-phone-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lc2-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

/* Dialog template WA */
.lc2-dialog--template .mud-dialog {
    max-width: 480px;
}

.lc2-template-dialog__lang {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #8a93b8;
    background: #f0f2f8;
    border-radius: 4px;
    padding: 2px 6px;
}

/* Anteprima messaggio */
.lc2-template-dialog__preview {
    background: #f5f6fa;
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #e0e3ed;
}

.lc2-template-dialog__preview-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #8a93b8;
    margin-bottom: 8px;
}

.lc2-template-dialog__preview-bubble {
    background: #e8f8ee;
    border: 1px solid #b2dfc2;
    border-radius: 14px;
    border-bottom-right-radius: 4px;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #1a4a2e;
    word-break: break-word;
}

/* Placeholder variabili */
.lc2-template-var-placeholder {
    display: inline-block;
    background: #fff3cd;
    border: 1px dashed #f5c842;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 12px;
    color: #7a5f00;
    font-style: italic;
}

.lc2-template-dialog__vars-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #8a93b8;
}

/* Badge tipo template */
.lc2-template-type-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-radius: 4px;
    padding: 2px 5px;
    flex-shrink: 0;
}

.lc2-template-type-badge--image {
    background: #e3f2fd;
    color: #1565c0;
}

.lc2-template-type-badge--video {
    background: #fce4ec;
    color: #c62828;
}

.lc2-template-type-badge--document {
    background: #fff3e0;
    color: #e65100;
}

/* Header info template */
.lc2-template-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 3px;
}

.lc2-template-lang {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #8a93b8;
    margin-top: 4px;
    display: block;
}

.lc2-template-placeholders {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #8a93b8;
    margin-top: 3px;
}

/* ═══════════════════════════════════════════════
   Dialog Invia Contatto — layout mobile-first
   ═══════════════════════════════════════════════ */

/* Label sezione (icona + testo uppercase) */
.lc2-section-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

/* ── Blocco voce (telefono / email / url) ── */
/* Il campo principale occupa tutta la larghezza,
   sotto c'è la riga meta (select tipo + rimozione) */
.lc2-entry-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Riga select tipo + pulsante rimozione */
.lc2-entry-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Card indirizzo interna */
.lc2-addr-card {
    border-radius: 10px !important;
    border: 1px solid var(--mud-palette-divider) !important;
    background: var(--mud-palette-background-grey) !important;
}

/* ── Expansion panels ── */
.lc2-expand .mud-expand-panel {
    border: none !important;
    box-shadow: none !important;
}

.lc2-expand .mud-expand-panel-header {
    padding: 10px 4px !important;
    min-height: 44px !important; /* target touch minimo 44px */
    font-size: 13px !important;
    color: var(--mud-palette-text-secondary) !important;
}

.lc2-expand .mud-expand-panel-content {
    padding: 4px 0 10px !important;
}

.lc2-expand .mud-expand-panel + .mud-expand-panel {
    border-top: 1px solid var(--mud-palette-divider) !important;
}

/* Dialog larghezza massima su mobile */
.lc2-dialog--contatto .mud-dialog {
    width: 100%;
    max-width: 520px;
}


/* ═══════════════════════════════════════════════
   Dialog Nuovo Ticket — toggle modalità + autocomplete anagrafica
   ═══════════════════════════════════════════════ */

/* Riga toggle modalità (icona + testo + link switch) */
.lc2-dialog-ticket__mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f5f6fa;
    border: 1px solid #e0e3ed;
    border-radius: 8px;
    min-height: 40px;
}

.lc2-dialog-ticket__mode-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #4a5270;
    line-height: 1.4;
}

.lc2-dialog-ticket__mode-switch {
    font-size: 12px !important;
    color: var(--its-accent, #25a265) !important;
    text-decoration: underline !important;
    cursor: pointer;
    white-space: nowrap;
}

    .lc2-dialog-ticket__mode-switch:hover {
        opacity: 0.8;
    }

/* Riga risultato autocomplete */
.lc2-autocomplete-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0;
    width: 100%;
}

.lc2-autocomplete-item__main {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.lc2-autocomplete-item__name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1a1d2e;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lc2-autocomplete-item__phone {
    font-size: 12px;
    color: #8a93b8;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: monospace;
}

.lc2-autocomplete-item__sub {
    font-size: 11.5px;
    color: #8a93b8;
    padding-left: 20px; /* indent sotto l'icona */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Preview numero/contatto selezionato (riusa .lc2-phone-preview da LiveChat) */
.lc2-phone-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #edfaf3;
    border: 1px solid #b2dfc2;
    border-radius: 8px;
    font-size: 13px;
    color: #1a4a2e;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .lc2-dialog-ticket__mode-label {
        font-size: 12px;
        gap: 4px;
    }

    .lc2-dialog-ticket__mode-switch {
        font-size: 11px !important;
    }

    .lc2-autocomplete-item__name {
        font-size: 13px;
    }

    .lc2-autocomplete-item__phone {
        font-size: 11px;
    }

    /* Su mobile il numero va sotto il nome per evitare overflow */
    .lc2-autocomplete-item__main {
        flex-wrap: wrap;
        gap: 2px 6px;
    }

    .lc2-autocomplete-item__phone {
        flex-basis: 100%;
        padding-left: 20px;
    }
}
