/**
 * KI Kamera-Beratung - Futuristisches Frontend Design
 */

/* Wrapper für garantierte Zentrierung */
.kb-widget-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    width: 100% !important;
    padding: 15px !important;
    box-sizing: border-box !important;
}

/* CSS Variables */
.kb-widget {
    --kb-primary: #6366f1;
    --kb-primary-rgb: 99, 102, 241;
    --kb-accent: #22d3ee;
    --kb-accent-rgb: 34, 211, 238;
    --kb-success: #10b981;
    --kb-error: #ef4444;
    --kb-dark: #080814;
    --kb-dark-2: #0f0f1f;
    --kb-dark-3: #16162a;
    --kb-text: #ffffff;
    --kb-text-dim: rgba(255,255,255,0.55);
    --kb-border: rgba(255,255,255,0.08);
    --kb-glow: rgba(99, 102, 241, 0.5);
    --kb-radius: 20px;
    --kb-radius-sm: 10px;
    
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(160deg, var(--kb-dark) 0%, var(--kb-dark-2) 50%, #0a0a18 100%);
    border-radius: var(--kb-radius);
    border: 1px solid var(--kb-border);
    padding: 24px;
    width: 600px !important;
    min-width: 600px !important;
    max-width: 600px !important;
    position: relative;
    overflow: hidden;
    color: var(--kb-text);
    box-shadow: 0 25px 80px rgba(0,0,0,0.5);
    box-sizing: border-box !important;
}

[x-cloak] { display: none !important; }

/* Background Effects */
.kb-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.kb-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
    animation: kb-float 10s ease-in-out infinite;
}

.kb-glow-1 {
    width: 250px;
    height: 250px;
    background: var(--kb-primary);
    top: -100px;
    right: -80px;
}

.kb-glow-2 {
    width: 180px;
    height: 180px;
    background: var(--kb-accent);
    bottom: -80px;
    left: -60px;
    animation-delay: -5s;
}

@keyframes kb-float {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.25; }
    50% { transform: translate(15px, 15px) scale(1.15); opacity: 0.35; }
}

.kb-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* Views & Transitions */
.kb-view {
    position: relative;
    z-index: 1;
    width: 100% !important;
    box-sizing: border-box !important;
}

.kb-slide-in {
    animation: kb-slideIn 0.4s ease-out;
}

.kb-slide-out {
    animation: kb-slideOut 0.3s ease-in;
}

.kb-fade-in {
    animation: kb-fadeIn 0.5s ease-out;
}

@keyframes kb-slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes kb-slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-30px); }
}

@keyframes kb-fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Hero Section */
.kb-hero {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kb-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--kb-accent);
    margin-bottom: 12px;
    position: relative;
}

.kb-ai-badge svg {
    width: 12px;
    height: 12px;
}

.kb-pulse {
    position: absolute;
    left: 10px;
    width: 5px;
    height: 5px;
    background: var(--kb-accent);
    border-radius: 50%;
    animation: kb-pulse 2s infinite;
    box-shadow: 0 0 8px var(--kb-accent);
}

@keyframes kb-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.8); }
}

.kb-headline {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #fff 0%, var(--kb-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.kb-tagline {
    color: var(--kb-text-dim);
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

/* Demo Container */
.kb-demo-container {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--kb-radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    overflow: hidden;
    width: 100% !important;
}

.kb-demo-container .kb-demo-image {
    width: 100% !important;
}

.kb-demo-image {
    position: relative;
    border-radius: var(--kb-radius-sm) var(--kb-radius-sm) 0 0;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--kb-dark-3);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-bottom: none;
}

.kb-demo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kb-demo-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--kb-accent);
    border: 1px solid rgba(34, 211, 238, 0.3);
}

.kb-scan-effect {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.kb-scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--kb-accent), var(--kb-accent), transparent);
    box-shadow: 0 0 30px var(--kb-accent), 0 0 60px var(--kb-accent);
    animation: kb-scan 2.5s ease-in-out infinite;
}

