/* ===========================================
   BOUTONS FLOTTANTS (FAB - Floating Action Buttons)
   =========================================== */

.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white !important;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    opacity: 1;
    transform: translateY(0);
    position: relative;
    /* Corrections importantes pour le clic */
    pointer-events: auto;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fab:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    color: white !important;
    text-decoration: none;
}

.fab:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.fab:active {
    transform: translateY(-2px) scale(0.95);
    transition: all 0.1s ease;
}

/* WhatsApp Button */
.fab-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    animation: fadeInUp 0.6s ease 0.2s both;
}

.fab-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E, #25D366);
}

/* Chatbot Button */
.fab-chat {
    background: linear-gradient(135deg, #007bff, #0056b3);
    animation: fadeInUp 0.6s ease 0.4s both;
}

.fab-chat:hover {
    background: linear-gradient(135deg, #0056b3, #007bff);
}

/* Scroll to Top Button - CORRECTIONS IMPORTANTES */
.fab-top {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    /* Changement : commencer visible pour debug */
    opacity: 1;
    pointer-events: auto;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease 0.6s both;
    /* Assurer la visibilité */
    visibility: visible;
    z-index: 1001;
}

.fab-top.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    display: flex;
}

.fab-top.hide {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.fab-top:hover {
    background: linear-gradient(135deg, #1e7e34, #28a745);
}

/* S'assurer que l'icône est cliquable */
.fab-top i {
    pointer-events: none;
    font-size: 24px;
    line-height: 1;
}

/* Animation d'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de pulsation pour attirer l'attention */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.fab-chat.pulse {
    animation: pulse 2s infinite;
}

/* Styles pour test/debug */
.fab-top.debug {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    display: flex !important;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .floating-actions {
        bottom: 20px;
        right: 20px;
        gap: 12px;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        font-size: 20px;
        /* Améliorer le touch sur mobile */
        -webkit-touch-action: manipulation;
        touch-action: manipulation;
    }
    
    .fab-top i {
        font-size: 20px;
    }
}

        /* ===========================================
           MODAL CHATBOT
           =========================================== */

        #chatbotModal .modal-dialog {
            max-width: 600px;
            margin: 1.75rem auto;
        }

        #chatbotModal .modal-content {
            border-radius: 15px;
            border: none;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

        #chatbotModal .modal-header {
            background: linear-gradient(135deg, #28a745, #20c997);
            border-radius: 15px 15px 0 0;
            padding: 1rem 1.5rem;
        }

        /* Zone de chat */
        #chatContainer {
            height: 400px;
            display: flex;
            flex-direction: column;
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            background: #f8f9fa;
            max-height: 350px;
        }

        .message {
            margin-bottom: 15px;
            display: flex;
            flex-direction: column;
        }

        .message-content {
            max-width: 80%;
            padding: 12px 16px;
            border-radius: 18px;
            font-size: 14px;
            line-height: 1.4;
            word-wrap: break-word;
        }

        .bot-message .message-content {
            background: #e3f2fd;
            color: #1565c0;
            align-self: flex-start;
            border-bottom-left-radius: 6px;
            border: 1px solid #bbdefb;
        }

        .user-message .message-content {
            background: #28a745;
            color: white;
            align-self: flex-end;
            border-bottom-right-radius: 6px;
        }

        .message-time {
            font-size: 11px;
            color: #6c757d;
            margin-top: 4px;
            align-self: flex-start;
        }

        .user-message .message-time {
            align-self: flex-end;
        }

        /* Zone de saisie */
        .chat-input-container {
            padding: 15px 20px;
            background: white;
            border-top: 1px solid #dee2e6;
        }

        #chatInput {
            border-radius: 25px;
            padding: 12px 20px;
            border: 1px solid #ced4da;
            font-size: 14px;
        }

        #chatInput:focus {
            border-color: #28a745;
            box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
        }

        #sendButton {
            border-radius: 50%;
            width: 45px;
            height: 45px;
            padding: 0;
            background: #28a745;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #sendButton:hover {
            background: #218838;
            transform: scale(1.05);
        }

        /* Test styles */
        .status-indicator {
            position: fixed;
            top: 20px;
            left: 20px;
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 10px 15px;
            border-radius: 5px;
            font-family: monospace;
            font-size: 12px;
            z-index: 1001;
        }

        /* Styles pour l'invitation du chatbot */
        .fab-chat {
            position: relative;
            overflow: visible;
        }

        /* Bulle d'invitation */
        .chat-invitation {
            position: absolute;
            right: 70px;
            top: 50%;
            transform: translateY(-50%);
            background: linear-gradient(135deg, #28a745, #20c997);
            color: white;
            padding: 12px 16px;
            border-radius: 20px;
            box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: all 0.4s ease;
            max-width: 280px;
            width: max-content;
            z-index: 1001;
        }

        .chat-invitation::after {
            content: '';
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            border: 8px solid transparent;
            border-left-color: #28a745;
        }

        .chat-invitation.show {
            opacity: 1;
            visibility: visible;
            animation: bounceIn 0.6s ease;
        }

        .chat-invitation.hide {
            opacity: 0;
            visibility: hidden;
            transform: translateY(-50%) translateX(10px);
        }

        /* Badge de notification */
        .notification-badge {
            position: absolute;
            top: -5px;
            right: -5px;
            width: 20px;
            height: 20px;
            background: #dc3545;
            border: 2px solid white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: bold;
            color: white;
            opacity: 0;
            transform: scale(0);
            transition: all 0.3s ease;
        }

        .notification-badge.show {
            opacity: 1;
            transform: scale(1);
            animation: pulse-badge 2s infinite;
        }

        /* Animations */
        @keyframes bounceIn {
            0% {
                opacity: 0;
                transform: translateY(-50%) scale(0.3);
            }
            50% {
                opacity: 1;
                transform: translateY(-50%) scale(1.05);
            }
            70% {
                transform: translateY(-50%) scale(0.9);
            }
            100% {
                opacity: 1;
                transform: translateY(-50%) scale(1);
            }
        }

        @keyframes pulse-badge {
            0% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
            }
            70% {
                transform: scale(1.1);
                box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
            }
            100% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
            }
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
            20%, 40%, 60%, 80% { transform: translateX(3px); }
        }

        .fab-chat.shake {
            animation: shake 0.8s ease-in-out;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .chat-invitation {
                right: 60px;
                font-size: 12px;
                padding: 10px 14px;
                max-width: 200px;
            }

            .chat-invitation::after {
                border-width: 6px;
            }
        }

        /* Avatar photo */
        .sica-avatar {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            border: 3px solid rgba(255, 255, 255, 0.3);
            object-fit: cover;
            transition: all 0.3s ease;
        }

        .fab-chat:hover .sica-avatar {
            transform: scale(1.1);
            border-color: rgba(255, 255, 255, 0.6);
        }

        /* Avatar emoji */
        .sica-avatar-emoji {
            font-size: 35px;
            line-height: 1;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
        }

        /* Avatar initiales */
        .sica-avatar-initials {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            font-weight: bold;
            color: white;
            text-shadow: 0 1px 2px rgba(0,0,0,0.3);
            border: 3px solid rgba(255, 255, 255, 0.3);
        }