/* WooCommerce AI Chatbot Styles */

/* Chatbot Toggle Button */
.wc-chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.wc-chatbot-toggle-hidden {
    display: none;
}

/* Chatbot Container */
#wc-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#wc-chatbot-container.wc-chatbot-open {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

#wc-chatbot-container.wc-chatbot-minimized {
    display: none;
}

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

/* Chatbot Header */
#wc-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.wc-chatbot-title {
    font-size: 16px;
    font-weight: 600;
}

.wc-chatbot-controls {
    display: flex;
    gap: 8px;
}

.wc-chatbot-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.wc-chatbot-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

#wc-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

#wc-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Message Styles */
.wc-chatbot-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

.wc-chatbot-bot-message {
    justify-content: flex-start;
}

.wc-chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.wc-chatbot-message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.wc-chatbot-user-message .wc-chatbot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.wc-chatbot-bot-message .wc-chatbot-message-content {
    background: white;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wc-chatbot-bot-message .wc-chatbot-message-content a {
    color: #667eea;
    text-decoration: underline;
}

.wc-chatbot-bot-message .wc-chatbot-message-content a:hover {
    color: #764ba2;
}

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

.wc-chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e0;
    animation: typing 1.4s infinite;
}

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

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

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

/* Products Container */
.wc-chatbot-products-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
    width: 100%;
}

.wc-chatbot-product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.wc-chatbot-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: #667eea;
}

.wc-chatbot-product-card.out-of-stock {
    opacity: 0.6;
}

.wc-chatbot-product-top {
    display: flex;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
}

.wc-chatbot-product-image {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #f7fafc;
}

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

.wc-chatbot-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.wc-chatbot-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wc-chatbot-product-sku {
    display: none;
}

.wc-chatbot-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-top: 4px;
}

.wc-chatbot-product-stock {
    font-size: 11px;
    color: #48bb78;
    font-weight: 500;
}

.wc-chatbot-product-stock.out-of-stock {
    color: #f56565;
}

.wc-chatbot-product-actions {
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.wc-chatbot-add-to-cart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wc-chatbot-add-to-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.wc-chatbot-add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wc-chatbot-add-to-cart.wc-chatbot-added {
    background: #48bb78;
}

/* Action Buttons */
.wc-chatbot-action-buttons {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.wc-chatbot-action-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wc-chatbot-action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.wc-chatbot-action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.wc-chatbot-action-btn.secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.wc-chatbot-action-btn.secondary:hover {
    background: #f7fafc;
}

/* Suggestions */
.wc-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.wc-chatbot-suggestions-label {
    width: 100%;
    font-size: 12px;
    color: #718096;
    font-weight: 600;
    margin-bottom: 4px;
}

.wc-chatbot-suggestion {
    background: white;
    border: 1px solid #e2e8f0;
    color: #667eea;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wc-chatbot-suggestion:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Input Container */
#wc-chatbot-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

#wc-chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#wc-chatbot-input:focus {
    border-color: #667eea;
}

#wc-chatbot-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#wc-chatbot-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    #wc-chatbot-container {
        width: calc(100% - 40px);
        height: calc(100% - 40px);
        max-height: 600px;
    }

    .wc-chatbot-toggle {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    #wc-chatbot-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    #wc-chatbot-header {
        border-radius: 0;
    }
}
