.design-workflow-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 3rem;
    padding: 0 2rem;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 2rem;
    right: 2rem;
    height: 2px;
    background: #e0e0e0;
    z-index: -1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
}

.step-label {
    margin-top: 0.5rem;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.step.active .step-number {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-number {
    background: var(--color-success);
    color: white;
}

/* Workflow Sections */
.workflow-section {
    animation: fadeIn 0.5s ease;
}

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

/* Furniture List */
.furniture-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.furniture-item {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    cursor: pointer;
}

.furniture-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.furniture-item.selected {
    border-color: var(--color-success);
    background: #f0f9ff;
}

.furniture-info {
    display: flex;
    flex-direction: column;
}

.furniture-name {
    font-weight: 600;
    font-size: 16px;
}

.furniture-category {
    font-size: 12px;
    color: #666;
}

.furniture-checkbox {
    width: 24px;
    height: 24px;
}

/* Style Grid */
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.style-card {
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.style-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.style-card.selected {
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(var(--color-success-rgb), 0.25), 0 4px 16px rgba(0,0,0,0.1);
}

.style-card.selected::after {
    content: '\f26e';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--color-success);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
}

.style-card {
    position: relative;
}

.style-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

/* Gradient-Placeholder wenn kein Titelbild vorhanden */
.style-card-placeholder {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    font-size: 2.5rem;
}

.style-card-body {
    padding: 1rem;
}

.style-card-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 0.25rem;
}

.style-card-desc {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.style-card-badge {
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
    display: inline-block;
}

.style-card-surfaces {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

/* Hinweis unter den Stil-Karten */
.style-selection-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
}

.style-selection-hint i {
    color: var(--color-primary);
    font-size: 1.1rem;
}

/* Loading-Indikator für Oberflächen-Laden */
.surface-loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    color: #6c757d;
    font-size: 0.95rem;
    animation: fadeInUp 0.3s ease;
}

/* Chat Container */
.chat-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
}

.chat-history {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    max-width: 80%;
}

.chat-message.user {
    background: var(--color-primary);
    color: white;
    margin-left: auto;
}

.chat-message.ai {
    background: #e9ecef;
    color: #333;
}

.chat-form {
    display: flex;
    gap: 0.5rem;
}

.chat-form input {
    flex: 1;
}

/* ===================================
   PREMIUM LOADING OVERLAY WITH WAVES
   =================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
    /* GPU-Optimierung: Isoliert Animationen vom Rest des DOM */
    contain: layout style paint;
    isolation: isolate;
}

/* Wave Container */
.wave-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    /* GPU-Optimierung: Strenge Containment für Animationen */
    contain: strict;
}

/* Individual Waves */
.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background-repeat: repeat-x;
    transform-origin: center bottom;
    /* GPU-Optimierung: Verhindert Layout-Jitter bei Animationen */
    will-change: transform;
    backface-visibility: hidden;
}

.wave-1 {
    background: linear-gradient(180deg, transparent 50%, rgba(79, 172, 254, 0.15) 100%);
    animation: wave-animation 8s ease-in-out infinite;
    bottom: -10%;
    height: 120%;
}

.wave-2 {
    background: linear-gradient(180deg, transparent 40%, rgba(0, 242, 254, 0.12) 100%);
    animation: wave-animation 10s ease-in-out infinite reverse;
    animation-delay: -2s;
    bottom: -5%;
    height: 110%;
}

.wave-3 {
    background: linear-gradient(180deg, transparent 60%, rgba(102, 126, 234, 0.1) 100%);
    animation: wave-animation 12s ease-in-out infinite;
    animation-delay: -4s;
    bottom: 0;
    height: 100%;
}

@keyframes wave-animation {
    0%, 100% {
        transform: translateX(0) translateY(0) scaleY(1);
    }
    25% {
        transform: translateX(-5%) translateY(-3%) scaleY(1.05);
    }
    50% {
        transform: translateX(-10%) translateY(0) scaleY(1);
    }
    75% {
        transform: translateX(-5%) translateY(3%) scaleY(0.95);
    }
}

