/* Style per Uncensored Chatbot - Posizionamento COMPATTO IN ALTO A DESTRA + PULSANTE X */

/* Pulsante di riapertura (visibile quando la chat è chiusa) */
#uac-chat-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    background-color: #1e293b;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: none; /* Nascosto di default, appare solo quando la chat si chiude */
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#uac-chat-toggle:hover {
    background-color: #2563eb;
    transform: scale(1.05);
}

/* Container principale della chat (dimensioni ridotte) */
#uac-chat-container {
    position: fixed;
    top: 20px;                  /* Distanza dal bordo superiore */
    right: 20px;                /* Distanza dal bordo destro */
    width: 310px;               /* Ridotto da 360px per occupare meno spazio */
    height: 420px;              /* Ridotto da 500px per non ingombrare */
    max-width: 90vw;
    max-height: 80vh;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 999999;           /* Mantiene la chat sopra tutti gli altri elementi */
    font-family: Arial, sans-serif;
    overflow: hidden;
}

#uac-chat-header {
    background-color: #1e293b;
    color: #ffffff;
    padding: 10px 14px;
    font-weight: bold;
    font-size: 15px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Pulsante X per chiudere la chat */
#uac-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.8;
    transition: opacity 0.2s ease, color 0.2s ease;
}

#uac-close-btn:hover {
    opacity: 1;
    color: #ef4444; /* Si colora di rosso al passaggio del mouse */
}

#uac-chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uac-message {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 88%;
    word-wrap: break-word;
}

.uac-message.uac-bot {
    background-color: #e2e8f0;
    color: #0f172a;
    align-self: flex-start;
}

.uac-message.uac-user {
    background-color: #2563eb;
    color: #ffffff;
    align-self: flex-end;
}

#uac-chat-input-area {
    display: flex;
    padding: 8px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    gap: 6px;
}

#uac-user-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

#uac-user-input:focus {
    border-color: #2563eb;
}

#uac-send-btn {
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

#uac-send-btn:hover {
    background-color: #1d4ed8;
}