/**
 * Styles pour le module IA - Chatbot DPM Motors
 * 
 * Date : 2025-01-28
 * Compatible PHP 7.4
 */

/* Bouton chatbot en bas à droite */
#ia-chatbot-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #46bbd9;
    border-radius: 50%;
    display: none; /* Caché par défaut, visible en mode test */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(70, 187, 217, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
}

#ia-chatbot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(70, 187, 217, 0.6);
}

#ia-chatbot-btn svg {
    width: 30px;
    height: 30px;
    color: #ffffff;
}

/* Modale chatbot */
#ia-chatbot-modal {
    z-index: 9999;
}

#ia-chatbot-modal .modal-dialog {
    max-width: 90vw;
    max-height: 90vh;
    margin: 5vh auto;
    display: flex;
    flex-direction: column;
}

#ia-chatbot-modal .modal-content {
    height: 90vh;
    display: flex;
    flex-direction: column;
    background-color: #1a1a1a;
    border: 1px solid #46bbd9;
    border-radius: 8px;
}

#ia-chatbot-modal .modal-header {
    background-color: #2d2d2d;
    border-bottom: 1px solid #46bbd9;
    color: #ffffff;
    padding: 15px 20px;
}

#ia-chatbot-modal .modal-header .modal-title {
    color: #ffffff;
    font-weight: 600;
}

#ia-chatbot-modal .modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

#ia-chatbot-modal .modal-header .btn-close:hover {
    opacity: 1;
}

/* Zone de messages */
#ia-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #1a1a1a;
}

/* Message utilisateur */
.ia-message-user {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.ia-message-user .ia-message-bubble {
    background-color: #46bbd9;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    max-width: 70%;
    word-wrap: break-word;
}

/* Message IA */
.ia-message-ai {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.ia-message-ai .ia-message-bubble {
    background-color: #2d2d2d;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 18px 18px 18px 4px;
    max-width: 70%;
    word-wrap: break-word;
    flex-shrink: 0;
}

/* Photo à droite de la bulle IA */
.ia-vehicule-photo-right {
    flex-shrink: 0;
    margin-top: 5px;
}

.ia-message-ai .ia-message-bubble a {
    color: #46bbd9;
    text-decoration: underline;
}

.ia-message-ai .ia-message-bubble a.chat-phone-link,
.ia-message-ai .ia-message-bubble a[href^="tel:"] {
    color: #46bbd9;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.ia-message-ai .ia-message-bubble a.chat-phone-link:hover,
.ia-message-ai .ia-message-bubble a[href^="tel:"]:hover {
    color: #3aa5c4;
}

/* Typing indicator */
.ia-typing {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 15px;
}

.ia-typing-dots {
    display: flex;
    gap: 5px;
    padding: 12px 18px;
    background-color: #2d2d2d;
    border-radius: 18px;
}

.ia-typing-dots span {
    width: 8px;
    height: 8px;
    background-color: #46bbd9;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Zone de saisie */
#ia-chatbot-input-area {
    padding: 20px;
    background-color: #2d2d2d;
    border-top: 1px solid #46bbd9;
}

#ia-chatbot-input-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

#ia-chatbot-input {
    flex: 1;
    width: 100%;
    padding: 12px 18px;
    background-color: #1a1a1a;
    border: 1px solid #46bbd9;
    border-radius: 25px;
    color: #ffffff;
    font-size: 14px;
}

#ia-chatbot-input:focus {
    outline: none;
    border-color: #46bbd9;
    box-shadow: 0 0 0 2px rgba(70, 187, 217, 0.2);
}

#ia-chatbot-send-btn {
    padding: 12px 24px;
    background-color: #46bbd9;
    color: #ffffff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#ia-chatbot-send-btn:hover {
    background-color: #3aa5c4;
    transform: translateY(-2px);
}

#ia-chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cartes véhicules dans le chat */
.ia-vehicule-card {
    background-color: #2d2d2d;
    border: 1px solid #46bbd9;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    max-width: 400px;
}

.ia-vehicule-card img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 10px;
}

.ia-vehicule-card h6 {
    color: #ffffff;
    margin-bottom: 5px;
}

.ia-vehicule-card p {
    color: #cccccc;
    font-size: 14px;
    margin-bottom: 5px;
}

.ia-vehicule-card .ia-vehicule-price {
    color: #46bbd9;
    font-weight: 600;
    font-size: 18px;
    margin: 10px 0;
}

.ia-vehicule-card .ia-vehicule-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #46bbd9;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.ia-vehicule-card .ia-vehicule-link:hover {
    background-color: #3aa5c4;
}

/* Photos inline des véhicules (petites photos dans le texte) */
.ia-vehicule-photo-inline {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.ia-vehicule-photo-inline img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #46bbd9;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ia-vehicule-photo-inline img:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(70, 187, 217, 0.4);
}

/* Galerie photos - Affichage horizontal comme une messagerie */
.ia-photos-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0; /* Pas de margin car le padding est géré par le parent */
    align-items: flex-start;
}

.ia-photos-gallery img {
    width: auto;
    max-width: 180px;
    min-width: 120px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(70, 187, 217, 0.3);
    flex-shrink: 0;
}

.ia-photos-gallery img:hover {
    transform: scale(1.05);
}

/* Formulaire de contact */
.ia-contact-form {
    background-color: #2d2d2d;
    border: 1px solid #46bbd9;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
    max-width: 400px;
}

.ia-contact-form input,
.ia-contact-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #1a1a1a;
    border: 1px solid #46bbd9;
    border-radius: 4px;
    color: #ffffff;
    font-size: 14px;
}

.ia-contact-form input:focus,
.ia-contact-form textarea:focus {
    outline: none;
    border-color: #46bbd9;
    box-shadow: 0 0 0 2px rgba(70, 187, 217, 0.2);
}

.ia-contact-form button {
    padding: 10px 20px;
    background-color: #46bbd9;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.ia-contact-form button:hover {
    background-color: #3aa5c4;
}

/* Responsive */
@media (max-width: 768px) {
    #ia-chatbot-modal .modal-dialog {
        max-width: 100vw;
        max-height: 100vh;
        margin: 0;
    }
    
    #ia-chatbot-modal .modal-content {
        height: 100vh;
        border-radius: 0;
    }
    
    .ia-message-user .ia-message-bubble,
    .ia-message-ai .ia-message-bubble {
        max-width: 85%;
    }
}