@keyframes kb-scan {
    0%, 100% { top: -3px; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.kb-ai-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.kb-marker {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: kb-markerIn 0.4s ease-out both;
}

.kb-marker-bottom {
    flex-direction: column;
    gap: 4px;
}

.kb-marker-bottom .kb-marker-label {
    order: -1;
}

.kb-marker:nth-child(1) { animation-delay: 0.8s; }
.kb-marker:nth-child(2) { animation-delay: 1.2s; }
.kb-marker:nth-child(3) { animation-delay: 1.6s; }

@keyframes kb-markerIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.kb-marker-pulse {
    width: 10px;
    height: 10px;
    background: var(--kb-accent);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 0 10px var(--kb-accent);
}

.kb-marker-pulse::before {
    content: '';
    position: absolute;
    inset: -3px;
    border: 1.5px solid var(--kb-accent);
    border-radius: 50%;
    animation: kb-ring 1.5s ease-out infinite;
}

@keyframes kb-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

.kb-marker-label {
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}


/* Upload Bar unter dem Demo-Bild */
.kb-upload-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--kb-dark-3);
    border: 1px solid var(--kb-border);
    border-top: none;
    border-radius: 0 0 var(--kb-radius-sm) var(--kb-radius-sm);
    width: 100% !important;
    box-sizing: border-box !important;
}

.kb-upload-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.kb-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--kb-primary) 0%, #8b5cf6 100%);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--kb-primary-rgb), 0.3);
    position: relative;
    overflow: hidden;
}

.kb-upload-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    animation: kb-shimmer 2.5s infinite;
}

.kb-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(var(--kb-primary-rgb), 0.4);
}

.kb-upload-btn svg {
    width: 16px;
    height: 16px;
}

.kb-upload-hint {
    font-size: 12px;
    color: var(--kb-text-dim);
}

.kb-upload-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: var(--kb-text-dim);
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    padding: 8px 14px;
    border-radius: 6px;
    text-align: center;
    line-height: 1.4;
}

.kb-upload-tip svg {
    width: 16px;
    height: 16px;
    color: var(--kb-accent);
    flex-shrink: 0;
}

.kb-upload-tip strong {
    color: var(--kb-accent);
    font-weight: 600;
}

.kb-demo-image.dragging {
    border-color: var(--kb-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--kb-primary-rgb), 0.3), 0 8px 32px rgba(0,0,0,0.3) !important;
}

.kb-demo-image.dragging::after {
    content: 'Bild hier ablegen';
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    z-index: 10;
    border-radius: var(--kb-radius-sm);
}

.kb-file-input {
    display: none;
}

/* Preview Wrapper */
.kb-preview-wrapper {
    margin-bottom: 16px;
    width: 100% !important;
}

.kb-preview-container {
    position: relative;
    border-radius: var(--kb-radius-sm);
    overflow: hidden;
    background: var(--kb-dark-3);
    border: 1px solid var(--kb-border);
}

.kb-preview-img {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    display: block;
}

.kb-preview-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.kb-preview-remove:hover {
    background: var(--kb-error);
    border-color: var(--kb-error);
}

.kb-preview-remove svg {
    width: 14px;
    height: 14px;
}

/* Preview */
.kb-preview-container {
    position: relative;
    border-radius: var(--kb-radius-sm);
    overflow: hidden;
}

.kb-preview-img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    display: block;
}

.kb-preview-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
}

.kb-preview-remove {
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.kb-preview-remove:hover {
    background: var(--kb-error);
}

.kb-preview-remove svg {
    width: 16px;
    height: 16px;
}

/* Main Button */
.kb-action {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.kb-main-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--kb-primary) 0%, #8b5cf6 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kb-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(var(--kb-primary-rgb), 0.4);
}

