/**
 * Chatbot Widget Styles - Coffre-Fort Privé
 */

/* Bulle flottante */
#chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

#chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

#chatbot-bubble i {
    font-size: 28px;
    color: #1a1a1a;
}

#chatbot-bubble .chatbot-bubble-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

/* Widget principal */
#chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    height: 600px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1001;
    overflow: hidden;
}

#chatbot-widget.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* En-tête */
.chatbot-header {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #1a1a1a;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header-icon {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-header-icon i {
    font-size: 20px;
}

.chatbot-header-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

#chatbot-close {
    background: none;
    border: none;
    color: #1a1a1a;
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

#chatbot-close:hover {
    background: rgba(26, 26, 26, 0.1);
}

/* Zone de messages */
#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

#chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 3px;
}

/* Messages */
.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);
    }
}

.message-avatar {
    width: 36px;
    height: 36px;
    background: #d4af37;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar i {
    font-size: 16px;
    color: #1a1a1a;
}

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

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.bot-message .message-content {
    background: #ffffff;
    color: #333;
    border: 1px solid #e0e0e0;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #1a1a1a;
    margin-left: auto;
}

.error-message .message-content {
    background: #ffe0e0;
    border-color: #ffcccc;
    color: #d32f2f;
}

/* Formatage des messages */
.message-content a {
    color: #d4af37;
    text-decoration: underline;
    word-break: break-all;
    overflow-wrap: break-word;
}

.message-content a:hover {
    color: #b8960f;
}

/* Titres dans les messages */
.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 8px 0 6px 0;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.message-content h1 {
    font-size: 18px;
}

.message-content h2 {
    font-size: 16px;
}

.message-content h3 {
    font-size: 14px;
}

/* Boutons CTA dans les messages */
.message-content .chatbot-cta-btn {
    display: inline-block;
    margin: 8px 0 4px 0;
    padding: 10px 20px;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 24px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
}

.message-content .chatbot-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
    color: #1a1a1a;
}

/* Liens téléphone et email */
.message-content .chatbot-phone-link,
.message-content .chatbot-email-link {
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid #d4af37;
    transition: all 0.2s;
}

.message-content .chatbot-phone-link:hover,
.message-content .chatbot-email-link:hover {
    color: #b8960f;
    border-bottom-color: #b8960f;
    background: rgba(212, 175, 55, 0.1);
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

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

.message-content strong {
    font-weight: 600;
}

/* Indicateur de saisie */
.typing-indicator .message-content {
    padding: 12px 20px;
}

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

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

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

.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 */
.chatbot-input-area {
    padding: 10px 12px;
    background: #ffffff;
    border-top: 1px solid #e9e9e9;
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.05);
}

.chatbot-clear-btn {
    position: static;
    font-size: 11px;
    color: #999;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    padding: 6px 12px;
    transition: all 0.2s;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.chatbot-clear-btn:hover {
    color: #d4af37;
    opacity: 1;
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chatbot-clear-btn i {
    font-size: 11px;
    flex-shrink: 0;
}

/* Footer sous la barre de saisie */
.chatbot-footer {
    padding: 4px 12px 10px;
    background: #ffffff;
    display: flex;
    justify-content: center;
    border-top: 1px solid #f0f0f0;
}

#chatbot-input {
    flex: 1;
    border: 1px solid #e6e6e9;
    background: #f7f8fa;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

#chatbot-input::placeholder {
    color: #a0a0a0;
}

#chatbot-input:focus {
    border-color: #d4af37;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

#chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    border: none;
    border-radius: 50%;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

#chatbot-send:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.35);
}

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

#chatbot-send i {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    #chatbot-widget {
        width: calc(100% - 32px);
        height: calc(100% - 32px);
        bottom: 16px;
        right: 16px;
        max-height: 600px;
    }
    
    #chatbot-bubble {
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    #chatbot-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: none;
    }
    
    .chatbot-header {
        border-radius: 0;
    }
}

