#gaia-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    border: none;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 9999;
    background: #2563eb;
    color: #fff;
}

#gaia-chat-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 320px;
    max-height: 450px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#gaia-chat-widget.gaia-chat-closed {
    display: none;
}

.gaia-chat-header {
    background: #1f2937;
    color: #fff;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gaia-chat-header span {
    font-weight: 600;
    font-size: 14px;
}

.gaia-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.gaia-chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #f3f4f6;
    font-size: 14px;
}

.gaia-msg {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    max-width: 90%;
    word-wrap: break-word;
}

.gaia-msg-user {
    background: #2563eb;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.gaia-msg-bot {
    background: #e5e7eb;
    color: #111827;
    margin-right: auto;
    border-bottom-left-radius: 2px;
}

.gaia-chat-input-area {
    display: flex;
    border-top: 1px solid #e5e7eb;
}

.gaia-chat-input {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 14px;
    outline: none;
}

.gaia-chat-send {
    border: none;
    padding: 0 14px;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.gaia-chat-typing {
    padding: 4px 10px 8px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    background: #f3f4f6;
    border-top: 1px solid #e5e7eb;
}

.gaia-chat-file-row {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 12px;
    gap: 6px;
}

.gaia-chat-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    background: #e5e7eb;
    cursor: pointer;
    flex-shrink: 0;
}

.gaia-chat-file-label input[type="file"] {
    display: none;
}

.gaia-chat-file-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #4b5563;
}

.gaia-msg-file {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gaia-msg-file img {
    max-width: 160px;
    max-height: 120px;
    border-radius: 8px;
    display: block;
}

.gaia-msg-file-name {
    font-size: 12px;
    color: #374151;
}

/* Link cliccabili nei messaggi bot */
.gaia-msg-bot a {
    color: #2563eb;
    text-decoration: underline;
}

/* Contenitore pulsanti link */
.gaia-msg-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Pulsante link */
.gaia-link-btn {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    background: #2563eb;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
}
