/* ============================================
   AI Product Finder - Complete Styles
   ============================================ */

/* Page Container */
.ai-product-finder-page {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Chat Container */
.ai-chat-container {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 900px;
    margin: 0 auto;
}

/* Messages Container */
.ai-chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fafafa;
    scroll-behavior: smooth;
}

/* Individual Message */
.ai-message {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

.ai-message-user {
    align-items: flex-end;
}

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

/* Message Bubble */
.ai-message-bubble {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 15px;
    word-wrap: break-word;
    line-height: 1.6;
}

.ai-message-user .ai-message-bubble {
    background: linear-gradient(135deg, #D4AF37, #F4D03F);
    color: #1a1a1a;
    border-bottom-right-radius: 5px;
}

.ai-message-assistant .ai-message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Message Time */
.ai-message-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

/* Typing Indicator */
.ai-typing-indicator {
    display: flex;
    gap: 0.4rem;
    padding: 1rem;
    background: white;
    border-radius: 15px;
    width: fit-content;
    border: 1px solid #e0e0e0;
}

.ai-typing-dot {
    width: 8px;
    height: 8px;
    background: #D4AF37;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Chat Form */
.ai-chat-form {
    background: white;
    border-top: 2px solid #e0e0e0;
    padding: 1.25rem;
}

.ai-chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Input Field - HIER IST DAS WICHTIGE! */
.ai-chat-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid #D4AF37;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.ai-chat-input:focus {
    border-color: #F4D03F;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.ai-chat-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Send Button */
.ai-chat-send {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37, #F4D03F);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.ai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chat-send svg {
    color: #1a1a1a;
}

/* Inline Product Cards */
.ai-inline-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.ai-product-card-inline {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1rem;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ai-product-card-inline:hover {
    border-color: #D4AF37;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.ai-product-inline-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

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

.ai-product-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.ai-product-inline-info {
    flex: 1;
}

.ai-product-inline-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.ai-product-inline-manufacturer {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.25rem;
}

.ai-product-inline-price {
    font-weight: 700;
    color: #D4AF37;
    font-size: 1.1rem;
}

.ai-product-inline-arrow svg {
    color: #D4AF37;
}

/* Inline Product Links (in text) */
.ai-inline-product-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #D4AF37, #F4D03F);
    color: #1a1a1a !important;
    border-radius: 15px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-inline-product-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.ai-inline-product-link svg {
    width: 12px;
    height: 12px;
}

/* Tooltip */
.ai-product-tooltip {
    position: fixed;
    background: white;
    border: 2px solid #D4AF37;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 10000;
    max-width: 300px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.ai-product-tooltip.show {
    opacity: 1;
}

.ai-tooltip-title {
    font-weight: 700;
    color: #D4AF37;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.ai-tooltip-content {
    font-size: 0.85rem;
    color: #666;
}

.ai-tooltip-content div {
    margin-bottom: 0.25rem;
}

.ai-tooltip-arrow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #D4AF37;
}

/* Error Message */
.ai-error-message {
    margin: 1rem 0;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-chat-messages {
        height: 400px;
    }

    .ai-message-bubble {
        max-width: 85%;
    }

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

    .ai-chat-input {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
}

/* Scrollbar Styling */
.ai-chat-messages::-webkit-scrollbar {
    width: 8px;
}

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

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

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