/* ========================================
   HOMEPAGE CHATBOT CONVERSATIONNEL
   ======================================== */

.homepage-chatbot-section {
    background: #ffffff;
    padding: 20px 20px;
    margin: 0 0 30px 0;
}

.homepage-chatbot-container {
    max-width: 900px;
    /* Largeur limitée pour la homepage */
    margin: 0 auto;
}

/* Sur la page fullpage du chatbot, utiliser toute la largeur disponible */
.chatbot-fullpage .homepage-chatbot-container,
.chatbot-fullpage .homepage-chatbot-wrapper,
.chatbot-fullpage-wrapper {
    max-width: none !important;
    width: 100% !important;
}

.homepage-chatbot-header {
    text-align: center;
    margin-bottom: 40px;
}

.homepage-chatbot-header h2 {
    font-size: 30px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
}

.homepage-chatbot-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.homepage-chatbot-wrapper {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.homepage-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #ffffff;
    scroll-behavior: smooth;
}

/* Welcome Message */
.homepage-chatbot-welcome {
    text-align: center;
    padding: 0px 20px;
    color: #495057;
}

.homepage-chatbot-welcome .welcome-icon {
    font-size: 4rem;
    color: #0066cc;
    margin-bottom: 20px;
}

.homepage-chatbot-welcome h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
}

.homepage-chatbot-welcome p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.homepage-chatbot-welcome .welcome-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    font-style: italic;
}

/* Messages */
.homepage-chatbot-message {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.message-content {
    flex: 1;
    max-width: 75%;
}

.message-text {
    background: #f3f4f6;
    padding: 16px 20px;
    border-radius: 18px;
    line-height: 1.7;
    font-size: 0.95rem;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.user-message .message-text {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    border: none;
}

.bot-message .message-text {
    border-bottom-left-radius: 6px;
}

.user-message .message-text {
    border-bottom-right-radius: 6px;
}

/* Typing Indicator */
.typing-indicator {
    display: inline-block;
    animation: blink 1.4s infinite;
    font-size: 1.5rem;
    color: #0066cc;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Sources */
.message-sources {
    margin-top: 15px;
}

.sources-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sources-title i {
    color: #0066cc;
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: #4b5563;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.source-link:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #0066cc;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.source-link i {
    font-size: 0.75rem;
    color: #0066cc;
}

.source-link span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Follow-up Questions */
.message-followup {
    margin-top: 20px;
}

.followup-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.followup-title i {
    color: #ffc107;
}

.followup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.followup-question {
    padding: 13px 18px;
    background: #f9fafb;
    border: 1.5px solid #bfdbfe;
    border-radius: 14px;
    text-align: left;
    color: #0066cc;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.followup-question:hover {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    border-color: transparent;
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(0, 102, 204, 0.25);
}

/* Input Area */
.homepage-chatbot-input-wrapper {
    background: #f9fafb;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.homepage-chatbot-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.homepage-chatbot-input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px 20px;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
    min-height: 52px;
    max-height: 150px;
    background: white;
}

.homepage-chatbot-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.homepage-chatbot-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #000000;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-bottom: 5px;
}

.homepage-chatbot-send-btn:hover:not(:disabled) {
    background: #333333;
    transform: none;
}

.homepage-chatbot-send-btn:disabled {
    background: #e5e5e5;
    color: #8e8e8e;
    cursor: not-allowed;
}

/* Error Message */
.error-message {
    color: #dc3545;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .homepage-chatbot-section {
        padding: 40px 15px;
    }

    .homepage-chatbot-header h2 {
        font-size: 2rem;
    }

    .homepage-chatbot-header p {
        font-size: 1rem;
    }

    .homepage-chatbot-wrapper {
        height: 500px;
    }

    .homepage-chatbot-messages {
        padding: 20px;
    }

    .message-content {
        max-width: 85%;
    }

    .message-text {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .homepage-chatbot-welcome {
        padding: 40px 15px;
    }

    .homepage-chatbot-welcome h3 {
        font-size: 1.5rem;
    }
}

/* Scrollbar Styling - Modern & Discreet */
.homepage-chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.homepage-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.homepage-chatbot-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.homepage-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Firefox scrollbar */
.homepage-chatbot-messages {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}