/* XA IA - Chatbot Widget pour Andu-Xara */
/* Styles aux couleurs de la marque (#e67e22) */

.xa-ia-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

.xa-ia-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e67e22;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.xa-ia-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.xa-ia-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xa-ia-button .default-icon {
    font-size: 32px;
    color: white;
}

.xa-ia-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid rgba(230,126,34,0.3);
}

.xa-ia-chat.hidden {
    display: none;
}

.xa-ia-header {
    background: #e67e22;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.xa-ia-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.xa-ia-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xa-ia-avatar .default-avatar {
    font-size: 24px;
}

.xa-ia-title {
    flex: 1;
}

.xa-ia-title h3 {
    margin: 0;
    font-size: 16px;
}

.xa-ia-title p {
    margin: 0;
    font-size: 11px;
    opacity: 0.9;
}

.xa-ia-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
}

.xa-ia-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

.xa-ia-message {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.xa-ia-message.user {
    background: #e67e22;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.xa-ia-message.bot {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.xa-ia-message.bot strong {
    color: #e67e22;
}

.xa-ia-typing {
    display: flex;
    gap: 5px;
    padding: 10px 12px;
    background: white;
    border-radius: 15px;
    align-self: flex-start;
}

.xa-ia-typing span {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: xaTyping 1.4s infinite;
}

.xa-ia-typing span:nth-child(2) { animation-delay: 0.2s; }
.xa-ia-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes xaTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.xa-ia-input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
    background: white;
    gap: 10px;
}

.xa-ia-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.xa-ia-input:focus {
    border-color: #e67e22;
}

.xa-ia-send {
    background: #e67e22;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.3s;
}

.xa-ia-send:hover {
    background: #d35400;
}

@media (max-width: 480px) {
    .xa-ia-chat {
        width: calc(100vw - 40px);
        right: 0;
        bottom: 80px;
        height: 70vh;
    }
}