.kb-main-btn.kb-btn-large {
    width: 100%;
    justify-content: center;
    padding: 16px 32px;
    font-size: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.kb-main-btn.kb-btn-large:hover {
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.kb-btn-icon-left {
    width: 20px;
    height: 20px;
    animation: kb-spin 3s linear infinite;
}

@keyframes kb-spin {
    100% { transform: rotate(360deg); }
}

.kb-btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    animation: kb-shimmer 2s infinite;
}

@keyframes kb-shimmer {
    100% { transform: translateX(100%); }
}

.kb-main-btn svg {
    width: 18px;
    height: 18px;
}

/* Back Button */
.kb-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--kb-text-dim);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.kb-back-btn:hover {
    color: var(--kb-text);
}

.kb-back-btn svg {
    width: 16px;
    height: 16px;
}

/* Section Header */
.kb-section-header {
    text-align: center;
    margin-bottom: 20px;
    width: 100% !important;
}

.kb-icon-circle {
    width: 56px;
    height: 56px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--kb-accent);
}

.kb-icon-circle svg {
    width: 24px;
    height: 24px;
}

.kb-section-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 6px;
}

.kb-section-header p {
    color: var(--kb-text-dim);
    font-size: 14px;
    margin: 0;
}

.kb-hint-multiselect {
    font-size: 12px !important;
    color: var(--kb-text-dim) !important;
}

.kb-hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--kb-accent);
    color: var(--kb-dark);
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    vertical-align: middle;
}

/* Options Liste - vertikal mit Infos */
.kb-options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    width: 100% !important;
}

.kb-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--kb-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: left;
}

.kb-option-row:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
}

.kb-option-row.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--kb-primary);
}

/* Checkbox */
.kb-option-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--kb-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: transparent;
}

.kb-option-checkbox.checked {
    background: var(--kb-success);
    border-color: var(--kb-success);
}

.kb-option-checkbox svg {
    width: 12px;
    height: 12px;
    color: white;
}

/* Icon */
.kb-option-row .kb-option-icon {
    font-size: 20px;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

/* Text Container */
.kb-option-text {
    flex: 1;
    min-width: 0;
}

.kb-option-row .kb-option-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--kb-text);
    margin-bottom: 1px;
}

.kb-option-desc {
    display: block;
    font-size: 11px;
    color: var(--kb-text-dim);
    line-height: 1.3;
}

.kb-option-checkbox svg {
    width: 12px;
    height: 12px;
    color: white;
}

/* Legacy support */
.kb-option-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: var(--kb-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-option-check svg {
    width: 10px;
    height: 10px;
    color: white;
}

/* Form */
.kb-form-minimal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    width: 100% !important;
}

.kb-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.kb-salutation-row {
    grid-template-columns: 120px 1fr 1fr;
}

.kb-salutation-group {
    min-width: 100px;
}

/* Select / Dropdown Styling */
.kb-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: 12px 36px 12px 14px;
    background-color: rgba(255,255,255,0.05) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
    cursor: pointer;
    color: #fff !important;
    border: 1px solid var(--kb-border) !important;
    border-radius: var(--kb-radius-sm);
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}

.kb-select:focus {
    border-color: var(--kb-primary) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.kb-select option {
    background-color: #1a1a2e !important;
    color: #fff !important;
    padding: 10px;
}

.kb-select option:hover,
.kb-select option:checked {
    background-color: #2d2d44 !important;
}

/* Select muss gleiche Höhe wie Input haben */
select.kb-input.kb-select {
    height: auto;
    min-height: 44px;
}

@media (max-width: 480px) {
    .kb-form-row {
        grid-template-columns: 1fr;
    }
    
    .kb-salutation-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .kb-salutation-group {
        grid-column: span 2;
    }
}

.kb-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    color: var(--kb-text);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.kb-input::placeholder {
    color: var(--kb-text-dim);
}

.kb-input:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.kb-input-error {
    border-color: #ef4444 !important;
    animation: kb-shake 0.3s ease;
}

@keyframes kb-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Checkbox Rows */
.kb-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--kb-radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.kb-checkbox-row:hover {
    background: rgba(255,255,255,0.04);
}

.kb-checkbox-row input[type="checkbox"] {
    display: none;
}

.kb-checkmark {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--kb-border);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
    margin-top: 1px;
}

