/* =====================================================
   PRODUCT ASSISTANT CHATBOT STYLES
   Daniel's Jewelers - Brand Colors
   Primary: #573285 (Purple)
   Secondary: #D4AF37 (Gold)
   ===================================================== */

/* Floating Chat Button */
.chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #573285 0%, #7b4ba8 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(87, 50, 133, 0.4);
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(87, 50, 133, 0.5);
}

.chatbot-trigger svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chatbot-trigger .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #D4AF37;
    color: #333;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Chat Window Container */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 550px;
    max-height: calc(100vh - 150px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    overflow: hidden;
}

.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-window.minimized {
    height: 60px;
    min-height: 60px;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #573285 0%, #7b4ba8 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

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

.chatbot-avatar svg {
    width: 20px;
    height: 20px;
    fill: white;
}

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

.chatbot-title span {
    font-size: 12px;
    opacity: 0.8;
}

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

.chatbot-header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.chatbot-header-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.chatbot-window.minimized .chatbot-messages {
    display: none;
}

/* Message Bubbles */
.chatbot-message {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: messageSlideIn 0.3s ease;
}

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

.chatbot-message.bot {
    align-self: flex-start;
}

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

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

.chatbot-message.user .chatbot-message-avatar {
    background: #D4AF37;
}

.chatbot-message-avatar svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.chatbot-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chatbot-message.user .chatbot-message-content {
    background: #573285;
    color: white;
}

.chatbot-message.bot .chatbot-message-content {
    border-bottom-left-radius: 4px;
}

.chatbot-message.user .chatbot-message-content {
    border-bottom-right-radius: 4px;
}

.chatbot-message-text {
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-message-text a {
    color: #573285;
    text-decoration: underline;
}

.chatbot-message.user .chatbot-message-text a {
    color: #D4AF37;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #573285;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.chatbot-typing span:nth-child(1) { animation-delay: 0s; }
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Product Card in Chat */
.chatbot-product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    transition: box-shadow 0.2s;
}

.chatbot-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chatbot-product-image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    background: #f5f5f5;
    padding: 8px;
}

.chatbot-product-info {
    padding: 12px;
}

.chatbot-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chatbot-product-sku {
    font-size: 11px;
    color: #666;
    margin: 0 0 8px 0;
}

.chatbot-product-price {
    font-size: 15px;
    font-weight: 700;
    color: #573285;
    margin: 0;
}

.chatbot-product-price .sale {
    color: #e53935;
}

.chatbot-product-price .original {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 400;
}

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

.chatbot-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.chatbot-badge.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.chatbot-badge.low-stock {
    background: #fff3e0;
    color: #ef6c00;
}

.chatbot-badge.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

.chatbot-badge.online {
    background: #e3f2fd;
    color: #1565c0;
}

.chatbot-product-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.chatbot-product-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.chatbot-product-btn.primary {
    background: #573285;
    color: white;
}

.chatbot-product-btn.primary:hover {
    background: #472a6e;
}

.chatbot-product-btn.secondary {
    background: #f0f0f0;
    color: #333;
}

.chatbot-product-btn.secondary:hover {
    background: #e0e0e0;
}

/* Product Grid in Chat */
.chatbot-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.chatbot-products-grid .chatbot-product-card {
    margin-top: 0;
}

.chatbot-products-grid .chatbot-product-image {
    height: 80px;
}

.chatbot-products-grid .chatbot-product-info {
    padding: 8px;
}

.chatbot-products-grid .chatbot-product-name {
    font-size: 11px;
    -webkit-line-clamp: 1;
}

.chatbot-products-grid .chatbot-product-price {
    font-size: 13px;
}

/* Quick Actions / Suggestions */
.chatbot-suggestions {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.chatbot-window.minimized .chatbot-suggestions {
    display: none;
}

.chatbot-suggestions-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
}

.chatbot-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chatbot-suggestion-btn {
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-suggestion-btn:hover {
    background: #573285;
    border-color: #573285;
    color: white;
}

/* Input Area */
.chatbot-input-area {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-window.minimized .chatbot-input-area {
    display: none;
}

.chatbot-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #573285;
}

.chatbot-input::placeholder {
    color: #999;
}

.chatbot-send-btn {
    width: 42px;
    height: 42px;
    background: #573285;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.chatbot-send-btn:hover {
    background: #472a6e;
    transform: scale(1.05);
}

.chatbot-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.chatbot-send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Show More Button */
.chatbot-show-more {
    background: none;
    border: 1px dashed #573285;
    color: #573285;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 8px;
    width: 100%;
    transition: all 0.2s;
}

.chatbot-show-more:hover {
    background: #573285;
    color: white;
    border-style: solid;
}

/* Error Message */
.chatbot-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 8px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 60px);
        max-height: none;
        border-radius: 16px 16px 0 0;
    }

    .chatbot-trigger {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .chatbot-products-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}
