/* chatbot-widget.css */
:root {
    --primary: #1a365d;
    --secondary: #2c5282;
    --accent: #4299e1;
    --success: #48bb78;
    --light: #f7fafc;
    --dark: #2d3748;
    --text: #4a5568;
}

#chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

#chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#chatbot-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(26, 54, 93, 0.3);
}

#chatbot-button svg {
    color: white;
    width: 30px;
    height: 30px;
}

#chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

#chatbot-container.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

#chatbot-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

#chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

#close-chatbot {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

#chat-box {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--light);
}

.input-container {
    display: flex;
    padding: 12px 15px;
    border-top: 1px solid #eee;
    background: white;
}

#user-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#user-input:focus {
    border-color: var(--accent);
}

#send-button {
    background: none;
    border: none;
    color: var(--accent);
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.3s ease;
}

#send-button:hover {
    transform: scale(1.1);
}

#send-button svg {
    width: 20px;
    height: 20px;
}

.user-message {
    background: var(--primary);
    color: white;
    padding: 10px 15px;
    border-radius: 12px 12px 0 12px;
    margin: 8px 0;
    align-self: flex-end;
    max-width: 80%;
    word-wrap: break-word;
    margin-left: auto;
    display: inline-block;
    float: right;
    clear: both;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.bot-message {
    background: white;
    color: var(--text);
    padding: 10px 15px;
    border-radius: 12px 12px 12px 0;
    margin: 8px 0;
    align-self: flex-start;
    max-width: 80%;
    word-wrap: break-word;
    display: inline-block;
    float: left;
    clear: both;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-left: 3px solid var(--accent);
    line-height: 1.5;
}

/* Styles pour le formatage des messages du bot */
.bot-message ul, .bot-message ol {
    padding-left: 20px;
    margin: 8px 0;
}

.bot-message li {
    margin-bottom: 4px;
}

.bot-message strong {
    font-weight: bold;
}

.bot-message em {
    font-style: italic;
}

.bot-message a {
    color: var(--accent);
    text-decoration: underline;
}

.bot-message h3, .bot-message h4 {
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: bold;
}

.loading-dots {
    display: flex;
}

.loading-dots span {
    animation: dot-animation 1.4s infinite ease-in-out both;
    font-size: 20px;
    line-height: 1;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-animation {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Pour les mobiles */
@media (max-width: 480px) {
    #chatbot-container {
        width: calc(100% - 40px);
        height: 60vh;
        bottom: 80px;
    }
}