/* Chatbot Styles pour OVE Caraïbes */

/* Variables CSS pour le chatbot */
:root {
    --chatbot-primary: #0071e3;
    --chatbot-primary-dark: #005bb8;
    --chatbot-bg: #1d1d1f;
    --chatbot-card-bg: #2c2c2e;
    --chatbot-text: #ffffff;
    --chatbot-text-secondary: #8e8e93;
    --chatbot-border: #3a3a3c;
    --chatbot-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --chatbot-radius: 12px;
}

/* Mode clair pour le chatbot */
.light-theme {
    --chatbot-bg: #ffffff;
    --chatbot-card-bg: #f2f2f7;
    --chatbot-text: #000000;
    --chatbot-text-secondary: #6d6d70;
    --chatbot-border: #d1d1d6;
    --chatbot-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Container principal du chatbot */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Bouton de toggle du chatbot */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: var(--chatbot-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    transition: all 0.3s ease;
    position: relative;
    color: white;
    font-size: 24px;
}

.chatbot-toggle:hover {
    background: var(--chatbot-primary-dark);
    transform: scale(1.05);
}

.chatbot-toggle.active {
    background: var(--chatbot-primary-dark);
    transform: scale(0.95);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3b30;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Fenêtre du chatbot */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--chatbot-bg);
    border-radius: var(--chatbot-radius);
    box-shadow: var(--chatbot-shadow);
    border: 1px solid var(--chatbot-border);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

.chatbot-window.open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Header du chatbot */
.chatbot-header {
    background: var(--chatbot-primary);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--chatbot-border);
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.chatbot-title i {
    font-size: 18px;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Zone des messages */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--chatbot-bg);
    max-height: 350px;
    min-height: 200px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--chatbot-bg);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-border);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--chatbot-primary);
}

/* Messages */
.message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageSlide 0.3s ease;
}

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

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.bot-message .message-content {
    background: var(--chatbot-card-bg);
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    background: var(--chatbot-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--chatbot-text-secondary);
    margin-top: 4px;
    text-align: right;
}

.bot-message .message-time {
    text-align: left;
}

/* Indicateur de frappe */
.typing-indicator .message-content {
    background: var(--chatbot-card-bg);
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--chatbot-text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Zone de saisie */
.chatbot-input-container {
    padding: 20px;
    background: var(--chatbot-bg);
    border-top: 1px solid var(--chatbot-border);
}

/* Formulaire d'informations utilisateur */
.user-info-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--chatbot-border);
    border-radius: 8px;
    background: var(--chatbot-card-bg);
    color: var(--chatbot-text);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.form-group input::placeholder {
    color: var(--chatbot-text-secondary);
}

.btn-start-chat {
    background: var(--chatbot-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-start-chat:hover {
    background: var(--chatbot-primary-dark);
}

/* Zone de saisie de message */
.chat-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

#message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--chatbot-border);
    border-radius: 20px;
    background: var(--chatbot-card-bg);
    color: var(--chatbot-text);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

#message-input:focus {
    outline: none;
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

#message-input::placeholder {
    color: var(--chatbot-text-secondary);
}

.btn-send {
    width: 40px;
    height: 40px;
    background: var(--chatbot-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.btn-send:hover {
    background: var(--chatbot-primary-dark);
}

.btn-send:disabled {
    background: var(--chatbot-text-secondary);
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 15px;
        left: 15px;
    }
    
    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        height: calc(100vh - 80px);
        bottom: 70px;
    }
    
    .chatbot-messages {
        padding: 15px;
    }
    
    .chatbot-input-container {
        padding: 15px;
    }
}

/* Animations d'entrée */
.chatbot-window {
    animation: chatbotSlideIn 0.3s ease;
}

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

/* Amélioration de l'accessibilité */
.chatbot-toggle:focus,
.chatbot-close:focus,
.btn-start-chat:focus,
.btn-send:focus {
    outline: 2px solid var(--chatbot-primary);
    outline-offset: 2px;
}

/* États de chargement */
.btn-send.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Styles pour les liens dans les messages */
.message-content a {
    color: var(--chatbot-primary);
    text-decoration: underline;
}

.user-message .message-content a {
    color: white;
}

/* Styles pour les listes dans les messages */
.message-content ul,
.message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}
