/* Caisse à Chien - Styles du chat conversationnel */

.caisseachien-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-trigger {
    background: linear-gradient(135deg, #99B815 0%, #99B815 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(153, 184, 21, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.chat-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(153, 184, 21, 0.5);
}

.chat-trigger i {
    font-size: 20px;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.chat-header {
    background: linear-gradient(135deg, #99B815 0%, #99B815 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

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

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

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

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

.bot-message .message-avatar {
    background: linear-gradient(135deg, #99B815 0%, #99B815 100%);
    color: white;
}

.user-message .message-avatar {
    background: #e9ecef;
    color: #6c757d;
}

.message-content {
    flex: 1;
}

.message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

.user-message .message-text {
    background: linear-gradient(135deg, #99B815 0%, #99B815 100%);
    color: white;
}

.message-timestamp {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 16px;
}

.chat-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

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

.chat-input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

.chat-input-wrapper input:focus {
    border-color: #99B815;
}

.chat-input-wrapper input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
}

.chat-input-wrapper button {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #99B815 0%, #99B815 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-input-wrapper button:hover:not(:disabled) {
    transform: scale(1.05);
}

.chat-input-wrapper button:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.chat-actions {
    display: flex;
    justify-content: center;
}

.chat-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #99B815 0%, #99B815 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(153, 184, 21, 0.3);
}

/* Produits recommandés */
.recommended-products {
    margin-top: 16px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.product-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.product-price {
    color: #99B815;
    font-weight: 600;
    font-size: 16px;
}

.product-description {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 12px;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 16px;
}

.btn-outline-primary {
    border: 1px solid #99B815;
    color: #99B815;
    background: white;
}

.btn-outline-primary:hover {
    background: #99B815;
    color: white;
}

/* Widget panier */
.caisseachien-cart-widget {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.cart-chat-suggestion {
    display: flex;
    gap: 16px;
    align-items: center;
}

.suggestion-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #99B815 0%, #99B815 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.suggestion-content h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.suggestion-content p {
    margin: 0 0 12px 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

/* Formulaire demande spéciale */
.special-request-form {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 12px;
    margin-top: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 13px;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #99B815;
}

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

/* États de chargement */
.loading-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-style: italic;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #99B815;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .caisseachien-chat-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chat-window {
        width: 100%;
        height: 70vh;
        bottom: 70px;
        right: 0;
    }
    
    .chat-trigger {
        width: 100%;
        justify-content: center;
        border-radius: 12px;
    }
}
