/* Parts Helper Chat Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    max-height: 800px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 20px;
    text-align: center;
}

.chat-header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.chat-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: #2563eb;
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
}

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

.bot-message .message-content {
    background: #f3f4f6;
    color: #1f2937;
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
}

.bot-message .message-content ul {
    margin: 10px 0 0 20px;
}

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

/* Product Cards */
.products-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 12px;
    transition: box-shadow 0.2s;
}

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

.product-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f9fafb;
    border-radius: 4px;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
    margin-bottom: 4px;
}

.product-sku {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.product-price {
    font-weight: 600;
    color: #059669;
    font-size: 0.9rem;
}

.product-link {
    display: inline-block;
    margin-top: 8px;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.product-link:hover {
    text-decoration: underline;
}

/* Category Suggestions */
.category-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.category-button {
    background: #e0e7ff;
    color: #3730a3;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.category-button:hover {
    background: #c7d2fe;
}

/* Chat Input */
.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}

.chat-form {
    display: flex;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#userInput:focus {
    border-color: #2563eb;
}

#userInput:disabled {
    background: #f3f4f6;
}

#sendButton {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 80px;
}

#sendButton:hover:not(:disabled) {
    background: #1d4ed8;
}

#sendButton:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

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

.clear-button {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 8px;
    padding: 4px 8px;
}

.clear-button:hover {
    color: #ef4444;
}

/* Clarifying Questions */
.clarifying-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.question-button {
    background: #fef3c7;
    color: #92400e;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.question-button:hover {
    background: #fde68a;
}

/* Loading Message */
.loading-message .message-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .chat-container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    .product-card {
        flex-direction: column;
    }

    .product-image {
        width: 100%;
        height: 100px;
    }
}

