/* Comunicazione Clienti v6.1.0 - Frontend Styles */

.comunication26-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.comunication26-container * { box-sizing: border-box; }

/* Message Card */
.comunication26-message-card {
    background: #fff; border-radius: 14px; margin-bottom: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.comunication26-message-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12); }
.comunication26-message-card.unread { border-left: 4px solid #f5576c; }

.comunication26-message-card > div:first-child { height: 5px; width: 100%; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.comunication26-message-card > div:nth-child(2) { padding: 20px; position: relative; }

.comunication26-message-subject { display: flex; align-items: center; gap: 15px; cursor: pointer; padding: 10px; border-radius: 10px; transition: background-color 0.2s ease; }
.comunication26-message-subject:hover { background: rgba(0, 0, 0, 0.03); }

.comunication26-message-body { display: none; }
.comunication26-message-card.expanded .comunication26-message-body { display: block; animation: c26-slide-down 0.3s ease; }
@keyframes c26-slide-down { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 1500px; } }

/* ===== v5.1.5 - NOTIFICATION BANNER ===== */
.c26-notif-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: #fff;
    border-radius: 12px;
    margin: 12px auto;
    max-width: 900px;
    box-shadow: 0 8px 24px rgba(245, 87, 108, 0.28);
    font-weight: 500;
    font-size: 15px;
    animation: c26-banner-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes c26-banner-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
.c26-notif-banner-inline {
    margin: 0 auto 18px auto;
}
.c26-notif-banner-icon {
    font-size: 22px;
    background: rgba(255,255,255,0.22);
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}
.c26-notif-banner-text { flex: 1; }
.c26-notif-banner-cta {
    background: rgba(255,255,255,0.25);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s ease;
}
.c26-notif-banner-cta:hover { background: rgba(255,255,255,0.4); color: #fff; text-decoration: none; }
.c26-notif-banner-close,
.c26-mark-all-read {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease;
}
.c26-notif-banner-close { width: 32px; height: 32px; padding: 0; font-size: 18px; line-height: 1; border-radius: 50%; }
.c26-notif-banner-close:hover, .c26-mark-all-read:hover { background: rgba(255,255,255,0.32); }

/* ===== v5.1.5 - BELL ICON ===== */
.c26-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: #f0f4ff;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}
.c26-bell:hover { background: #e0e8ff; transform: scale(1.05); text-decoration: none; }
.c26-bell-icon { font-size: 20px; }
.c26-bell-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 20px; height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(245, 87, 108, 0.4);
    animation: c26-bell-pulse 1.6s ease-in-out infinite;
}
@keyframes c26-bell-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== v5.1.5 - TOAST ===== */
.c26-toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}
.c26-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    min-width: 280px;
    max-width: 420px;
    border-left: 5px solid #667eea;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease;
    pointer-events: auto;
    font-size: 14px;
    color: #333;
}
.c26-toast-show { transform: translateX(0); opacity: 1; }
.c26-toast-hide { transform: translateX(120%); opacity: 0; }
.c26-toast-success { border-left-color: #f5576c; }
.c26-toast-icon {
    font-size: 20px;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: #fff;
    border-radius: 10px;
    flex-shrink: 0;
}
.c26-toast-text { flex: 1; line-height: 1.4; }
.c26-toast-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}
.c26-toast-link:hover { text-decoration: underline; }
.c26-toast-close {
    background: none; border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px; height: 24px;
    line-height: 1;
}
.c26-toast-close:hover { color: #333; }

/* New Badge on card */
.comunication26-new-badge {
    position: absolute; top: 15px; right: 15px;
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: #fff; font-size: 10px; font-weight: 800;
    padding: 4px 10px; border-radius: 12px; letter-spacing: 1px;
    box-shadow: 0 3px 8px rgba(245, 87, 108, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .c26-notif-banner { flex-wrap: wrap; gap: 10px; font-size: 14px; padding: 12px 14px; }
    .c26-notif-banner-text { flex: 1 1 100%; order: 2; }
    .c26-notif-banner-icon { order: 1; }
    .c26-notif-banner-cta, .c26-notif-banner-close, .c26-mark-all-read { order: 3; }
    .c26-toast-container { top: 10px; right: 10px; left: 10px; }
    .c26-toast { min-width: 0; max-width: 100%; }
}

/* ===== v6.1.1 - PUSH BANNER (persistente, visibile solo se ci sono comunicazioni per l'utente/tutti) ===== */
/* v6.1.1: NESSUN pulsante di chiusura per l'utente. Visibile su TUTTE le pagine del sito
   finché restano condizioni vere (push attivo + messaggio non vuoto + esistono comunicazioni). */
.c26-push-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 500;
    border-radius: 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    animation: c26-push-banner-in 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes c26-push-banner-in {
    from { opacity: 0; transform: translateY(-100%); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Variante globale (wp_footer): sticky top/bottom, copre tutto */
.c26-push-banner-global {
    position: fixed;
    left: 0;
    right: 0;
    margin: 0;
    z-index: 2147483647;
}
.c26-push-banner-global.c26-push-banner-top {
    top: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.c26-push-banner-global.c26-push-banner-bottom {
    bottom: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    animation-name: c26-push-banner-in-bottom;
}
@keyframes c26-push-banner-in-bottom {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Variante inline (shortcode): sta nel flusso della pagina */
.c26-push-banner-inline {
    border-radius: 12px;
    margin: 16px auto;
    max-width: 1100px;
}

.c26-push-icon {
    font-size: 22px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    /* v6.6.6 - Animazione lampeggiante per l'icona cartello pericolo */
    animation: c26-icon-flash 1.2s ease-in-out infinite;
}
@keyframes c26-icon-flash {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}
.c26-push-banner:hover .c26-push-icon {
    animation: none;
    opacity: 1;
    transform: scale(1);
}
.c26-push-text {
    flex: 1;
    /* Supporta <a>, <strong>, <em>, <br>, ecc. */
}
.c26-push-text a { color: inherit; text-decoration: underline; font-weight: 700; }
.c26-push-text a:hover { text-decoration: none; }

/* v6.1.1 - Hardening: nessun elemento del push banner può essere chiuso/nascosto lato CSS.
   Il banner è pensato per essere persistente e visibile a tutti gli utenti del sito.
   Non definiamo regole .c26-push-banner-close né .c26-push-dismiss di proposito. */
.c26-push-banner,
.c26-push-banner * { box-sizing: border-box; }
.c26-push-banner[hidden],
.c26-push-banner[aria-hidden="true"] { display: flex !important; }

.c26-push-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    padding: 8px 16px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}
.c26-push-cta:hover {
    background: #fff;
    text-decoration: none;
    color: #1a1a1a;
    transform: translateY(-1px);
}

/* Niente pulsante di chiusura per design (l'admin decide la durata).
   Se in futuro serve, si aggiunge senza rompere il contratto "always visible". */

/* Responsive push banner */
@media (max-width: 768px) {
    .c26-push-banner {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 14px;
        padding: 12px 14px;
    }
    .c26-push-text { flex: 1 1 100%; order: 2; }
    .c26-push-icon { order: 1; }
    .c26-push-cta { order: 3; align-self: flex-start; }
}

/* ===== v6.4.1-hotfix - BANNER SUBJECTS LIST ===== */
.c26-notif-banner-subjects-wrap {
    flex: 1 1 100%;
    margin: 6px 0 0 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    order: 99;
}
.c26-notif-banner-subjects-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
    margin-bottom: 4px;
}
.c26-notif-banner-subjects {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 110px;
    overflow-y: auto;
}
.c26-notif-banner-subjects li.c26-notif-banner-subject {
    margin: 0;
    padding: 3px 0;
    font-size: 13px;
    line-height: 1.35;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
}
.c26-notif-banner-subjects li.c26-notif-banner-subject:last-child {
    border-bottom: none;
}
.c26-notif-banner-subject-link {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.c26-notif-banner-subject-link:hover {
    background: rgba(255, 255, 255, 0.18);
    border-bottom-color: #fff;
}
.c26-notif-banner-subjects li.c26-new-subject {
    animation: c26-subject-flash 1.2s ease-out 1;
}
@keyframes c26-subject-flash {
    0%   { background: rgba(255, 255, 153, 0.55); }
    60%  { background: rgba(255, 255, 153, 0.25); }
    100% { background: transparent; }
}

