:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #f8fafc;
    --accent-color: #06d6a0;
    --text-color: #1e293b;
    --text-light: #64748b;
    --text-white: #ffffff;
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #2563eb 0%, #06d6a0 100%);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

/* Contact AI Assistant */
.contact-ai-assistant {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-assistant-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
}

.ai-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 2;
}

.ai-info {
    position: relative;
    z-index: 2;
}

.ai-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.ai-info p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.ai-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.feature-item i {
    width: 20px;
    text-align: center;
}

#start-chat {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    backdrop-filter: blur(10px);
}

#start-chat:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Advanced AI Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 600px;
    height: 800px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.8);
    display: none;
    flex-direction: column;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    border: 2px solid rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
}

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

.chatbot-container.minimized {
    height: 60px;
}

.chatbot-container.minimized .chatbot-messages,
.chatbot-container.minimized .chatbot-input-area {
    display: none;
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 20px 20px 0 0;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chatbot-info {
    flex: 1;
}

.chatbot-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-controls {
    display: flex;
    gap: 8px;
}

.chatbot-controls button {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.voice-btn.active {
    background: #10b981 !important;
}

.voice-btn.muted {
    background: #ef4444 !important;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fafc;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.bot-message .message-avatar {
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.user-message .message-avatar {
    background: #10b981;
    color: white;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.user-message .message-content {
    background: #10b981;
    color: white;
}

.message-content p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 0;
    list-style: none;
}

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

.message-time {
    font-size: 10px;
    color: #9ca3af;
    align-self: flex-end;
    margin-top: 4px;
}

.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 10;
}

.input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.chatbot-input-area input,
#chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    position: relative !important;
}

.chatbot-input-area input:focus {
    border-color: #667eea;
}

.voice-input-btn,
.send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.voice-input-btn {
    background: #f3f4f6;
    color: #6b7280;
}

.voice-input-btn:hover {
    background: #e5e7eb;
}

.voice-input-btn.recording {
    background: #ef4444;
    color: white;
    animation: pulse 1.5s infinite;
}

.send-btn {
    background: #10b981;
    color: white;
}

.send-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
}

.quick-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.5);
}

.chatbot-toggle.hidden {
    display: none;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Advanced Expert Typing Styles */
.expert-typing .message-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    position: relative;
}

