/* ========================================
   CHATBOT IMMO TRANSAC - STYLES
   Assistante Virtuelle : Léa
   ======================================== */

/* ========== BOUTON CHATBOT FLOTTANT AVEC IMAGE LÉA ========== */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF1B8D 0%, #7B2CBF 100%);
    border: 4px solid rgba(255, 27, 141, 0.6);
    box-shadow: 
        0 10px 40px rgba(255, 27, 141, 0.6),
        0 0 0 0 rgba(255, 27, 141, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s ease;
    animation: chatbot-pulse 2.5s infinite;
    overflow: hidden;
    padding: 0;
}

.chatbot-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chatbot-toggle img.loaded {
    opacity: 1;
}

/* Placeholder pendant le chargement de l'image */
.chatbot-toggle::before {
    content: "💬";
    position: absolute;
    font-size: 2rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.chatbot-toggle.image-loaded::before {
    opacity: 0;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 
        0 15px 50px rgba(255, 27, 141, 0.8),
        0 0 0 10px rgba(255, 27, 141, 0.2);
}

.chatbot-toggle.active {
    transform: scale(0.95);
}

@keyframes chatbot-pulse {
    0%, 100% {
        box-shadow: 
            0 10px 40px rgba(255, 27, 141, 0.6),
            0 0 0 0 rgba(255, 27, 141, 0.4);
    }
    50% {
        box-shadow: 
            0 15px 50px rgba(255, 27, 141, 0.8),
            0 0 0 15px rgba(255, 27, 141, 0);
    }
}

/* Badge notification */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #00BCD4;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    animation: chatbot-badge-bounce 1s infinite;
    box-shadow: 0 4px 10px rgba(0, 188, 212, 0.5);
}

@keyframes chatbot-badge-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========== FENÊTRE CHATBOT ========== */
.chatbot-container {
    position: fixed;
    bottom: 130px;
    right: 30px;
    width: 420px;
    max-height: 650px;
    background: linear-gradient(135deg, #0A0E27 0%, #1e293b 100%);
    border-radius: 25px;
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 27, 141, 0.3);
    z-index: 9997;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid rgba(255, 27, 141, 0.4);
    animation: chatbot-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-container.active {
    display: flex;
}

@keyframes chatbot-slide-up {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== HEADER CHATBOT ========== */
.chatbot-header {
    background: linear-gradient(135deg, #FF1B8D 0%, #7B2CBF 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid rgba(255, 27, 141, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.chatbot-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-header-info {
    flex: 1;
}

.chatbot-header-info h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    margin-bottom: 4px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.chatbot-header-info p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 500;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin-top: 2px;
}

.chatbot-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #00ff88;
    animation: chatbot-status-blink 2s infinite;
    box-shadow: 0 0 10px #00ff88;
}

@keyframes chatbot-status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ========== MESSAGES CHATBOT ========== */
.chatbot-messages {
    flex: 1;
    padding: 25px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: rgba(0, 0, 0, 0.2);
    min-height: 400px;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.chatbot-message {
    display: flex;
    gap: 12px;
    animation: chatbot-message-appear 0.4s ease;
}

@keyframes chatbot-message-appear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF1B8D 0%, #7B2CBF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 27, 141, 0.4);
}

.chatbot-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-message.user .chatbot-message-avatar {
    background: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%);
    border-color: rgba(0, 188, 212, 0.4);
}

.chatbot-message-bubble {
    background: rgba(255, 255, 255, 0.08);
    padding: 14px 18px;
    border-radius: 18px;
    max-width: 75%;
    color: white;
    line-height: 1.6;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.chatbot-message.user .chatbot-message-bubble {
    background: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%);
    border-radius: 18px 18px 4px 18px;
}

.chatbot-message.bot .chatbot-message-bubble {
    background: rgba(255, 27, 141, 0.12);
    border: 1px solid rgba(255, 27, 141, 0.25);
    border-radius: 18px 18px 18px 4px;
}

/* Animation de frappe */
.chatbot-typing {
    display: flex;
    gap: 6px;
    padding: 14px 18px;
    background: rgba(255, 27, 141, 0.12);
    border: 1px solid rgba(255, 27, 141, 0.25);
    border-radius: 18px;
    width: fit-content;
}

