/* Styles pour le chatbot personnalisé - Version optimisée */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(218,28,92,0.2);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    background: linear-gradient(135deg, #1a1f3a, #0f172a);
    color: white;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chatbot-header h3 i {
    font-size: 1.3rem;
    color: #da1c5c;
}

.chatbot-header .header-title {
    color: white;
    font-weight: 600;
}

.chatbot-header .header-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.7rem;
    font-weight: normal;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
}

.chatbot-header .close-chatbot {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-header .close-chatbot:hover {
    background: #da1c5c;
    transform: rotate(90deg);
}

.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

/* Scrollbar personnalisée */
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #da1c5c;
    border-radius: 10px;
}

.message-bot {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 85%;
}

.message-bot .avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #1a1f3a, #0f172a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-bot .avatar i {
    color: white;
    font-size: 0.9rem;
}

.message-bot .message-content {
    background: white;
    padding: 8px 12px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    color: #333;
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.message-bot .message-content strong {
    font-weight: 700;
    color: #da1c5c;
}

.message-user {
    display: flex;
    justify-content: flex-end;
    max-width: 85%;
    align-self: flex-end;
}

.message-user .message-content {
    background: linear-gradient(135deg, #da1c5c, #e64d7e);
    color: white;
    padding: 8px 12px;
    border-radius: 16px;
    border-top-right-radius: 4px;
    font-size: 0.8rem;
    line-height: 1.45;
}

/* Formulaire dans le chatbot */
.chatbot-form {
    background: white;
    padding: 12px;
    border-radius: 14px;
    margin-top: 8px;
    border: 1px solid #e0e0e0;
}

.chatbot-form-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a1f3a;
    text-align: center;
    font-size: 0.8rem;
}

.chatbot-form-group {
    margin-bottom: 8px;
}

.chatbot-form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.chatbot-form-group input:focus {
    outline: none;
    border-color: #da1c5c;
    box-shadow: 0 0 0 2px rgba(218,28,92,0.1);
}

.chatbot-form-submit {
    background: linear-gradient(135deg, #da1c5c, #e64d7e);
    border: none;
    padding: 8px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(218,28,92,0.3);
}

.chatbot-input-area {
    padding: 10px 12px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.chatbot-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.8rem;
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-input-area input:focus {
    border-color: #da1c5c;
    box-shadow: 0 0 0 2px rgba(218,28,92,0.1);
}

.chatbot-input-area button {
    background: linear-gradient(135deg, #da1c5c, #e64d7e);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-input-area button:hover {
    transform: scale(1.05);
}

.quick-actions {
    padding: 8px 12px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.quick-btn {
    background: #f0f0f0;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.quick-btn:hover {
    background: #da1c5c;
    color: white;
    transform: translateY(-2px);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: white;
    border-radius: 16px;
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.chatbot-footer-note {
    text-align: center;
    padding: 6px;
    font-size: 0.6rem;
    color: #999;
    background: #f8f9fa;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .chatbot-window {
        width: calc(100% - 30px);
        right: 15px;
        left: 15px;
        height: 500px;
        bottom: 80px;
    }
}