.expert-thinking {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.expert-typing-text {
    font-style: italic;
    color: #1e40af;
    font-weight: 500;
}

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

.typing-dot {
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    animation: expertTyping 1.2s ease-in-out infinite;
}

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

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

@keyframes expertTyping {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Enhanced Message Content */
.message-content {
    background: white;
    padding: 16px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    line-height: 1.6;
}

.bot-message .message-content {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-left: 4px solid #3b82f6;
}

.message-content strong {
    color: #1e40af;
    font-weight: 600;
}

.message-content em {
    color: #374151;
    font-style: italic;
}

.message-content code {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
}

.message-content .emoji {
    font-size: 1.1em;
    margin: 0 2px;
}

/* Progressive Typing Effect */
.typing-text {
    position: relative;
}

.typing-text::after {
    content: '|';
    color: #3b82f6;
    animation: blink 1s infinite;
    font-weight: normal;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Enhanced chatbot header */
.chatbot-header {
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 25px 25px 0 0;
    position: relative;
    box-shadow: 0 2px 10px rgba(30, 64, 175, 0.2);
}

.chatbot-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.chatbot-info h4 {
    margin: 0 0 2px 0;
    font-size: 17px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

/* Enhanced Messages Area - Version Corrigée */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(135deg, #fafafa 0%, #f8fafc 100%);
    position: relative;
    max-height: calc(100vh - 200px);
    scroll-behavior: smooth;
}

/* Amélioration de la scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.4);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.6);
}

/* Auto-scroll pour nouveaux messages */
.chatbot-messages.auto-scroll {
    scroll-behavior: smooth;
}

/* Animation des nouveaux messages */
.message {
    transition: all 0.3s ease;
}

/* Indicateur de frappe amélioré */
.typing-indicator {
    transition: all 0.2s ease;
}

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

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite both;
}

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

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

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

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* === CHATBOT COMPLET - STYLES UNIFIÉ === */

/* Container principal du chatbot */
.chatbot-container.active {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 600px !important;
    height: 800px !important;
    max-height: 90vh !important;
    background: white !important;
    border-radius: 25px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    z-index: 9999 !important;
}

/* Header du chatbot */
.chatbot-container .chatbot-header,
#chatbot-header {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%) !important;
    color: white !important;
    padding: 20px !important;
    align-items: center !important;
    gap: 15px !important;
    border-radius: 25px 25px 0 0 !important;
    position: relative !important;
    box-shadow: 0 2px 10px rgba(30, 64, 175, 0.2) !important;
    z-index: 1000 !important;
    flex-shrink: 0 !important;
}

.chatbot-container .chatbot-info h4 {
    margin: 0 0 2px 0 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    color: white !important;
    display: block !important;
}

.chatbot-container .chatbot-status {
    font-size: 13px !important;
    opacity: 0.9 !important;
    color: rgba(255, 255, 255, 0.8) !important;
    display: block !important;
}

.chatbot-container .chatbot-avatar {
    width: 40px !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
}

/* Zone de messages */
.chatbot-container #chatbot-messages {
    flex: 1 !important;
    padding: 20px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    background: linear-gradient(135deg, #fafafa 0%, #f8fafc 100%) !important;
    position: relative !important;
    scroll-behavior: smooth !important;
}

/* Zone d'input */
.chatbot-container .chatbot-input-area,
#chatbot-input-area {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 9999 !important;
    background: white !important;
    border-top: 1px solid #e5e7eb !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 120px !important;
    flex-shrink: 0 !important;
    border-radius: 0 0 25px 25px !important;
}

/* Actions rapides */
.chatbot-container .quick-actions {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

.chatbot-container .quick-btn {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border: 2px solid #0ea5e9 !important;
    color: #0369a1 !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.chatbot-container .quick-btn:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3) !important;
}

.chatbot-container .quick-btn i {
    font-size: 11px !important;
    opacity: 0.8 !important;
}

.chatbot-container .input-container {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    align-items: center !important;
}

.chatbot-container #chatbot-input {
    flex: 1 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 12px 16px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    outline: none !important;
    background: white !important;
    color: black !important;
}

.chatbot-container #send-message {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 44px !important;
    height: 44px !important;
    border: none !important;
    border-radius: 50% !important;
    background: #667eea !important;
    color: white !important;
    cursor: pointer !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Empêcher la minimisation de cacher l'input */
.chatbot-container.minimized .chatbot-input-area {
    display: block !important;
}

/* Amélioration responsive du défilement */
@media (max-width: 480px) {
    .chatbot-messages {
        padding: 15px;
        max-height: calc(100vh - 150px);
    }

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

    .chatbot-container .chatbot-input-area {
        padding: 12px !important;
        min-height: 70px !important;
    }
}

/* Advanced Error Handling Styles */
.error-message .message-content {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #ef4444;
    border-radius: 15px;
    padding: 20px;
}

.error-avatar {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.error-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.error-title {
    font-weight: 600;
    color: #dc2626;
    font-size: 16px;
}

.error-type {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-message {
    color: #374151;
    margin: 8px 0;
    font-size: 15px;
}

.error-details {
    background: rgba(107, 114, 128, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin: 12px 0;
}

.error-details small {
    color: #6b7280;
    line-height: 1.4;
}

.error-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.error-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.retry-btn {
    background: #3b82f6;
    color: white;
}

.retry-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.contact-support {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.contact-support:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Network Status Indicator */
.network-status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 10001;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.network-status.online {
    background: rgba(16, 185, 129, 0.9);
}

.network-status.offline {
    background: rgba(239, 68, 68, 0.9);
}

.network-status i {
    font-size: 16px;
}

/* API Loading Indicator */
#api-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(59, 130, 246, 0.95);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    display: none;
    z-index: 10002;
    font-weight: 500;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
}

/* Enhanced animations for error states */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message {
    animation: errorShake 0.5s ease-in-out;
}

.error-action-btn:active {
    transform: scale(0.95);
}

/* Mobile Responsive Styles for Chatbot */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        border-radius: 15px;
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 20px;
    }

    .contact-ai-assistant {
        margin-top: 2rem;
    }

    .ai-assistant-card {
        padding: 1.5rem;
        border-radius: 15px;
    }

    .ai-avatar {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .ai-features {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .feature-item {
        font-size: 0.85rem;
    }

    .chatbot-messages {
        padding: 15px;
    }

    .message {
        max-width: 90%;
    }

    .chatbot-input-area {
        padding: 12px;
    }

    .quick-actions {
        gap: 6px;
    }

    .quick-btn {
        font-size: 11px;
        padding: 5px 10px;
    }

    .contact-content {
        flex-direction: column;
        gap: 2rem;
    }

    .contact-info {
        order: 2;
    }

    .contact-ai-assistant {
        order: 1;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover:after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-toggle {
    background: none;
    border: 2px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.lang-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--gradient);
    color: var(--text-white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.hero-visual {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.card {
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--text-white);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    animation: float 6s ease-in-out infinite;
}

.card i {
    font-size: 2rem;
}

.card span {
    font-weight: 600;
    font-size: 0.9rem;
}

.ai-card {
    top: 10%;
    left: 20%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    animation-delay: -2s;
}

.server-card {
    top: 50%;
    right: 10%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    animation-delay: -4s;
}

.network-card {
    bottom: 10%;
    left: 30%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

/* Services Section */
.services {
    padding: 6rem 0;
    background: var(--bg-color);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--text-white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.service-icon i {
    font-size: 2rem;
    color: var(--text-white);
}

.service-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.service-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.service-card ul {
    list-style: none;
}

.service-card li {
    padding: 0.5rem 0;
    color: var(--text-light);
    position: relative;
    padding-left: 1.5rem;
}

.service-card li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* About Section */
.about {
    padding: 6rem 0;
    background: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.expertise-areas {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.expertise-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.expertise-item i {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.expertise-item h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.expertise-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.stat-item {
    background: var(--text-white);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-light);
    font-weight: 500;
}

/* Contact Section */
.contact {
    padding: 6rem 0;
    background: var(--bg-color);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon i {
    font-size: 1.5rem;
    color: var(--text-white);
}

.contact-details h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.contact-details a,
.contact-details span {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-details a:hover {
    color: var(--primary-color);
}

.contact-form {
    background: var(--text-white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: var(--font-family);
    background: var(--text-white);
    transition: all 0.3s ease;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.3s ease;
    pointer-events: none;
    background: var(--text-white);
    padding: 0 0.5rem;
}

.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.85rem;
    color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--text-color);
    color: var(--text-white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-white);
}

.footer-section h3 {
    font-size: 1.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--text-white);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    text-align: center;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-title {
        font-size: 3rem;
        text-align: center;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .service-card,
    .contact-form {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .floating-cards {
        display: none;
    }

    .hero {
        min-height: 80vh;
    }
}
/* ========================================
   STYLES PROFESSIONNELS POUR TABLEAUX ET CONTENU ENRICHI
   ======================================== */

/* Tableaux professionnels dans le chatbot */
.chatbot-messages .professional-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
    background: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    font-size: 13px !important;
}

.chatbot-messages .professional-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.chatbot-messages .professional-table th {
    padding: 14px 16px !important;
    text-align: left !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border: none !important;
}

.chatbot-messages .professional-table tbody tr {
    transition: all 0.2s ease !important;
    border-bottom: 1px solid #e9ecef !important;
}

.chatbot-messages .professional-table tbody tr:nth-child(even) {
    background: #f8f9fa !important;
}

.chatbot-messages .professional-table tbody tr:nth-child(odd) {
    background: #ffffff !important;
}

.chatbot-messages .professional-table tbody tr:hover {
    background: #e8eaf6 !important;
    transform: scale(1.01) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1) !important;
}

.chatbot-messages .professional-table td {
    padding: 14px 16px !important;
    color: #2d3748 !important;
    border: none !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

.chatbot-messages .professional-table td:last-child {
    font-weight: 600 !important;
    color: #38a169 !important;
}

/* Conteneur de message avec support complet du contenu */
.chatbot-messages .message-content {
    background: white !important;
    padding: 18px 20px !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    line-height: 1.7 !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.chatbot-messages .bot-message .message-content {
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%) !important;
    border-left: 4px solid #667eea !important;
}

/* Titres dans les messages */
.chatbot-messages .message-content h2,
.chatbot-messages .message-content h3,
.chatbot-messages .message-content h4 {
    margin: 16px 0 10px !important;
    color: #1a202c !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.chatbot-messages .message-content h2 {
    font-size: 20px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding-bottom: 8px !important;
}

.chatbot-messages .message-content h3 {
    font-size: 18px !important;
    color: #667eea !important;
}

.chatbot-messages .message-content h4 {
    font-size: 16px !important;
    color: #4a5568 !important;
}

/* Lignes de séparation */
.chatbot-messages .message-content hr {
    border: none !important;
    height: 2px !important;
    background: linear-gradient(90deg, transparent, #667eea, transparent) !important;
    margin: 20px 0 !important;
}

/* Texte gras et emphase */
.chatbot-messages .message-content strong {
    color: #2d3748 !important;
    font-weight: 700 !important;
}

.chatbot-messages .message-content em {
    color: #4a5568 !important;
    font-style: italic !important;
}

/* Montants en TND */
.chatbot-messages .message-content strong[style*="color: #38a169"] {
    display: inline-block !important;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    border: 1px solid #38a169 !important;
}

/* Listes structurées */
.chatbot-messages .message-content ul,
.chatbot-messages .message-content ol {
    margin: 12px 0 !important;
    padding-left: 20px !important;
}

.chatbot-messages .message-content li {
    margin: 8px 0 !important;
    line-height: 1.6 !important;
}

/* Badges et tags */
.chatbot-messages .message-content span[style*="background: linear-gradient"] {
    display: inline-block !important;
    margin: 3px !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2) !important;
}

/* Boîtes décoratives */
.chatbot-messages .message-content > div[style*="background: linear-gradient(135deg, #667eea"] {
    margin: 20px 0 !important;
    animation: slideIn 0.4s ease-out !important;
}

/* Sections avec bordures */
.chatbot-messages .message-content > div[style*="border-left: 4px solid #667eea"] {
    margin: 15px 0 !important;
}

/* Code inline */
.chatbot-messages .message-content code {
    background: #f7fafc !important;
    padding: 3px 8px !important;
    border-radius: 5px !important;
    color: #d53f8c !important;
    font-family: 'Monaco', 'Menlo', monospace !important;
    font-size: 12px !important;
    border: 1px solid #e2e8f0 !important;
}

/* Liens */
.chatbot-messages .message-content a {
    color: #667eea !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #667eea !important;
    transition: all 0.2s ease !important;
}

.chatbot-messages .message-content a:hover {
    color: #764ba2 !important;
    border-bottom-color: #764ba2 !important;
}

/* Emojis agrandis */
.chatbot-messages .message-content span[style*="font-size: 18px"] {
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 4px !important;
}

/* Amélioration de la zone de messages */
.chatbot-messages {
    padding: 25px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100% - 180px) !important;
}

/* Scrollbar personnalisée */
.chatbot-messages::-webkit-scrollbar {
    width: 10px !important;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 10px !important;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 10px !important;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

/* Animation d'entrée pour les nouveaux messages */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-messages .message {
    animation: slideIn 0.3s ease-out !important;
}

/* Responsive - garder la largeur optimale */
@media (max-width: 768px) {
    .chatbot-container,
    .chatbot-container.active {
        width: calc(100vw - 30px) !important;
        height: calc(100vh - 100px) !important;
        bottom: 15px !important;
        right: 15px !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .chatbot-container,
    .chatbot-container.active {
        width: 550px !important;
        height: 750px !important;
    }
}

/* Support pour le contenu long sans coupure */
.chatbot-messages .message-content * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Amélioration de la visibilité des tableaux sur mobile */
@media (max-width: 480px) {
    .chatbot-messages .professional-table {
        font-size: 11px !important;
    }
    
    .chatbot-messages .professional-table th,
    .chatbot-messages .professional-table td {
        padding: 10px 8px !important;
    }
}
