/* ===================================================================
   CHATBOT SHIYAO - Style Premium
   =================================================================== */

/* Bouton flottant */
.chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: transparent;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    padding: 0;
    overflow: hidden;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(184, 70, 31, 0.4);
}

.chatbot-trigger img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.chatbot-trigger.active {
    transform: rotate(90deg);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
    }
}

/* Badge notification */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Bulle de message d'invitation */
.chatbot-tooltip {
    position: fixed;
    bottom: 40px;
    right: 100px;
    background: white;
    color: #1f2937;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    z-index: 9997;
    max-width: 220px;
    animation: slideInBounce 0.6s ease-out;
    display: none;
}

.chatbot-tooltip.show {
    display: block;
}

.chatbot-tooltip::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

@keyframes slideInBounce {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    60% {
        opacity: 1;
        transform: translateX(5px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Modale Chatbot */
.chatbot-modal {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-modal.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #B8461F 0%, #9b3a1d 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

.chatbot-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.chatbot-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* Message */
.chatbot-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chatbot-message-content {
    max-width: 75%;
}

.chatbot-message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message.bot .chatbot-message-bubble {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chatbot-message.user .chatbot-message-bubble {
    background: linear-gradient(135deg, #B8461F 0%, #9b3a1d 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.chatbot-message.user .chatbot-message-time {
    text-align: right;
}

/* Typing indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Quick replies */
.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-quick-reply {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-quick-reply:hover {
    background: #B8461F;
    color: white;
    border-color: #B8461F;
}

/* Input */
.chatbot-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.chatbot-input:focus {
    border-color: #B8461F;
    box-shadow: 0 0 0 3px rgba(184, 70, 31, 0.1);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #B8461F 0%, #9b3a1d 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.05);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile */
@media (max-width: 768px) {
    .chatbot-trigger {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .chatbot-modal {
        bottom: 90px;
        right: 20px;
        width: 340px;
        height: 500px;
        border-radius: 16px;
    }
    
    .chatbot-message-content {
        max-width: 80%;
    }
    
    .chatbot-tooltip {
        bottom: 30px;
        right: 85px;
        max-width: 180px;
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* Très petits écrans */
@media (max-width: 400px) {
    .chatbot-modal {
        right: 10px;
        width: calc(100vw - 20px);
        max-width: 340px;
    }
    
    .chatbot-trigger {
        right: 10px;
    }
    
    .chatbot-tooltip {
        right: 75px;
        max-width: 160px;
    }
}

/* Welcome message */
.chatbot-welcome {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.chatbot-welcome-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.chatbot-welcome h4 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 18px;
}

.chatbot-welcome p {
    margin: 0;
    font-size: 14px;
}