/* SVG Wave Animation */
.wave-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 200px;
    animation: wave-move 6s linear infinite;
    /* GPU-Optimierung: Smooth SVG-Animationen */
    will-change: transform;
    contain: layout style;
}

.wave-svg.wave-back {
    opacity: 0.3;
    animation-duration: 8s;
    animation-direction: reverse;
}

.wave-svg.wave-mid {
    opacity: 0.5;
    animation-duration: 6s;
    bottom: 20px;
}

.wave-svg.wave-front {
    opacity: 0.8;
    animation-duration: 4s;
    bottom: 40px;
}

@keyframes wave-move {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Floating Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* GPU-Optimierung: Isoliert Particle-Animationen */
    contain: strict;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float-particle 15s infinite;
    /* GPU-Optimierung: Verhindert Jitter bei Particle-Bewegung */
    will-change: transform, opacity;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 14s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 16s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 13s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 15s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 11s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2.5s; animation-duration: 14s; }
.particle:nth-child(8) { left: 80%; animation-delay: 0.5s; animation-duration: 16s; }
.particle:nth-child(9) { left: 90%; animation-delay: 3.5s; animation-duration: 12s; }

@keyframes float-particle {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Loading Content */
.loading-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

/* Animated Logo/Icon */
.loading-icon {
    width: 120px;
    height: 120px;
    position: relative;
    margin-bottom: 2rem;
}

.loading-icon-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: #4facfe;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    /* GPU-Optimierung: Smooth Rotation ohne Jitter */
    will-change: transform;
}

.loading-icon-ring:nth-child(2) {
    width: 85%;
    height: 85%;
    top: 7.5%;
    left: 7.5%;
    border-top-color: #00f2fe;
    animation-duration: 2s;
    animation-direction: reverse;
}

.loading-icon-ring:nth-child(3) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: #667eea;
    animation-duration: 2.5s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-icon-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #fff;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.8;
        text-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 30px rgba(79, 172, 254, 0.8), 0 0 60px rgba(0, 242, 254, 0.4);
    }
}

/* Loading Text */
.loading-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.loading-status {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    /* GPU-Optimierung: Feste Höhe für 2 Zeilen verhindert CLS bei Textwechsel */
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

/* Progress Bar */
.loading-progress {
    width: 280px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 50%, #667eea 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    /* GPU-Optimierung: scaleX() statt width-Animation (keine Layout-Reflows) */
    width: 100%;
    transform: scaleX(0.3);
    transform-origin: left center;
    animation: progress-shine 2s linear infinite, progress-scale 3s ease-in-out infinite;
    will-change: transform;
}

@keyframes progress-shine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* GPU-Optimierung: Transform statt Width-Animation */
@keyframes progress-scale {
    0%, 100% { transform: scaleX(0.3); }
    50% { transform: scaleX(0.7); }
}

/* Loading Tips */
.loading-tip {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 300px;
    line-height: 1.5;
    /* GPU-Optimierung: Feste Höhe für ~3 Zeilen verhindert CLS bei Textwechsel */
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fade-tip 8s ease-in-out infinite;
}

.loading-tip::before {
    content: '💡 ';
}

@keyframes fade-tip {
    0%, 20% { opacity: 1; }
    25%, 45% { opacity: 0; }
    50%, 70% { opacity: 1; }
    75%, 95% { opacity: 0; }
    100% { opacity: 1; }
}

/* Step Dots */
.loading-steps {
    display: flex;
    gap: 8px;
    margin-top: 1.5rem;
}

.loading-step-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    /* GPU-Optimierung: Spezifische Properties statt "all" */
    transition: transform 0.3s ease, background-color 0.3s ease;
    will-change: transform;
    position: relative;
}

.loading-step-dot.active {
    background: #4facfe;
    transform: scale(1.2);
}

/* GPU-Optimierung: Glow via Pseudo-Element statt box-shadow (GPU-freundlich) */
.loading-step-dot.active::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: #4facfe;
    opacity: 0.4;
    filter: blur(4px);
    z-index: -1;
}

