/**
 * Jewelry Chat Search - Chatbot Styles
 */

/* Basis Container */
.jcs-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Position Varianten */
.jcs-position-bottom-right .jcs-container,
.jcs-position-bottom-right .jcs-minimized {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.jcs-position-bottom-left .jcs-container,
.jcs-position-bottom-left .jcs-minimized {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
}

.jcs-position-inline .jcs-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Minimierte Ansicht */
.jcs-minimized {
    width: 60px;
    height: 60px;
    background: #FFD700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.jcs-minimized:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Hauptcontainer */
.jcs-container {
    width: 450px;
    max-width: 90vw;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 600px;
}

/* Erweiterte Ansicht */
.jcs-container.jcs-expanded {
    width: 800px;
    max-height: 80vh;
}

@media (min-width: 1200px) {
    .jcs-container.jcs-expanded {
        width: 1200px;
    }
}

/* Header */
.jcs-header {
    background: #FFD700;
    color: #333;
    padding: 10px 15px;
    border-radius: 10px 10px 0 0;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.jcs-header-buttons {
    display: flex;
    gap: 10px;
}

.jcs-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #333;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background 0.2s;
}

.jcs-btn:hover {
    background: rgba(0,0,0,0.1);
}

/* Messages Bereich */
.jcs-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    min-height: 300px;
}

.jcs-position-inline .jcs-messages {
    min-height: 400px;
    max-height: 500px;
}

/* Nachrichten */
.jcs-message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

.jcs-user-message {
    background: #007cba;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.jcs-bot-message {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 5px;
}

/* Loading Animation */
.jcs-loading {
    position: relative;
    color: #999;
}

.jcs-loading::after {
    content: '';
    display: inline-block;
    width: 0;
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

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

/* Input Bereich */
.jcs-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.jcs-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.jcs-input:focus {
    border-color: #007cba;
}

.jcs-send-btn {
    padding: 10px 20px;
    background: #FFD700;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.jcs-send-btn:hover {
    background: #f0c800;
}

/* Produkte Container */
.jcs-products-container {
    width: 100%;
}

.jcs-products-info {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    text-align: center;
}

/* Produkt Grid */
.jcs-products-grid {
    display: grid;
    gap: 15px;
    margin: 15px 0;
    grid-template-columns: 1fr;
}

/* Bei erweiterter Ansicht: Multi-Spalten */
.jcs-expanded .jcs-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Produkt Karte */
.jcs-product {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #fff;
}

.jcs-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #FFD700;
}

.jcs-product-inner {
    height: 100%;
}

.jcs-product-link {
    display: flex;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    height: 100%;
    gap: 12px;
}

.jcs-product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.jcs-product-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.jcs-product-name {
    font-weight: bold;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.jcs-product-material {
    color: #666;
    font-size: 13px;
}

.jcs-product-price {
    color: #007cba;
    font-size: 16px;
    font-weight: 600;
    margin: 4px 0;
}

.jcs-product-size {
    font-size: 13px;
    color: #666;
}

.jcs-product-gemstone {
    font-size: 13px;
    color: #8b4513;
}

.jcs-product-category {
    font-size: 12px;
    color: #999;
    margin-top: auto;
}

/* Load More Button */
.jcs-load-more-btn {
    width: 100%;
    padding: 10px;
    background: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
    font-size: 14px;
}

.jcs-load-more-btn:hover {
    background: #e0e0e0;
}

/* Dark Theme */
.jcs-theme-dark .jcs-container {
    background: #1e1e1e;
    border-color: #444;
    color: #fff;
}

.jcs-theme-dark .jcs-header {
    background: #333;
    color: #FFD700;
}

.jcs-theme-dark .jcs-btn {
    color: #FFD700;
}

.jcs-theme-dark .jcs-bot-message {
    background: #2a2a2a;
    color: #fff;
}

.jcs-theme-dark .jcs-input {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}

.jcs-theme-dark .jcs-product {
    background: #2a2a2a;
    border-color: #444;
}

.jcs-theme-dark .jcs-product-name {
    color: #fff;
}

.jcs-theme-dark .jcs-product-material,
.jcs-theme-dark .jcs-product-size,
.jcs-theme-dark .jcs-product-gemstone {
    color: #bbb;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .jcs-position-bottom-right .jcs-container,
    .jcs-position-bottom-left .jcs-container {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 0;
        max-width: 100%;
        max-height: 100vh;
    }
    
    .jcs-header {
        border-radius: 0;
    }
    
    .jcs-products-grid {
        grid-template-columns: 1fr;
    }
    
    .jcs-expanded .jcs-products-grid {
        grid-template-columns: 1fr;
    }
}

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

.jcs-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

.jcs-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}