.kb-checkbox-row input:checked + .kb-checkmark {
    background: var(--kb-primary);
    border-color: var(--kb-primary);
}

.kb-checkbox-row input:checked + .kb-checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.kb-checkbox-label {
    font-size: 12px;
    color: var(--kb-text-dim);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.kb-checkbox-label svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.6;
}

.kb-newsletter .kb-checkbox-label {
    color: var(--kb-text-dim);
}

.kb-privacy .kb-checkbox-label {
    color: rgba(255,255,255,0.5);
}

.kb-privacy-link {
    color: var(--kb-primary);
    text-decoration: underline;
    transition: color 0.2s;
}

.kb-privacy-link:hover {
    color: #8183f0;
}

.kb-checkbox-error .kb-checkmark {
    border-color: #ef4444;
    animation: kb-shake 0.3s ease;
}

/* Required hint */
.kb-required-hint {
    text-align: center;
    font-size: 11px;
    color: var(--kb-text-dim);
    margin-top: 8px;
    opacity: 0.6;
}

/* Disabled Button */
.kb-main-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kb-main-btn:disabled:hover {
    transform: none;
}

/* Action Group */
.kb-action-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.kb-skip-btn {
    background: none;
    border: none;
    color: var(--kb-text-dim);
    font-size: 14px;
    cursor: pointer;
    padding: 12px 20px;
    transition: color 0.2s;
}

.kb-skip-btn:hover {
    color: var(--kb-text);
}

.kb-ai-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

/* Analyzing State */
.kb-analyzing {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-analyze-container {
    text-align: center;
}

.kb-analyze-image {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 24px;
}

.kb-analyze-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--kb-radius);
}

.kb-analyze-overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--kb-radius);
    overflow: hidden;
}

.kb-scan-beam {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--kb-accent), var(--kb-accent), transparent);
    box-shadow: 0 0 30px var(--kb-accent);
    animation: kb-scanBeam 2s ease-in-out infinite;
}

@keyframes kb-scanBeam {
    0%, 100% { top: 0; }
    50% { top: calc(100% - 3px); }
}

.kb-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--kb-accent);
    border-style: solid;
}

.kb-corner-tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.kb-corner-tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.kb-corner-bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.kb-corner-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.kb-analyze-ring {
    position: absolute;
    inset: -10px;
    border: 2px solid var(--kb-primary);
    border-radius: calc(var(--kb-radius) + 10px);
    opacity: 0.3;
    animation: kb-ringPulse 2s ease-out infinite;
}

@keyframes kb-ringPulse {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.15); opacity: 0; }
}

.kb-analyze-status {
    position: relative;
}

.kb-ai-brain {
    position: relative;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--kb-accent);
}

.kb-ai-brain svg {
    width: 100%;
    height: 100%;
}

.kb-brain-pulse {
    position: absolute;
    inset: -8px;
    border: 2px solid var(--kb-accent);
    border-radius: 50%;
    animation: kb-brainPulse 1.5s ease-out infinite;
}

@keyframes kb-brainPulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.kb-analyze-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
}

.kb-analyze-message {
    color: var(--kb-text-dim);
    font-size: 14px;
    margin: 0 0 16px;
    min-height: 20px;
}

.kb-progress-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.kb-progress-dots span {
    width: 8px;
    height: 8px;
    background: var(--kb-primary);
    border-radius: 50%;
    animation: kb-dotPulse 1.2s ease-in-out infinite;
}

.kb-progress-dots span:nth-child(2) { animation-delay: 0.2s; }
.kb-progress-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes kb-dotPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* Results */
.kb-results {
    min-height: 300px;
}

/* Error State */
.kb-error-state {
    text-align: center;
    padding: 40px 20px;
}

.kb-error-icon {
    width: 56px;
    height: 56px;
    color: var(--kb-error);
    margin: 0 auto 16px;
}