.loading-step-dot.completed {
    background: #00f2fe;
}

/* Gallery Cards */
.gallery-card {
    transition: all 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gallery-card .card-img-top {
    height: 250px;
    object-fit: cover;
}

.design-meta {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Privacy Notice Box */
.privacy-notice {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border: 1px solid #ffc107;
    border-radius: 12px;
    border-left: 4px solid #ffc107;
}

.privacy-notice-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.privacy-notice-content {
    flex: 1;
}

.privacy-notice-title {
    font-size: 1rem;
    font-weight: 600;
    color: #856404;
    margin: 0 0 0.5rem 0;
}

.privacy-notice-text {
    font-size: 0.9rem;
    color: #664d03;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.privacy-notice-text a {
    color: #0d6efd;
    text-decoration: underline;
}

.privacy-notice-text a:hover {
    color: #0a58ca;
}

.privacy-notice-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.privacy-notice-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #198754;
    cursor: pointer;
    flex-shrink: 0;
}

.privacy-notice-checkbox label {
    font-size: 0.9rem;
    color: #664d03;
    cursor: pointer;
    font-weight: 500;
    line-height: 1.4;
}

/* Disabled Upload Button */
#btnUpload:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#btnUpload:not(:disabled) {
    animation: pulse-button 2s ease-in-out infinite;
}

@keyframes pulse-button {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(var(--color-primary-rgb), 0); }
}

/* ===================================
   STEP 5: KOMPAKTES INLINE-LAYOUT
   Above-the-Fold Optimierung
   =================================== */

/* Kompakte Control-Zeile */
.style-selection-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.style-control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.style-control-group .control-label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    margin: 0;
    font-size: 0.95rem;
}

.style-control-group .form-select {
    min-width: 180px;
    max-width: 250px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
}

/* Präferenzen-Toggle Gruppe */
.preferences-toggle-group {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pill-Style Checkbox */
.preference-pill {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.preference-pill .preference-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.preference-pill-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 50px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.9rem;
    color: #495057;
}

.preference-pill-content i.preference-checkbox-icon {
    font-size: 1.25rem;
    color: #6c757d;
    transition: all 0.25s ease;
}

/* Checkbox Icon im checked state */
.preference-pill .preference-checkbox:checked + .preference-pill-content i.preference-checkbox-icon {
    color: #4caf50;
    transform: scale(1.1);
}

.preference-text {
    white-space: nowrap;
}

.preference-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #e9ecef;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.25s ease;
}

