/**
 * AI-Powered Chatbot Pro - Frontend CSS
 * 2007-2025 PrestaShop
 */

:root {
    --chatbot-color: #007bff;
    --chatbot-color-dark: #0056b3;
    --chatbot-color-light: #e8f4ff;
    --chatbot-bg: #ffffff;
    --chatbot-text: #333333;
    --chatbot-text-light: #666666;
    --chatbot-border: #e0e0e0;
    --chatbot-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --chatbot-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.2);
    --chatbot-radius: 12px;
    --chatbot-radius-sm: 8px;
    --chatbot-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#fmm-chatbot-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

.fmm-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

.fmm-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

.fmm-chatbot-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbot-color);
    border: none;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    transition: var(--chatbot-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.fmm-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--chatbot-shadow-lg);
}

.fmm-chatbot-toggle:active {
    transform: scale(0.95);
}

.fmm-chatbot-icon,
.fmm-chatbot-close-icon {
    width: 28px;
    height: 28px;
    transition: var(--chatbot-transition);
}

.fmm-chatbot-icon {
    opacity: 1;
}

.fmm-chatbot-close-icon {
    opacity: 0;
    position: absolute;
}

.fmm-chatbot-toggle.active .fmm-chatbot-icon {
    opacity: 0;
}

.fmm-chatbot-toggle.active .fmm-chatbot-close-icon {
    opacity: 1;
}

/* Badge */
.fmm-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fmm-chatbot-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--chatbot-color);
    opacity: 0.6;
    animation: chatbot-pulse 2s infinite;
}

@keyframes chatbot-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.fmm-chatbot-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--chatbot-bg);
    border-radius: var(--chatbot-radius);
    box-shadow: var(--chatbot-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatbot-slide-up 0.3s ease-out;
}

@keyframes chatbot-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fmm-chatbot-bottom-right .fmm-chatbot-window {
    right: 0;
}

.fmm-chatbot-bottom-left .fmm-chatbot-window {
    left: 0;
}

.fmm-chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-color), var(--chatbot-color-dark));
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fmm-chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

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

.fmm-chatbot-header-avatar svg {
    width: 24px;
    height: 24px;
}

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

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

.fmm-chatbot-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    animation: chatbot-blink 2s infinite;
}

@keyframes chatbot-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.fmm-chatbot-header-actions {
    display: flex;
    gap: 4px;
}

.fmm-chatbot-minimize,
.fmm-chatbot-restart,
.fmm-chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chatbot-transition);
    color: white;
}

.fmm-chatbot-minimize:hover,
.fmm-chatbot-restart:hover,
.fmm-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fmm-chatbot-minimize svg,
.fmm-chatbot-restart svg,
.fmm-chatbot-close svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Messages Container
   ======================================== */
.fmm-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

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

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

.fmm-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.fmm-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ========================================
   Messages
   ======================================== */
.fmm-chatbot-message {
    display: flex;
    margin-bottom: 16px;
    animation: chatbot-message-appear 0.3s ease-out;
}

@keyframes chatbot-message-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fmm-chatbot-message-bot {
    justify-content: flex-start;
    gap: 4px;
}

.fmm-chatbot-message-system {
    justify-content: center;
}

.fmm-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--chatbot-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chatbot-color);
}

.fmm-chatbot-message-avatar svg {
    width: 20px;
    height: 20px;
}

.fmm-chatbot-message-content {
    max-width: 75%;
}

.fmm-chatbot-message-user .fmm-chatbot-message-content {
    max-width: 80%;
}

.fmm-chatbot-message-text {
    padding: 12px 16px;
    border-radius: var(--chatbot-radius-sm);
    word-wrap: break-word;
    line-height: 1.5;
}

.fmm-chatbot-message-user .fmm-chatbot-message-text {
    background: var(--chatbot-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.fmm-chatbot-message-bot .fmm-chatbot-message-text {
    background: white;
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fmm-chatbot-message-system .fmm-chatbot-message-text {
    background: rgba(0, 0, 0, 0.05);
    color: var(--chatbot-text-light);
    font-size: 12px;
    text-align: center;
    border-radius: 16px;
    padding: 4px 12px;
}

.fmm-chatbot-message-text a {
    color: inherit;
    text-decoration: underline;
}

.fmm-chatbot-message-time {
    font-size: 12px;
    color: var(--chatbot-text-light);
    margin-top: 4px;
    opacity: 0.7;
}

.fmm-chatbot-message-user .fmm-chatbot-message-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   Typing Indicator
   ======================================== */
.fmm-chatbot-typing {
    padding: 0 20px 10px;
    background: #f8f9fa;
}

.fmm-chatbot-typing-bubble {
    display: inline-flex;
    padding: 12px 16px;
    background: white;
    border-radius: var(--chatbot-radius-sm);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

.fmm-chatbot-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chatbot-text-light);
    animation: chatbot-typing-bounce 1.4s infinite;
}

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

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

@keyframes chatbot-typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

/* ========================================
   Quick Replies
   ======================================== */
.fmm-chatbot-quick-replies {
    padding: 0 20px 10px;
    background: #f8f9fa;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.fmm-chatbot-quick-reply {
    background: white;
    border: 2px solid var(--chatbot-color);
    color: var(--chatbot-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    transition: var(--chatbot-transition);
    font-weight: 500;
}

.fmm-chatbot-quick-reply:hover {
    background: var(--chatbot-color);
    color: white;
}

/* ========================================
   Input Area
   ======================================== */
.fmm-chatbot-input-container {
    background: white;
    border-top: 1px solid var(--chatbot-border);
    padding: 16px 20px;
}

.fmm-chatbot-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fmm-chatbot-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    background: #f8f9fa;
    border-radius: var(--chatbot-radius-sm);
    padding: 8px;
}

.fmm-chatbot-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    max-height: 100px;
    padding: 4px 8px;
    color: var(--chatbot-text);
}

.fmm-chatbot-input:focus {
    outline: none;
}

.fmm-chatbot-input::placeholder {
    color: var(--chatbot-text-light);
}

.fmm-chatbot-send {
    background: var(--chatbot-color);
    border: none;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chatbot-transition);
    color: white;
}

