/* Chatbot Mecanidoc - Styles Modernes */

/* Import Font Awesome */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');

/* Variables CSS */
:root {
    --pc-primary: #00389B;
    --pc-primary-dark: #002a7a;
    --pc-primary-light: #0056d6;
    --pc-accent: #00a8ff;
    --pc-success: #28a745;
    --pc-white: #ffffff;
    --pc-gray: #6c757d;
    --pc-gray-light: #e9ecef;
    --pc-gray-lighter: #f5f7fa;
    --pc-dark: #1a1a2e;
    --pc-border-radius: 12px;
    --pc-box-shadow: 0 4px 20px rgba(0, 56, 155, 0.15);
    --pc-box-shadow-hover: 0 8px 30px rgba(0, 56, 155, 0.25);
    --pc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container principal */
.pc-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Bouton toggle */
.pc-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    border: none;
    color: var(--pc-white);
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--pc-box-shadow);
    transition: var(--pc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pc-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--pc-box-shadow-hover);
}

.pc-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--pc-success);
    color: var(--pc-white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--pc-white);
}

/* Fenêtre du chatbot */
.pc-chatbot-window {
    width: 380px;
    height: 600px;
    background: var(--pc-white);
    border-radius: var(--pc-border-radius);
    box-shadow: var(--pc-box-shadow-hover);
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 80px;
    right: 0;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: var(--pc-transition);
    overflow: hidden;
}

.pc-chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.pc-chatbot-window.minimized {
    height: 60px;
    overflow: hidden;
}

/* Header */
.pc-chatbot-header {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    color: var(--pc-white);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pc-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pc-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pc-chatbot-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.pc-chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pc-chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pc-success);
    display: inline-block;
}

.pc-chatbot-btn-minimize,
.pc-chatbot-btn-close {
    background: transparent;
    border: none;
    color: var(--pc-white);
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: var(--pc-transition);
    opacity: 0.8;
}

.pc-chatbot-btn-minimize:hover,
.pc-chatbot-btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

/* Messages */
.pc-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--pc-gray-lighter);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pc-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.pc-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.pc-chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--pc-gray-light);
    border-radius: 3px;
}

.pc-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--pc-gray);
}

.pc-message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pc-message-user {
    flex-direction: row-reverse;
}

.pc-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.pc-message-bot .pc-message-avatar {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    color: var(--pc-white);
}

.pc-message-user .pc-message-avatar {
    background: var(--pc-gray-light);
    color: var(--pc-gray);
}

.pc-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: var(--pc-border-radius);
    line-height: 1.5;
    font-size: 14px;
}

.pc-message-bot .pc-message-content {
    background: var(--pc-white);
    color: var(--pc-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-top-left-radius: 4px;
}

.pc-message-user .pc-message-content {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    color: var(--pc-white);
    border-top-right-radius: 4px;
}

.pc-message-content p {
    margin: 0;
}

.pc-message-content a {
    color: var(--pc-primary);
    text-decoration: underline;
}

.pc-message-user .pc-message-content a {
    color: var(--pc-white);
    opacity: 0.9;
}

/* Indicateur de frappe */
.pc-chatbot-typing {
    padding: 15px 20px;
    background: var(--pc-gray-lighter);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pc-typing-indicator {
    display: flex;
    gap: 4px;
}

.pc-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pc-primary);
    animation: typing 1.4s infinite;
}

.pc-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.pc-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.pc-typing-text {
    font-size: 12px;
    color: var(--pc-gray);
    font-style: italic;
}

/* Input */
.pc-chatbot-input-container {
    padding: 15px;
    background: var(--pc-white);
    border-top: 1px solid var(--pc-gray-light);
    display: flex;
    gap: 10px;
    align-items: center;
}

.pc-chatbot-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--pc-gray-light);
    border-radius: var(--pc-border-radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--pc-transition);
    outline: none;
}

.pc-chatbot-input:focus {
    border-color: var(--pc-primary);
    box-shadow: 0 0 0 3px rgba(0, 56, 155, 0.1);
}

.pc-chatbot-btn-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    border: none;
    color: var(--pc-white);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--pc-transition);
    box-shadow: 0 2px 8px rgba(0, 56, 155, 0.3);
}

.pc-chatbot-btn-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 56, 155, 0.4);
}

