/* style per la custom chat */

#chat-toggle-btn {
    position: fixed; bottom: 20px; right: 20px; background: #2b4c7e;
    color: white; padding: 12px 24px; border-radius: 50px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 10000; border: none; font-weight: bold;
}
#chat-widget {
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    width: 420px;
    height: 600px;
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 10px 35px rgba(0,0,0,0.2);
    display: flex; 
    flex-direction: column; 
    z-index: 10000; 
    overflow: hidden;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
@media (max-width: 480px) {
    #chat-widget { width: 90%; right: 5%; left: 5%; }
}
.chat-header {
    background: #f8f9fa; padding: 15px; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
#chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-footer {
    flex-shrink: 0;
    padding: 15px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}
.message {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
}
.message.mine {
    align-self: flex-start;
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    border-bottom-left-radius: 2px;
}
.message.others {
    align-self: flex-end;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-bottom-right-radius: 2px;
    text-align: right;
}
.message b {
    display: block;
    font-size: 11px;
    color: #2b4c7e;
}
.hidden {
    display: none !important;
}

/* Allinea nome e tasto sulla stessa riga */
.msg-header {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Nome e tasto vicini */
    gap: 8px; /* Spazio tra nome e tasto */
    margin-bottom: 4px;
}

/* Stile del tastino X */
.admin-delete-btn {
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 4px;
    width: 16px;  /* Più piccolo */
    height: 16px; /* Più piccolo */
    line-height: 1;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.admin-delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: #cc0000;
}

/* Rendi il testo del messaggio un po' più staccato */
.msg-body {
    word-break: break-word;
    font-size: 0.95em;
    line-height: 1.3;
}