/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f8fafc;
    min-height: 100vh;
}

/* Contenu principal */
.chat-main-content {
    min-height: 100vh;
    padding-bottom: 100px; /* Espace pour le chatbot */
}

.chat-header {
    color: #000;
    padding: 2rem 0;
}

.chat-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.chat-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 400;
}

.chat-main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.chat-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chat-info-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
}

.chat-info-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-info-card ul {
    list-style: none;
    color: #6b7280;
}

.chat-info-card li {
    margin-bottom: 0.5rem;
}

.chat-schedule p {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.chat-highlight {
    color: #3b82f6 !important;
    font-weight: 600;
}

.chat-notice {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 2rem;
}

/* Chatbot Styles */
#bot-chatbot-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
}

/* Icône du chat */
.bot-chat-icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.bot-chat-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.4);
}

.bot-chat-icon i {
    color: white;
    font-size: 1.5rem;
}

.bot-message-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Fenêtre de chat */
.bot-chat-window {
    width: 24rem;
    height: 37.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-chat-window.bot-minimized {
    height: 5rem;
}

/* En-tête du chat */
.bot-chat-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bot-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bot-bot-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-bot-avatar i {
    font-size: 1.25rem;
}

.bot-bot-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.bot-bot-info p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.bot-chat-controls {
    display: flex;
    gap: 0.5rem;
}

.bot-control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bot-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Aperçu minimisé */
.bot-chat-preview {
    flex: 1;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.bot-chat-preview:hover {
    background: #f9fafb;
}

.bot-preview-content {
    color: #6b7280;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Corps du chat */
.bot-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bot-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Messages */
.bot-message {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: 85%;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message.bot-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-message.bot-bot {
    align-self: flex-start;
}

.bot-message-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.bot-message.bot-bot .bot-message-avatar {
    background: #3b82f6;
    color: white;
}

.bot-message.bot-user .bot-message-avatar {
    background: #6b7280;
    color: white;
}

.bot-message-content {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.bot-message.bot-bot .bot-message-content {
    border-bottom-left-radius: 0.25rem;
    border: 1px solid #e5e7eb;
}

.bot-message.bot-user .bot-message-content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.bot-message-text {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.bot-message-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Indicateur de frappe */
.bot-typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 85%;
    align-self: flex-start;
}

.bot-typing-dots {
    display: flex;
    gap: 0.25rem;
}

.bot-typing-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #6b7280;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.bot-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.bot-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Zone de saisie */
.bot-chat-input-area {
    border-top: 1px solid #e5e7eb;
    background: white;
    padding: 1rem;
}

.bot-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

#bot-message-input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 1.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.3s ease;
    background: #f8fafc;
}

#bot-message-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.bot-send-btn {
    background: #3b82f6;
    border: none;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bot-send-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.05);
}

.bot-send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.bot-disclaimer {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.4;
}

/* Classes utilitaires */
.bot-hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #bot-chatbot-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    .bot-chat-window {
        width: calc(100vw - 2rem);
        max-width: 22rem;
        height: calc(100vh - 8rem);
        max-height: 35rem;
    }
    
    .chat-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .chat-content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .chat-main-container {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .bot-chat-icon {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .bot-chat-icon i {
        font-size: 1.25rem;
    }
    
    .bot-chat-window {
        width: calc(100vw - 1rem);
        height: calc(100vh - 6rem);
        max-height: none;
    }
    
    .chat-header h1 {
        font-size: 1.75rem;
    }
    
    .chat-info-card {
        padding: 1.5rem;
    }
    
    .chat-main-container {
        padding: 1rem 0.75rem;
    }
}