.pc-chatbot-btn-send:active {
    transform: scale(0.95);
}

.pc-chatbot-btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Carrousel de produits */
.pc-products-carousel {
    margin-top: 15px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
}

.pc-carousel-title {
    margin: 0 0 20px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--pc-dark);
    padding: 0 5px;
}

.pc-carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 0 45px;
}

.pc-carousel-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0 15px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.pc-carousel-container::-webkit-scrollbar {
    display: none;
}

.pc-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    border: none;
    color: var(--pc-white);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--pc-transition);
    box-shadow: 0 3px 10px rgba(0, 56, 155, 0.25);
}

.pc-carousel-arrow:hover {
    background: linear-gradient(135deg, var(--pc-primary-dark) 0%, var(--pc-primary) 100%);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 5px 15px rgba(0, 56, 155, 0.35);
}

.pc-carousel-arrow:active {
    transform: translateY(-50%) scale(1.05);
}

.pc-carousel-prev {
    left: 5px;
}

.pc-carousel-next {
    right: 5px;
}

.pc-carousel-arrow:disabled,
.pc-carousel-arrow.hidden {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

.pc-product-card {
    min-width: 200px;
    max-width: 200px;
    width: 200px;
    flex-shrink: 0;
    background: var(--pc-white);
    border: 1px solid var(--pc-gray-lighter);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--pc-transition);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pc-product-card:hover {
    box-shadow: 0 6px 20px rgba(0, 56, 155, 0.15);
    transform: translateY(-4px);
    border-color: var(--pc-primary-light);
}

.pc-product-image {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, var(--pc-gray-lighter) 0%, var(--pc-white) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.pc-product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 56, 155, 0.05) 100%);
    pointer-events: none;
}

.pc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: var(--pc-transition);
}

.pc-product-card:hover .pc-product-image img {
    transform: scale(1.05);
}

.pc-product-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pc-product-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--pc-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

.pc-product-brand {
    margin: 0;
    font-size: 12px;
    color: var(--pc-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pc-product-dimensions {
    margin: 0;
    font-size: 11px;
    color: var(--pc-gray);
    font-weight: 500;
}

.pc-product-price {
    margin: 8px 0 0 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--pc-primary);
    padding-top: 8px;
    border-top: 1px solid var(--pc-gray-lighter);
}

.pc-product-actions {
    padding: 12px 14px;
    display: flex;
    gap: 8px;
    background: var(--pc-gray-lighter);
}

.pc-btn-view,
.pc-btn-add-cart {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--pc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.pc-btn-view {
    background: var(--pc-white);
    color: var(--pc-primary);
    border: 2px solid var(--pc-primary);
}

.pc-btn-view:hover {
    background: var(--pc-primary);
    color: var(--pc-white);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 56, 155, 0.2);
}

.pc-btn-add-cart {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-light) 100%);
    color: var(--pc-white);
    box-shadow: 0 2px 8px rgba(0, 56, 155, 0.25);
}

.pc-btn-add-cart:hover {
    background: linear-gradient(135deg, var(--pc-primary-dark) 0%, var(--pc-primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 56, 155, 0.35);
}

.pc-btn-add-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 480px) {
    .pc-chatbot-container {
        bottom: 10px;
        right: 10px;
    }
    
    .pc-chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        max-width: 380px;
        bottom: 70px;
        right: 0;
    }
    
    .pc-chatbot-toggle {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
    
    .pc-carousel-wrapper {
        padding: 0 40px;
    }
    
    .pc-product-card {
        min-width: 170px;
        max-width: 170px;
        width: 170px;
    }
    
    .pc-product-image {
        height: 120px;
    }
    
    .pc-carousel-container {
        gap: 12px;
    }
    
    .pc-carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .pc-carousel-prev {
        left: 2px;
    }
    
    .pc-carousel-next {
        right: 2px;
    }
}

/* Animation d'ouverture */
@keyframes chatbotOpen {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pc-chatbot-window.active {
    animation: chatbotOpen 0.3s ease;
}

/* Styles pour les liens de produits */
.pc-message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.pc-message-content li {
    margin: 5px 0;
}

.pc-message-content strong {
    font-weight: 600;
    color: var(--pc-primary);
}

.pc-message-user .pc-message-content strong {
    color: var(--pc-white);
}