.kb-error-icon svg {
    width: 100%;
    height: 100%;
}

.kb-error-state h2 {
    font-size: 20px;
    margin: 0 0 8px;
}

.kb-error-state p {
    color: var(--kb-text-dim);
    margin: 0 0 24px;
}

/* Success State */
.kb-success-state {
    animation: kb-fadeIn 0.5s ease-out;
}

.kb-result-header {
    text-align: center;
    margin-bottom: 24px;
}

.kb-success-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--kb-success);
    margin-bottom: 12px;
}

.kb-success-badge svg {
    width: 14px;
    height: 14px;
}

.kb-result-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

/* Ergebnis-Bild (zentriert oben) */
.kb-result-image {
    display: flex;
    justify-content: center;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    margin-bottom: 16px;
}

.kb-result-image img {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* Analysis Box */
.kb-analysis-box {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--kb-radius);
    padding: 16px;
    margin-bottom: 20px;
}

.kb-analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--kb-accent);
}

.kb-analysis-header svg {
    width: 18px;
    height: 18px;
}

.kb-analysis-icon {
    width: 28px;
    height: 28px;
    color: var(--kb-accent);
    flex-shrink: 0;
}

.kb-analysis-icon svg {
    width: 100%;
    height: 100%;
}

.kb-analysis-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
    color: var(--kb-text);
    flex: 1;
}

.kb-analysis-box .kb-analysis-icon {
    display: inline-flex;
}

/* Products */
.kb-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.kb-product-card {
    position: relative;
    display: flex;
    gap: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius);
    padding: 14px;
    transition: all 0.2s;
}

.kb-product-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}

.kb-product-card.kb-rank-1 {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.05);
}

.kb-rank-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 28px;
    height: 28px;
    background: var(--kb-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.kb-rank-1 .kb-rank-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.kb-product-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
    border-radius: var(--kb-radius-sm);
    overflow: hidden;
}

.kb-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kb-product-info {
    flex: 1;
    min-width: 0;
}

.kb-product-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-product-reason {
    font-size: 12px;
    color: var(--kb-text-dim);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kb-product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--kb-accent);
}

.kb-product-price del {
    color: var(--kb-text-dim);
    font-size: 12px;
    font-weight: 400;
}

.kb-product-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--kb-primary);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    transition: background 0.2s;
}

.kb-product-link:hover {
    background: #5558e3;
}

.kb-product-link svg {
    width: 12px;
    height: 12px;
}

/* Feedback */
/* E-Mail Section */
.kb-email-section {
    margin-bottom: 16px;
}

.kb-email-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.kb-email-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.kb-email-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.kb-email-btn svg {
    width: 18px;
    height: 18px;
}

.kb-email-sent {
    text-align: center;
    padding: 14px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    color: var(--kb-success);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Ticket Info */
.kb-ticket-info {
    text-align: center;
    padding: 10px;
    margin-bottom: 12px;
    color: var(--kb-text-dim);
}

.kb-ticket-info strong {
    color: var(--kb-text);
    font-family: monospace;
}

.kb-feedback-section {
    margin-bottom: 16px;
}

.kb-feedback-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--kb-radius-sm);
}

.kb-feedback-bar > span {
    font-size: 13px;
    color: var(--kb-text-dim);
}

.kb-feedback-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.kb-fb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--kb-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--kb-text);
    cursor: pointer;
    transition: all 0.2s;
}

.kb-fb-btn svg {
    width: 16px;
    height: 16px;
}

.kb-fb-yes:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--kb-success);
    color: var(--kb-success);
}

/* Hervorgehobener Help-Button */
.kb-fb-help {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: var(--kb-primary);
    color: var(--kb-primary);
    animation: kb-pulse-help 2s ease-in-out infinite;
}

.kb-fb-help:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: var(--kb-accent);
    color: #fff;
    transform: scale(1.02);
}

@keyframes kb-pulse-help {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(99, 102, 241, 0);
    }
}