.fmm-chatbot-send:hover:not(:disabled) {
    background: var(--chatbot-color-dark);
    transform: scale(1.05);
}

.fmm-chatbot-send:active {
    transform: scale(0.95);
}

.fmm-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fmm-chatbot-send svg {
    width: 20px;
    height: 20px;
}

.fmm-chatbot-input-footer {
    display: flex;
    justify-content: center;
}

.fmm-chatbot-powered {
    font-size: 11px;
    color: var(--chatbot-text-light);
    opacity: 0.7;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .fmm-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
    }
}

@media (max-width: 480px) {
    #fmm-chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .fmm-chatbot-toggle {
        width: 56px;
        height: 56px;
    }

    .fmm-chatbot-window {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 0;
    }

    .fmm-chatbot-message-content {
        max-width: 85%;
    }
}

/* ========================================
   Accessibility & Utilities
   ======================================== */
.fmm-chatbot-toggle:focus,
.fmm-chatbot-send:focus,
.fmm-chatbot-minimize:focus,
.fmm-chatbot-close:focus,
.fmm-chatbot-quick-reply:focus {
    outline: 2px solid var(--chatbot-color);
    outline-offset: 2px;
}

.fmm-chatbot-input:focus {
    outline: none;
}

/* Hidden state */
[style*="display: none"] {
    display: none !important;
}

/* Print */
@media print {
    #fmm-chatbot-container {
        display: none !important;
    }
}

/* ========================================
   Greeting Bubble
   ======================================== */
.fmm-chatbot-greeting-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    padding: 12px 16px;
    border-radius: var(--chatbot-radius);
    box-shadow: var(--chatbot-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 280px;
    animation: chatbot-slide-up 0.3s ease-out;
    z-index: 1000;
}

.fmm-chatbot-bottom-left .fmm-chatbot-greeting-bubble {
    right: auto;
    left: 0;
}

.fmm-chatbot-greeting-text {
    font-size: 11px;
    color: var(--chatbot-text);
    line-height: 1.4;
}

.fmm-chatbot-greeting-close {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--chatbot-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--chatbot-transition);
}

.fmm-chatbot-greeting-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--chatbot-text);
}

.fmm-chatbot-greeting-close svg {
    width: 16px;
    height: 16px;
}

/* Arrow for bubble */
.fmm-chatbot-greeting-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 24px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.05);
}

.fmm-chatbot-bottom-left .fmm-chatbot-greeting-bubble::after {
    right: auto;
    left: 24px;
}

/* ========================================
   Product Cards
   ======================================== */
.fmm-product-card {
    background: #fff;
    border: 1px solid var(--chatbot-border);
    border-radius: var(--chatbot-radius-sm);
    padding: 0;
    margin-top: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.2s;
}

.fmm-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.fmm-product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fmm-product-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--chatbot-border);
}

.fmm-product-card-info {
    padding: 10px;
}

.fmm-product-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--chatbot-text);
    line-height: 1.4;
}

.fmm-chatbot-show-more {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background: var(--chatbot-color-light);
    color: var(--chatbot-color);
    border: none;
    border-radius: var(--chatbot-radius-sm);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: var(--chatbot-transition);
}

.fmm-chatbot-show-more:hover {
    background: var(--chatbot-color);
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Social Links Buttons
   ======================================== */
.fmm-chatbot-social-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    margin: 4px 12px 12px;
}

.fmm-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    color: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fmm-social-btn svg {
    width: 14px;
    height: 14px;
}

.fmm-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.fmm-whatsapp {
    background-color: #25d366;
}

.fmm-messenger {
    background-color: #0084ff;
}

.fmm-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
/* ========================================
   Modal System
   ======================================== */
.fmm-chatbot-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: var(--chatbot-radius);
    padding: 20px;
    animation: chatbot-fade-in 0.2s ease;
}

.fmm-chatbot-modal {
    background: white;
    border-radius: var(--chatbot-radius);
    width: 100%;
    max-width: 280px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: chatbot-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fmm-chatbot-modal-content {
    margin-bottom: 24px;
    text-align: center;
}

.fmm-chatbot-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--chatbot-text);
}

.fmm-chatbot-modal-message {
    font-size: 14px;
    color: var(--chatbot-text-light);
    line-height: 1.5;
}

.fmm-chatbot-modal-actions {
    display: flex;
    gap: 12px;
}

.fmm-chatbot-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--chatbot-transition);
    border: none;
}

.fmm-chatbot-btn-primary {
    background: var(--chatbot-color);
    color: white;
}

.fmm-chatbot-btn-primary:hover {
    background: var(--chatbot-color-dark);
}

.fmm-chatbot-btn-secondary {
    background: #f1f3f5;
    color: var(--chatbot-text-light);
}

.fmm-chatbot-btn-secondary:hover {
    background: #e9ecef;
}

@keyframes chatbot-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes chatbot-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
