/* Assistant Virtuel PixelRush - Styles */

.chat-assistant-widget {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Classes de position */
.chat-assistant-widget.right-4 {
    right: 20px;
}

.chat-assistant-widget.left-4 {
    left: 20px;
}

/* Bouton flottant */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-icon {
    width: 28px;
    height: 28px;
}

/* Fenêtre de chat */
.chat-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

/* Position de la fenêtre selon le côté du widget */
.chat-assistant-widget.right-4 .chat-window {
    right: 0;
}

.chat-assistant-widget.left-4 .chat-window {
    left: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* En-tête */
.chat-header {
    padding: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.chat-avatar svg {
    width: 24px;
    height: 24px;
}

.chat-header-title {
    font-weight: 600;
    font-size: 16px;
}

.chat-header-status {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Zone des messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
}

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

.chat-message-assistant {
    justify-content: flex-start;
}

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

.chat-message-user .chat-message-content {
    background: var(--chat-primary-color, #3b82f6);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-assistant .chat-message-content {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Indicateur de chargement */
.chat-loading {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.chat-loading span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Réponses rapides */
.quick-responses {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-response-btn {
    padding: 8px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-response-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* Zone de saisie */
.chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--chat-primary-color, #3b82f6);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.chat-send-btn:hover {
    opacity: 0.9;
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Scrollbar personnalisée */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive - Mobile */
@media (max-width: 640px) {
    .chat-assistant-widget {
        bottom: 15px;
    }

    .chat-assistant-widget.right-4 {
        right: 15px;
    }

    .chat-assistant-widget.left-4 {
        left: 15px;
    }

    .chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        max-height: 600px;
        bottom: 75px;
    }

    .chat-assistant-widget.left-4 .chat-window {
        left: 0;
        right: auto;
    }

    .chat-assistant-widget.right-4 .chat-window {
        right: 0;
        left: auto;
    }

    .chat-toggle-btn {
        width: 60px;
        height: 60px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    }

    .chat-icon {
        width: 30px;
        height: 30px;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-message-content {
        max-width: 85%;
        font-size: 15px;
    }

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

    .quick-responses {
        padding: 10px 12px;
    }

    .quick-response-btn {
        font-size: 14px;
        padding: 10px 14px;
    }
}

/* Classe utilitaire */
.hidden {
    display: none !important;
}
