/* AI Shopping Chatbot Widget Styles - Minimalist Modern */
.ai-shopping-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ai-chat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    /* background and color set via inline styles from admin config */
    color: #ffffff;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.ai-chat-toggle:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.ai-chat-toggle.active {
    /* background set via inline styles from admin config */
    color: #ffffff;
}

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

.ai-chat-toggle svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    transition: all 0.3s ease;
    
}

.ai-chatbot {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 445px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInUp 0.3s ease;
    z-index: 9998;
}

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

.ai-chat-header {
    /* background set via inline styles from admin config */
    color: #ffffff;
    padding: 13px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

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

.ai-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.ai-status {
    font-size: 13px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
}

.ai-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.ai-chat-minimize {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    /* color set via inline styles from admin config */
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    font-weight: 300;
}

.ai-chat-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-chat-messages {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    background: #b9b9b933;
    height: 320px;
    min-height: 320px;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

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

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

.ai-message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

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

.ai-avatar-small {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-message-content {
    flex: 1;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 14px;
}

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

.ai-message.ai-user .ai-message-content {
    /* background and color set via inline styles from admin config */
    border-bottom-right-radius: 6px;
    max-width: 75%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.ai-message.ai-assistant {
    align-items: flex-start;
}

.ai-message.ai-assistant .ai-message-content {
    /* background and color set via inline styles from admin config */
    border-bottom-left-radius: 6px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ai-message-content p {
    margin: 0 0 10px 0;
}

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

.ai-message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ai-message-content li {
    margin: 5px 0;
}

/* Cancellation message styling */
.ai-message-content.cancellation-message {
    opacity: 0.7;
    font-style: italic;
    font-size: 13px;
}

/* Typing cursor animation */
.typing-cursor {
    display: inline-block;
    width: 2px;
    margin-left: 2px;
    animation: blink 0.7s infinite;
    color: inherit;
}

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

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

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.ai-products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.ai-product-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ai-product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #e5e5e5;
}

.ai-product-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.ai-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-product-info {
    flex: 1;
    min-width: 0;
}

.ai-product-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-product-price {
    color: #667eea;
    font-weight: 700;
    font-size: 15px;
    margin: 0;
}

.ai-product-desc {
    color: #6b7280;
    font-size: 12px;
    margin: 6px 0 0 0;
    line-height: 1.4;
}

.ai-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 6px 0;
    font-size: 14px;
}

.ai-product-rating .star {
    color: #fbbf24;
    font-size: 14px;
}

.ai-product-rating .star.filled {
    color: #f59e0b;
}

.ai-product-rating .rating-text {
    color: #6b7280;
    font-size: 11px;
    margin-left: 4px;
}

.ai-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.ai-product-badges .badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ai-product-badges .badge.free-delivery {
    background: #dcfce7;
    color: #15803d;
}

.ai-product-badges .badge.popular {
    background: #fef3c7;
    color: #b45309;
}

.ai-product-delivery {
    color: #6b7280;
    font-size: 11px;
    margin: 6px 0 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-product-arrow {
    flex-shrink: 0;
    color: #9ca3af;
    transition: all 0.2s;
}

.ai-product-item:hover .ai-product-arrow {
    color: #667eea;
    transform: translateX(2px);
}

.ai-chat-input-wrapper {
    display: flex;
    padding: 3px 24px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    gap: 12px;
    align-items: center;
}

.ai-chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #fafafa;
}

.ai-chat-input:focus {
    border-color: #1a1a1a;
    background: #ffffff;
}

.ai-chat-send {
    /* background and color set via inline styles from admin config */
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-chat-send:hover {
    /* background set via inline styles with opacity */
    transform: translateY(-1px);
}

.ai-chat-send:active {
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-shopping-widget {
        right: 10px;
        bottom: 10px;
    }
    
    .ai-chat-toggle {
        width: 56px;
        height: 56px;
    }
    
    .ai-chatbot {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        right: 10px;
        bottom: 70px;
        left: auto;
        max-width: none;
        border-radius: 16px;
    }

    .ai-chat-messages {
        height: calc(100vh - 250px);
        min-height: 250px;
        
    }

    .ai-chat-header {
        padding: 12px 16px;
    }

    .ai-header-text h3 {
        font-size: 15px;
    }

    .ai-message {
        margin-bottom: 12px;
    }

    .ai-message-content {
        font-size: 14px;
    }

    .ai-message-content p {
        margin: 0 0 8px 0;
    }

    .ai-message-content ul {
        padding-left: 20px;
    }

    .ai-message-content li {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .ai-product-item {
        padding: 10px;
    }

    .ai-product-image {
        width: 50px;
        height: 50px;
    }
    
    .ai-product-info h4 {
        font-size: 13px;
    }
    
    .ai-product-price {
        font-size: 14px;
    }

    .ai-chat-input {
        font-size: 14px;
        padding: 10px 16px;
    }

    .ai-chat-send {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .ai-chatbot {
        width: 100vw;
        height: 95vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
        max-height: none;
    }

    .ai-chat-messages {
        height: calc(100vh - 180px);
        padding: 12px 12px;
    }

    .ai-shopping-widget {
        right: 15px;
        bottom: 15px;
    }
}