/* Help Form */
.kb-help-form {
    padding: 16px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--kb-radius-sm);
}

.kb-help-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--kb-text);
    margin: 0 0 12px;
}

.kb-help-textarea {
    width: 100%;
    padding: 12px;
    background: var(--kb-dark-2);
    border: 1px solid var(--kb-border);
    border-radius: 8px;
    color: var(--kb-text);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.kb-help-textarea:focus {
    outline: none;
    border-color: var(--kb-primary);
}

.kb-help-textarea::placeholder {
    color: var(--kb-text-dim);
}

.kb-help-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

.kb-btn-cancel {
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--kb-border);
    border-radius: 6px;
    color: var(--kb-text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.kb-btn-cancel:hover {
    border-color: var(--kb-text-dim);
    color: var(--kb-text);
}

.kb-btn-send {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--kb-primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.kb-btn-send:hover:not(:disabled) {
    background: #5558e3;
}

.kb-btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kb-btn-send svg {
    width: 14px;
    height: 14px;
}

.kb-feedback-thanks {
    text-align: center;
    color: var(--kb-success);
    font-size: 14px;
    font-weight: 500;
    padding: 12px;
    margin-bottom: 16px;
}

/* Restart Button */
.kb-restart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: none;
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    color: var(--kb-text-dim);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.kb-restart-btn:hover {
    border-color: var(--kb-primary);
    color: var(--kb-text);
}

.kb-restart-btn svg {
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 650px) {
    .kb-widget-wrapper {
        padding: 8px !important;
    }
    
    .kb-widget {
        width: calc(100vw - 16px) !important;
        min-width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        padding: 16px !important;
        border-radius: 14px;
    }
    
    .kb-headline {
        font-size: 22px;
    }
    
    .kb-subline {
        font-size: 12px;
    }
    
    .kb-hero {
        margin-bottom: 16px;
    }
    
    /* Upload Bar Mobile */
    .kb-upload-bar {
        padding: 12px;
        gap: 8px;
    }
    
    .kb-upload-actions {
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }
    
    .kb-upload-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    
    .kb-upload-hint {
        font-size: 11px;
    }
    
    .kb-upload-tip {
        flex-direction: row;
        text-align: center;
        padding: 10px 12px;
        font-size: 10px;
        line-height: 1.4;
    }
    
    .kb-upload-tip svg {
        display: none;
    }
    
    /* Marker Mobile */
    .kb-marker-label {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .kb-marker-pulse {
        width: 8px;
        height: 8px;
    }
    
    .kb-demo-badge {
        font-size: 8px;
        padding: 3px 6px;
    }
    
    .kb-options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .kb-option-card {
        padding: 12px 8px;
    }
    
    .kb-options-grid .kb-option-wrapper:last-child:nth-child(odd) {
        max-width: 70%;
    }
    
    .kb-option-info-panel {
        padding: 8px 10px;
    }
    
    .kb-option-info-panel p {
        font-size: 10px;
    }
    
    .kb-option-icon {
        font-size: 20px;
    }
    
    .kb-option-name {
        font-size: 11px;
    }
    
    .kb-action-group {
        flex-direction: column;
    }
    
    .kb-main-btn {
        width: 100%;
        justify-content: center;
    }
    
    .kb-product-card {
        flex-direction: column;
        text-align: center;
    }
    
    .kb-product-image {
        width: 100%;
        height: 120px;
    }
    
    .kb-product-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .kb-product-link {
        width: 100%;
        justify-content: center;
    }
}

/* Extra Small Screens */
@media (max-width: 380px) {
    .kb-widget {
        padding: 12px;
    }
    
    .kb-headline {
        font-size: 20px;
    }
    
    .kb-ai-badge {
        font-size: 9px;
        padding: 4px 10px;
    }
    
    /* Marker auf sehr kleinen Screens verstecken */
    .kb-ai-markers {
        display: none;
    }
    
    .kb-upload-tip {
        font-size: 9px;
    }
}