.chatbot-typing-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: chatbot-typing-bounce 1.4s infinite;
}

.chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatbot-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-12px);
    }
}

/* ========== SUGGESTIONS RAPIDES ========== */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.chatbot-suggestion {
    background: rgba(255, 27, 141, 0.15);
    border: 2px solid rgba(255, 27, 141, 0.4);
    color: white;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chatbot-suggestion:hover {
    background: rgba(255, 27, 141, 0.25);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 27, 141, 0.4);
}

/* ========== MESSAGE BIENVENUE ========== */
.chatbot-welcome {
    text-align: center;
    padding: 35px 25px;
}

.chatbot-welcome-avatar {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 27, 141, 0.5);
    box-shadow: 0 8px 25px rgba(255, 27, 141, 0.4);
}

.chatbot-welcome-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-welcome h4 {
    color: white;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chatbot-welcome p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ========== FORMULAIRE CONTACT ========== */
.chatbot-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 27, 141, 0.2);
    margin-top: 15px;
}

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

.chatbot-form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.chatbot-form-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 27, 141, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chatbot-form-group input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 27, 141, 0.3);
}

.chatbot-form-group small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
}

.chatbot-form-submit {
    background: linear-gradient(135deg, #FF1B8D 0%, #7B2CBF 100%);
    border: none;
    color: white;
    padding: 14px 28px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 27, 141, 0.4);
}

.chatbot-form-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 27, 141, 0.6);
}

.chatbot-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== INPUT CHATBOT ========== */
.chatbot-input-container {
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 27, 141, 0.2);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 27, 141, 0.3);
    border-radius: 25px;
    padding: 14px 20px;
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chatbot-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 27, 141, 0.3);
}

.chatbot-send-btn {
    background: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.4);
}

.chatbot-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.6);
}

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

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 110px;
        right: 15px;
        left: 15px;
        width: auto;
        max-height: 550px;
        border-radius: 20px;
    }
    
    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 70px;
        height: 70px;
    }
    
    .chatbot-header {
        padding: 16px;
    }
    
    .chatbot-avatar {
        width: 48px;
        height: 48px;
    }
    
    .chatbot-header-info h3 {
        font-size: 1.1rem;
    }
    
    .chatbot-header-info p {
        font-size: 0.8rem;
    }
    
    .chatbot-messages {
        padding: 20px 15px;
        min-height: 350px;
    }
    
    .chatbot-message-bubble {
        max-width: 80%;
        font-size: 0.9rem;
        padding: 12px 16px;
    }
    
    .chatbot-welcome {
        padding: 25px 20px;
    }
    
    .chatbot-welcome-avatar {
        width: 75px;
        height: 75px;
    }
    
    .chatbot-welcome h4 {
        font-size: 1.2rem;
    }
    
    .chatbot-welcome p {
        font-size: 0.95rem;
    }
    
    .chatbot-input-container {
        padding: 15px;
    }
    
    .chatbot-input {
        padding: 12px 18px;
        font-size: 0.9rem;
    }
    
    .chatbot-send-btn {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: 100px;
        max-height: 480px;
        right: 10px;
        left: 10px;
    }
    
    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 65px;
        height: 65px;
    }
    
    .chatbot-header {
        padding: 14px;
    }
    
    .chatbot-avatar {
        width: 42px;
        height: 42px;
    }
    
    .chatbot-header-info h3 {
        font-size: 1rem;
    }
    
    .chatbot-messages {
        padding: 15px 12px;
        min-height: 300px;
        gap: 15px;
    }
    
    .chatbot-welcome {
        padding: 20px 15px;
    }
    
    .chatbot-welcome-avatar {
        width: 65px;
        height: 65px;
    }
    
    .chatbot-welcome h4 {
        font-size: 1.1rem;
    }
    
    .chatbot-welcome p {
        font-size: 0.9rem;
    }
    
    .chatbot-suggestion {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .chatbot-form {
        padding: 15px;
    }
    
    .chatbot-form-group input {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* Mode paysage mobile */
@media (max-width: 768px) and (max-height: 500px) {
    .chatbot-container {
        max-height: 85vh;
        bottom: 80px;
    }
    
    .chatbot-messages {
        min-height: 250px;
    }
}
