/**
 * Chatbot Cards - Base Styles
 *
 * ✅ KONSISTENT MIT SUMA THEME DESIGN SYSTEM
 * Nutzt gleiche Card-Styles wie News/Events/Store Widgets
 *
 * @package SMG_Mall
 * @since 2.1.0
 */

/* ========================================
   CSS VARIABLES - KONSISTENT MIT WIDGETS
   ======================================== */

:root {
    /* Card Spacing - Wie Bento & News Widgets */
    --chatbot-card-gap: clamp(0.75rem, 2vw, 1rem);
    --chatbot-card-padding: clamp(1rem, 3vw, 1.25rem);

    /* Border Radius - Wie News/Events Cards */
    --chatbot-card-radius: clamp(12px, 2.5vw, 16px);
    --chatbot-card-radius-sm: clamp(6px, 1.5vw, 8px);

    /* Glassmorphism - Wie Bento Cards */
    --chatbot-glass-bg: rgba(255, 255, 255, 0.85);
    --chatbot-glass-border: rgba(255, 255, 255, 0.3);
    --chatbot-glass-blur: 20px;

    /* Shadows - Wie News/Events Cards */
    --chatbot-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.02);
    --chatbot-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --chatbot-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --chatbot-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);

    /* Transitions - Wie alle Widgets */
    --chatbot-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --chatbot-transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Card Container
   ======================================== */

.chatbot-cards {
    display: flex;
    flex-direction: column;
    gap: var(--chatbot-card-gap);
    margin-top: var(--space-8, 2rem);
    margin-bottom: var(--space-4, 1rem);

    /* Smooth Fade-In Animation */
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
}

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

.chatbot-cards__header {
    display: flex;
    align-items: center;
    gap: var(--space-3, 0.75rem);
    margin-bottom: var(--space-4, 1rem);
}

.chatbot-cards__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(227, 30, 36, 0.08);
    color: var(--smg-500, #e31e24);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 8px;
    border: 1px solid rgba(227, 30, 36, 0.15);
}

.chatbot-cards__badge-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.chatbot-cards__title {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
    color: var(--smg-gray-700, #374151);
}

/* ========================================
   Card Slider - KONSISTENT MIT WIDGETS
   ======================================== */

.chatbot-cards__slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--chatbot-card-gap);
    padding-bottom: var(--space-2, 0.5rem);
    max-width: 100%;
}

/* Einzelne Card: Max 400px Breite */
.chatbot-cards__slider:has(.chatbot-card:only-child) {
    grid-template-columns: minmax(280px, 400px);
}

/* 2 Cards: Max 400px pro Card */
.chatbot-cards__slider:has(.chatbot-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(280px, 400px));
}

/* Ab 3+ Cards: Slider-Modus mit Drag */
.chatbot-cards__slider--many {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.chatbot-cards__slider--many:active {
    cursor: grabbing;
}

/* Scrollbar Styling - Wie Widgets */
.chatbot-cards__slider::-webkit-scrollbar {
    height: 6px;
}

.chatbot-cards__slider::-webkit-scrollbar-track {
    background: var(--smg-gray-100, #f3f4f6);
    border-radius: 3px;
}

.chatbot-cards__slider::-webkit-scrollbar-thumb {
    background: var(--smg-gray-300, #d1d5db);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.chatbot-cards__slider::-webkit-scrollbar-thumb:hover {
    background: var(--smg-500, #e31e24);
}

/* ========================================
   Base Card - KONSISTENT MIT NEWS/EVENTS/STORE CARDS
   ======================================== */

.chatbot-card {
    /* Layout - Gleiche Höhe für alle Cards */
    flex: 0 0 280px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    height: 420px; /* Feste Höhe für alle Cards */

    /* Glassmorphism - Wie Bento Cards */
    background: var(--chatbot-glass-bg);
    backdrop-filter: blur(var(--chatbot-glass-blur));
    border: 1px solid var(--chatbot-glass-border);
    border-radius: var(--chatbot-card-radius);

    /* Shadows - Wie News/Events Cards */
    box-shadow:
        var(--chatbot-shadow-md),
        var(--chatbot-shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);

    /* Interaction */
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: var(--chatbot-transition);
    transform-style: preserve-3d;

    /* Staggered Animation */
    opacity: 0;
    animation: fadeInCard 0.3s ease-out forwards;
}

/* Glassmorphism Shine Effect - Wie Bento Cards */
.chatbot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.chatbot-card:hover::before {
    opacity: 1;
}

/* Staggered Animation Delays */
.chatbot-card:nth-child(1) { animation-delay: 0.05s; }
.chatbot-card:nth-child(2) { animation-delay: 0.1s; }
.chatbot-card:nth-child(3) { animation-delay: 0.15s; }
.chatbot-card:nth-child(4) { animation-delay: 0.2s; }
.chatbot-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hover Effect - Wie News/Events Cards */
.chatbot-card:hover {
    transform: translateY(-4px);
    box-shadow:
        var(--chatbot-shadow-hover),
        0 8px 20px rgba(var(--smg-500-rgb, 227, 30, 36), 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-color: rgba(var(--smg-500-rgb, 227, 30, 36), 0.2);
}

/* ========================================
   Card Components - KONSISTENT MIT WIDGETS
   ======================================== */

.chatbot-card__image {
    width: 100%;
    height: 160px; /* Feste Höhe für alle Bilder */
    object-fit: cover;
    object-position: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-card:hover .chatbot-card__image {
    transform: scale(1.05);
}

.chatbot-card__content {
    padding: var(--chatbot-card-padding);
    flex: 1; /* Nimmt verfügbaren Platz ein */
    display: flex;
    flex-direction: column;
    gap: 12px; /* Fester Abstand */
    position: relative;
    z-index: 2;
    min-height: 0; /* Wichtig für flex-shrink */
}

.chatbot-card__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--smg-gray-900, #111827);
    margin: 0;
    height: 42px; /* Feste Höhe für 2 Zeilen */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chatbot-card__meta {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Fester Abstand */
    font-size: 13px;
    color: var(--smg-gray-600, #4b5563);
    margin-top: auto;
    min-height: 80px; /* Mindesthöhe für 3 Meta-Items */
}

.chatbot-card__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
    min-height: 20px; /* Feste Mindesthöhe pro Item */
}

.chatbot-card__meta-icon {
    font-size: 1em;
    flex-shrink: 0;
}

.chatbot-card__description {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    line-height: 1.6;
    color: var(--smg-gray-700, #374151);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   Card Badge/Tag
   ======================================== */

.chatbot-card__badge {
    position: absolute;
    top: var(--space-2, 0.5rem);
    right: var(--space-2, 0.5rem);
    padding: var(--space-1, 0.25rem) var(--space-2, 0.5rem);
    background: var(--smg-500, #e31e24);
    color: white;
    font-size: var(--text-xs, 0.75rem);
    font-weight: var(--font-weight-medium, 500);
    border-radius: var(--radius-sm, 0.375rem);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .chatbot-card {
        flex: 0 0 240px;
        min-height: 340px; /* Gleiche Höhe auch auf Mobile */
    }

    .chatbot-card__image {
        height: 140px;
    }

    .chatbot-card__content {
        padding: 12px 16px;
    }
}