/* Hover State */
.preference-pill:hover .preference-pill-content {
    border-color: var(--color-primary, #0d6efd);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.preference-pill:hover .preference-pill-content i.preference-checkbox-icon {
    color: var(--color-primary, #0d6efd);
    transform: scale(1.1);
}

/* Checked State */
.preference-pill .preference-checkbox:checked + .preference-pill-content {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #4caf50;
    color: #2e7d32;
}

.preference-pill .preference-checkbox:checked + .preference-pill-content i {
    color: #4caf50;
}

.preference-pill .preference-checkbox:checked + .preference-pill-content .preference-badge {
    background: #4caf50;
    color: #fff;
}

/* Info Tooltip Button */
.btn-tooltip-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    color: #6c757d;
    cursor: help;
    transition: all 0.2s ease;
}

.btn-tooltip-trigger:hover {
    background: var(--color-primary, #0d6efd);
    border-color: var(--color-primary, #0d6efd);
    color: #fff;
}

.btn-tooltip-trigger i {
    font-size: 0.9rem;
}

/* Custom Tooltip Styling */
.tooltip-inner {
    max-width: 280px;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

.tooltip-inner a.tooltip-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #90caf9;
    text-decoration: underline;
}

.tooltip-inner a.tooltip-link:hover {
    color: #fff;
}

/* Style Grid - Optimiert für volle Breite */
#section-style_selection .style-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

/* Responsive Anpassungen für kompaktes Layout */
@media (max-width: 768px) {
    .style-selection-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .preferences-toggle-group {
        margin-left: 0;
        justify-content: space-between;
    }

    .style-control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .style-control-group .form-select {
        width: 100%;
        max-width: none;
        min-width: auto;
    }

    .preference-pill-content {
        flex: 1;
        justify-content: center;
    }

    #section-style_selection .style-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .preference-text {
        display: none;
    }

    .preference-pill-content {
        padding: 0.5rem 0.75rem;
    }

    #section-style_selection .style-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .step-indicator {
        flex-wrap: wrap;
    }

    .step {
        margin-bottom: 1rem;
    }

    .furniture-list {
        grid-template-columns: 1fr;
    }

    .style-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .privacy-notice {
        flex-direction: column;
        text-align: center;
    }

    .privacy-notice-icon {
        margin: 0 auto;
    }

    .privacy-notice-checkbox {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .questionnaire-toggle-card {
        padding: 1rem;
    }

    .questionnaire-info-box .info-box-content {
        padding: 0.75rem;
    }
}

/* =============================================
   SELECTION-LAYOUT (Bild + Möbelliste)
   Zwei-Spalten-Layout für Möbelauswahl
   ============================================= */

.selection-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    margin-bottom: 20px;
    align-items: start;  /* FIX: Verhindert Stretch auf Möbellisten-Höhe */
}

.selection-image-container {
    position: relative;
}

.selection-image-wrapper {
    position: relative;
    display: block; /* WICHTIG: block statt inline-block verhindert baseline gap */
    width: 100%;
    line-height: 0; /* Entfernt jeglichen vertikalen Abstand */
}

.selection-image {
    display: block; /* WICHTIG: verhindert inline-baseline Probleme */
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.bounding-box-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Das Overlay muss exakt über dem Bild liegen */
}

/* =============================================
   BOUNDING-BOXES (Hover-Hervorhebung)
   ============================================= */

.bounding-box {
    position: absolute;
    border: 2px dashed transparent;
    transition: all 0.2s ease;
    pointer-events: none;
    border-radius: 4px;
}

.bounding-box.highlighted {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.25);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.bounding-box .bbox-label {
    position: absolute;
    top: -28px;
    left: 0;
    background: #3498db;
    color: white;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s ease;
    z-index: 10;
}

.bounding-box.highlighted .bbox-label {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   MÖBELLISTE (rechte Spalte)
   ============================================= */

.selection-list-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

.selection-list-container::-webkit-scrollbar {
    width: 6px;
}

.selection-list-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.selection-list-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Erweiterte Furniture-Item Styles für Duplikate */
.furniture-item.duplicate {
    border-left: 4px solid #f39c12;
}

/* =============================================
   THUMBNAILS
   ============================================= */

.furniture-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.furniture-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    color: #ccc;
    font-size: 24px;
}

/* =============================================
   MÖBEL-INFO (erweitert mit Description)
   ============================================= */

.furniture-desc {
    font-size: 12px;
    color: #666;
    font-style: italic;
    line-height: 1.3;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

/* =============================================
   RESPONSIVE: Selection-Layout
   ============================================= */

@media (max-width: 1024px) {
    .selection-layout {
        grid-template-columns: 1fr;
    }

    .selection-list-container {
        max-height: 400px;
    }

    .furniture-desc {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .selection-layout {
        gap: 16px;
    }

    .furniture-thumbnail {
        width: 50px;
        height: 50px;
    }

    .selection-list-container {
        max-height: 350px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   Ersetzt native Browser-Alerts für bessere UX (2025-12-15)
   ═══════════════════════════════════════════════════════════════════════════ */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 450px;
    padding: 16px 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.toast-hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-notification i:first-child {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast-close i {
    font-size: 1.1rem;
}

/* Toast Types */
.toast-info {
    border-left: 4px solid #3b82f6;
}
.toast-info i:first-child {
    color: #3b82f6;
}

.toast-success {
    border-left: 4px solid #10b981;
    background: linear-gradient(to right, rgba(16, 185, 129, 0.05), white);
}
.toast-success i:first-child {
    color: #10b981;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}
.toast-warning i:first-child {
    color: #f59e0b;
}

.toast-error {
    border-left: 4px solid #ef4444;
}
.toast-error i:first-child {
    color: #ef4444;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .toast-notification {
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
        top: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SESSION RESTORE TOAST
   Notification für erfolgreiche Wiederherstellung des Workflow-Fortschritts
   ═══════════════════════════════════════════════════════════════════════════════ */

.restore-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 450px;
    animation: restoreToastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.restore-toast-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 14px;
    box-shadow:
        0 10px 40px rgba(16, 185, 129, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.5;
}

.restore-toast-icon {
    font-size: 24px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.restore-toast-message {
    flex: 1;
    font-weight: 500;
}

.restore-toast-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.restore-toast-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.restore-toast-close i {
    font-size: 16px;
}

@keyframes restoreToastSlideIn {
    0% {
        transform: translateX(120%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsive für Restore Toast */
@media (max-width: 576px) {
    .restore-toast {
        left: 10px;
        right: 10px;
        max-width: none;
        top: 10px;
    }

    .restore-toast-content {
        padding: 14px 16px;
        gap: 10px;
    }

    .restore-toast-icon {
        font-size: 20px;
    }

    .restore-toast-message {
        font-size: 13px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SINGLE-DESIGN-MODUS
   Vereinfachte Stilauswahl wenn nur ein Stil pro Raumtyp aktiv ist
   ═══════════════════════════════════════════════════════════════════════════════ */

.single-style-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.single-style-card {
    width: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.single-style-card.selected {
    border: 3px solid var(--color-primary, #0d6efd);
    box-shadow: 0 8px 30px rgba(13, 110, 253, 0.25);
}

.single-style-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.single-style-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-style-placeholder i {
    font-size: 4rem;
    color: #adb5bd;
}

.single-style-info {
    padding: 20px;
    text-align: center;
}

.single-style-name {
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #212529;
}

.single-style-desc {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
}

.single-style-button {
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.single-style-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.single-style-button i {
    font-size: 1.2rem;
}

/* Mobile Responsive für Single-Design */
@media (max-width: 576px) {
    .single-style-preview {
        padding: 16px;
        gap: 20px;
    }

    .single-style-image {
        height: 200px;
    }

    .single-style-name {
        font-size: 1.2rem;
    }

    .single-style-button {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
        font-size: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ROOM ANALYSIS SECTION (Step 5)
   Automatische KI-Raumanalyse nach Möbelentfernung
   Redesign: Split-View Layout (Bild links, Karten rechts)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Analysis Container */
.analysis-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Analysis Grid - Split View: Bild links, Karten rechts */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 24px;
}

/* Raumbild Container */
.analysis-image-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    background: #f8f9fa;
}

.analysis-image {
    width: 100%;
    height: auto;
    display: block;
    min-height: 200px;
    object-fit: cover;
}

/* Ergebnis-Karten Container */
.analysis-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Analysis Card - Modern & Kompakt (horizontal) */
.analysis-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    text-align: left;
}

.analysis-card:hover {
    border-color: #dee2e6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Card Icon */
.analysis-card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    font-size: 1.25rem;
    color: #495057;
}

.analysis-card-icon i {
    font-size: inherit;
}

/* Card Content */
.analysis-card-content {
    flex: 1;
    min-width: 0;
}

.analysis-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin: 0 0 4px 0;
}

.analysis-card-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    line-height: 1.3;
}

.analysis-card-detail {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 4px 0 0 0;
}

/* Confidence Bar in Card */
.analysis-card-confidence {
    margin-top: 8px;
}

.analysis-card-confidence .confidence-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.analysis-card-confidence .confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.8s ease-out;
}

.analysis-card-confidence .confidence-text {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
}

/* Wide Card für Raum-Hinweise */
.analysis-card-wide {
    /* Bleibt normal in der Spalte */
}

.analysis-notes-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.analysis-notes-list li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
    font-size: 0.875rem;
    color: #495057;
}

.analysis-notes-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Legacy Card Styles (Fallback) */
.analysis-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color, #0d6efd) 0%, #0b5ed7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.analysis-icon i {
    font-size: 1.75rem;
    color: white;
}

.analysis-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.analysis-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 8px;
    line-height: 1.2;
}

.analysis-detail {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 8px;
}

/* Confidence Bar */
.confidence-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

.confidence-text {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 6px;
}

/* Analysis Actions */
.analysis-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.analysis-actions .btn {
    min-width: 180px;
    padding: 12px 24px;
    font-weight: 500;
    border-radius: 50px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analysis-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #0d6efd) 0%, #0b5ed7 100%);
    border: none;
}

.analysis-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.analysis-actions .btn-outline-secondary {
    border: 2px solid #6c757d;
    background: transparent;
    color: #6c757d;
}

.analysis-actions .btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
}

/* Analysis Loading */
.analysis-loading {
    text-align: center;
    padding: 60px 20px;
}

.analysis-loading .spinner-border {
    width: 48px;
    height: 48px;
    border-width: 4px;
    color: var(--primary-color, #0d6efd);
}

.analysis-loading p {
    margin-top: 20px;
    font-size: 1.1rem;
    color: #6c757d;
}

/* Analysis Error */
.analysis-error {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border: 1px solid #f5c6cb;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.analysis-error .error-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 16px;
}

.analysis-error .error-message {
    font-size: 1.1rem;
    color: #721c24;
    margin-bottom: 24px;
}

.analysis-error .error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Mobile Responsive - Analysis Section */
@media (max-width: 992px) {
    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .analysis-image-container {
        order: -1; /* Bild oben */
        max-height: 300px;
    }

    .analysis-image {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .analysis-grid {
        gap: 20px;
    }

    .analysis-card {
        padding: 16px;
        gap: 12px;
    }

    .analysis-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .analysis-card-value {
        font-size: 1rem;
    }

    .analysis-card-title {
        font-size: 0.7rem;
    }

    .analysis-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .analysis-actions .btn {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .analysis-container {
        padding: 12px;
    }

    .analysis-card {
        padding: 14px;
    }

    .analysis-loading {
        padding: 40px 16px;
    }

    .analysis-error {
        padding: 24px 16px;
    }

    .analysis-image-container {
        max-height: 200px;
    }

    .analysis-image {
        max-height: 200px;
    }
}

/* =========================================================================
   SURFACE SELECTION PANEL (Endkunden-Oberflächen-Auswahl)
   ========================================================================= */

.surface-selection-panel {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
    animation: fadeInUp 0.4s ease;
}

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

.surface-panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1a1a2e;
}

.surface-panel-title i {
    margin-right: 0.5rem;
    color: #6c63ff;
}

.surface-panel-desc {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.surface-group {
    margin-bottom: 1.5rem;
}

.surface-group-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.surface-group-title i {
    color: #6c63ff;
    font-size: 0.95rem;
}

.surface-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Surface Option Card */
.surface-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    min-width: 200px;
    max-width: 320px;
    flex: 1 1 200px;
}

.surface-option:hover {
    border-color: #b3b0ff;
    background: #f8f7ff;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.1);
}

.surface-option.selected {
    border-color: #6c63ff;
    background: #f0eeff;
    box-shadow: 0 2px 12px rgba(108, 99, 255, 0.2);
}

.surface-option.selected .surface-radio {
    border-color: #6c63ff;
    background: #6c63ff;
}

.surface-option.selected .surface-radio::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.surface-radio {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.surface-color-swatch {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.surface-ref-thumb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.surface-info {
    flex: 1;
    min-width: 0;
}

.surface-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surface-brand {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surface-detail {
    font-size: 0.75rem;
    color: #999;
}

/* Action Button - Sticky am unteren Rand */
.surface-action {
    position: sticky;
    bottom: 0;
    margin-top: 2rem;
    padding: 1rem 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 10;
}

.surface-action .btn {
    padding: 0.75rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .surface-options {
        flex-direction: column;
    }

    .surface-option {
        max-width: 100%;
    }
}
