/* ============================================
   KI-Lösungskompass - Styles
   ============================================ */

/* Page Layout */
.kompass-page {
    min-height: 100vh;
    padding-top: var(--header-height);
}

[data-theme="dark"] .kompass-page {
    background: #0b1624;
    color: #e5e7eb;
}

/* Hero Section */
.kompass-hero {
    padding: var(--space-xl) 0;
    background: var(--gradient-main);
}

.kompass-hero .hero-content {
    text-align: center;
    padding: var(--space-xl);
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.hero-icon {
    font-size: 1.2em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* Main Layout */
.kompass-main {
    padding: var(--space-sm) 0 var(--space-lg);
}

.kompass-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-lg);
    align-items: start;
}

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

/* Filter Sidebar */
.kompass-filters {
    padding: var(--space-md);
    position: sticky;
    top: calc(var(--header-height) + var(--space-md));
    max-height: calc(100vh - var(--header-height) - var(--space-lg));
    overflow-y: auto;
}

[data-theme="dark"] .kompass-filters {
    background: #111f32;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}

@media (max-width: 1024px) {
    .kompass-filters {
        position: relative;
        top: 0;
        max-height: none;
    }
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] .filters-header {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.filters-header h2 {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.btn-reset {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.btn-reset:hover {
    color: var(--color-primary);
    background: var(--glass-bg);
}

/* Quick Presets */
.presets-group {
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-md);
}

.presets-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preset-btn {
    padding: 6px 12px;
    background: var(--glass-bg-light);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.preset-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(43, 140, 163, 0.08);
}

.preset-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.preset-btn.preset-wizard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.preset-btn.preset-wizard:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Filter Groups */
.filter-group {
    margin-bottom: var(--space-md);
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--glass-bg-light);
    color: var(--color-text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

[data-theme="dark"] .filter-input,
[data-theme="dark"] .filter-select {
    background: #0b1624;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(43, 140, 163, 0.15);
}

/* Checkboxes */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-normal);
    font-size: 0.875rem;
}

.checkbox-label:hover {
    background: var(--glass-bg);
}

[data-theme="dark"] .checkbox-label:hover {
    background: rgba(255, 255, 255, 0.06);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 2px solid;
    font-size: 12px;
    transition: all var(--transition-normal);
}

.checkbox-label input:checked + .checkbox-icon {
    transform: scale(1.1);
}

.checkbox-label input:not(:checked) + .checkbox-icon {
    opacity: 0.4;
}

.checkbox-emoji {
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

.checkbox-label input:not(:checked) ~ .checkbox-text {
    opacity: 0.5;
    text-decoration: line-through;
}

/* Slider */
.filter-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--color-border);
    outline: none;
    -webkit-appearance: none;
    margin: var(--space-sm) 0;
}

.filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-light);
    transition: transform 0.2s;
}

[data-theme="dark"] .filter-slider {
    background: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .filter-slider::-webkit-slider-thumb {
    border-color: #0b1624;
}

.filter-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

/* Export Buttons */
.export-group {
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-md);
}

[data-theme="dark"] .export-group {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.export-buttons {
    display: flex;
    gap: 8px;
}

.btn-export {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--glass-bg-light);
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

[data-theme="dark"] .btn-export {
    background: #0b1624;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}

.btn-export:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Matrix Container */
.kompass-matrix-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.kompass-matrix {
    position: relative;
    aspect-ratio: 4 / 3;
    min-height: 400px;
    max-height: calc(100vh - 200px);
    padding: var(--space-lg);
    overflow: hidden;
}

[data-theme="dark"] .kompass-matrix {
    background: #0b1624;
}

@media (max-width: 768px) {
    .kompass-matrix {
        aspect-ratio: 1;
        min-height: 320px;
    }
}

/* Axis Labels */
.axis-label {
    position: absolute;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
}

.axis-label.axis-y {
    left: -40px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center;
    white-space: nowrap;
}

.axis-label.axis-x {
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.axis-arrow {
    font-weight: bold;
    color: var(--color-primary);
}

.axis-desc {
    opacity: 0.7;
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    .axis-label {
        font-size: 0.65rem;
    }
    .axis-label.axis-y {
        left: -30px;
    }
    .axis-label.axis-x {
        bottom: -25px;
    }
}

/* Quadrant Labels */
.quadrant-labels {
    position: absolute;
    inset: var(--space-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    pointer-events: none;
    z-index: 2;
}

.quadrant-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    transition: opacity var(--transition-normal);
}

/* Quadrant-Layout basierend auf kompass-scoring.php:
   - Q1: Low depth + Low effort  = unten-links  = Schnelle Helfer (grün)
   - Q2: Low depth + High effort = unten-rechts = Komplex-Helfer (orange)
   - Q3: High depth + Low effort = oben-links   = Strategische Partner (blau)
   - Q4: High depth + High effort= oben-rechts  = Markt-Transformierer (lila)
*/
.quadrant-label.q3 { order: 1; } /* oben-links - Strategische Partner */
.quadrant-label.q4 { order: 2; } /* oben-rechts - Markt-Transformierer */
.quadrant-label.q1 { order: 3; } /* unten-links - Schnelle Helfer */
.quadrant-label.q2 { order: 4; } /* unten-rechts - Komplex-Helfer */

.ql-icon {
    font-size: 2rem;
    color: var(--color-text-secondary);
}

.ql-icon .material-symbols-outlined {
    font-size: 32px;
}

.ql-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: center;
}

@media (max-width: 768px) {
    .ql-icon .material-symbols-outlined { font-size: 24px; }
    .ql-name { font-size: 0.65rem; }
}

/* Matrix Canvas */
#matrixCanvas {
    position: absolute;
    inset: var(--space-lg);
    width: calc(100% - var(--space-lg) * 2);
    height: calc(100% - var(--space-lg) * 2);
    z-index: 10;
    cursor: crosshair;
}

/* Grid Lines (via CSS) */
.kompass-matrix::before {
    content: '';
    position: absolute;
    inset: var(--space-lg);
    border: 1px solid var(--color-border);
    pointer-events: none;
    z-index: 1;
}

[data-theme="dark"] .kompass-matrix::before,
[data-theme="dark"] .kompass-matrix::after,
[data-theme="dark"] .kompass-matrix .quadrant-labels::before {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.kompass-matrix::after {
    content: '';
    position: absolute;
    top: var(--space-lg);
    bottom: var(--space-lg);
    left: 50%;
    width: 1px;
    background: var(--color-border);
    pointer-events: none;
    z-index: 1;
}

/* Horizontal center line */
.kompass-matrix .quadrant-labels::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--color-border);
}

/* Tooltip */
.tool-tooltip {
    position: fixed;
    padding: 10px 14px;
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-medium);
    font-size: 0.85rem;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    max-width: 280px;
}

[data-theme="dark"] .tool-tooltip {
    background: rgba(11, 22, 36, 0.92);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}

.tool-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-name {
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.tooltip-category {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.tooltip-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 0.75rem;
}

.tooltip-score {
    display: flex;
    justify-content: space-between;
}

.tooltip-score-value {
    font-weight: 600;
    color: var(--color-primary);
}

/* Legend */
.matrix-legend {
    padding: var(--space-md);
    background: var(--glass-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.matrix-legend h3 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
}

.legend-section h4 {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 4px 0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-emoji,
.legend-icon {
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

.legend-icon .material-symbols-outlined {
    font-size: 18px;
    vertical-align: middle;
}

.legend-star {
    color: var(--color-highlight);
    font-size: 1rem;
}

/* Dark Mode tweaks */
[data-theme="dark"] .matrix-legend {
    background: #111f32;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}

[data-theme="dark"] .legend-section h4,
[data-theme="dark"] .legend-item,
[data-theme="dark"] .legend-text {
    color: #cbd5e1;
}

/* Quadrant Stats */
.quadrant-stats {
    padding: var(--space-md);
    background: var(--glass-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.quadrant-stats h3 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-sm);
}

.stat-card {
    padding: var(--space-sm);
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid;
    transition: transform var(--transition-normal);
}

[data-theme="dark"] .quadrant-stats {
    background: #111f32;
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .stat-card {
    background: #0b1624;
    border-color: rgba(255, 255, 255, 0.12);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.stat-emoji,
.stat-icon {
    font-size: 1.2rem;
}

.stat-icon .material-symbols-outlined {
    font-size: 20px;
    vertical-align: middle;
}

.stat-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.stat-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.stat-meta {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-heavy);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.detail-panel.active {
    right: 0;
}

.detail-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: flex-end;
    padding: var(--space-sm);
    background: inherit;
    z-index: 1;
}

.btn-close-detail {
    background: var(--glass-bg);
    border: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition-normal);
}

.btn-close-detail:hover {
    background: var(--color-primary);
    color: white;
}

.detail-content {
    padding: 0 var(--space-md) var(--space-lg);
}

.detail-tool-header {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.detail-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    object-fit: contain;
    background: white;
    padding: 8px;
}

.detail-title {
    flex: 1;
}

.detail-title h2 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.detail-category {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-md);
}

.detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-quadrant {
    background: var(--color-primary);
    color: white;
}

.badge-risiko-gruen { background: #dcfce7; color: #166534; }
.badge-risiko-gelb { background: #fef3c7; color: #92400e; }
.badge-risiko-rot { background: #fee2e2; color: #991b1b; }

.badge-kosten {
    background: var(--glass-bg);
    color: var(--color-text-secondary);
}

.detail-scores {
    margin-bottom: var(--space-md);
}

.score-bar {
    margin-bottom: var(--space-sm);
}

.score-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.score-bar-track {
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.score-bar-fill.fill-tiefe { background: linear-gradient(90deg, #22c55e, #3b82f6); }
.score-bar-fill.fill-aufwand { background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444); }
.score-bar-fill.fill-kmu { background: linear-gradient(90deg, #f59e0b, #22c55e); }

.detail-description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.detail-meta {
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.detail-meta-item {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.detail-meta-label {
    min-width: 100px;
    color: var(--color-text-secondary);
}

.detail-meta-value {
    color: var(--color-text-primary);
}

.detail-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-detail-primary,
.btn-detail-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-detail-primary {
    background: var(--color-primary);
    color: white;
    border: none;
}

.btn-detail-primary:hover {
    background: #237a8f;
    transform: translateY(-1px);
}

.btn-detail-secondary {
    background: var(--glass-bg);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-detail-secondary:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Detail Overlay */
.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.detail-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Tour Modal */
.tour-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tour-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.tour-content {
    position: relative;
    max-width: 500px;
    margin: var(--space-md);
    padding: var(--space-lg);
}

.tour-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 4px;
}

.tour-step h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.tour-step p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.tour-step ul {
    margin-bottom: var(--space-md);
    padding-left: var(--space-md);
}

.tour-step li {
    margin-bottom: 6px;
    color: var(--color-text-secondary);
}

.tour-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

.btn-tour-skip,
.btn-tour-start {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-tour-skip {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.btn-tour-start {
    background: var(--color-primary);
    border: none;
    color: white;
}

.btn-tour-start:hover {
    background: #237a8f;
}

/* Loading State */
.kompass-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .kompass-hero .hero-content {
        padding: var(--space-md);
    }

    .hero-title {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .hero-stats {
        gap: var(--space-md);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .kompass-filters {
        padding: var(--space-sm);
    }

    .filter-checkboxes {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .checkbox-label {
        flex: 1 1 45%;
        min-width: 120px;
    }

    .detail-panel {
        width: 100%;
        right: -100%;
    }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .detail-icon {
    background: var(--color-bg-secondary);
}

[data-theme="dark"] .badge-risiko-gruen {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

[data-theme="dark"] .badge-risiko-gelb {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

[data-theme="dark"] .badge-risiko-rot {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kompass-matrix,
.matrix-legend,
.quadrant-stats {
    animation: fadeInUp 0.5s ease forwards;
}

.matrix-legend { animation-delay: 0.1s; }
.quadrant-stats { animation-delay: 0.2s; }

/* ==========================================
   IMPROVED KMU SLIDER
   ========================================== */

.slider-context-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    opacity: 0.8;
}

.slider-value-label {
    text-align: center;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* ==========================================
   MATRIX CONTROLS (Zoom & Comparison Toggle)
   ========================================== */

.matrix-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--glass-bg-light);
    border-radius: var(--radius-sm);
    padding: 4px;
    border: 1px solid var(--color-border);
}

.btn-zoom {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: all var(--transition-normal);
}

.btn-zoom:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn-zoom-reset {
    font-size: 0.9rem;
}

.zoom-level {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 45px;
    text-align: center;
}

.btn-comparison-toggle {
    padding: 8px 16px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.btn-comparison-toggle:hover {
    background: #237a8f;
    transform: translateY(-1px);
}

/* ==========================================
   COMPARISON SIDEBAR
   ========================================== */

.comparison-sidebar {
    position: fixed;
    right: -420px;
    top: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-heavy);
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.comparison-sidebar.open {
    right: 0;
}

.comparison-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--color-primary);
    color: white;
    z-index: 1;
}

.comparison-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.btn-close-comparison {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-normal);
}

.btn-close-comparison:hover {
    background: rgba(255, 255, 255, 0.3);
}

.comparison-content {
    padding: var(--space-md);
}

.comparison-empty {
    text-align: center;
    color: var(--color-text-secondary);
    padding: var(--space-xl);
    font-size: 0.9rem;
}

.comparison-tool {
    position: relative;
    background: white;
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-light);
}

.remove-comparison {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background var(--transition-normal);
}

.remove-comparison:hover {
    background: #c82333;
}

.comparison-tool-header {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.comparison-tool-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--glass-bg);
    padding: 4px;
}

.comparison-tool-header h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.comparison-tool-category {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.comparison-tool-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: var(--space-sm) 0;
    font-size: 0.8rem;
}

.comparison-score {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comparison-score span {
    color: var(--color-text-secondary);
}

.comparison-score strong {
    color: var(--color-text-primary);
}

.comparison-tool-link {
    display: block;
    text-align: center;
    padding: 8px 12px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-top: var(--space-sm);
    transition: background var(--transition-normal);
}

.comparison-tool-link:hover {
    background: #237a8f;
}

/* ==========================================
   WIZARD MODAL
   ========================================== */

.wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.wizard-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.wizard-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-heavy);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.wizard-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.wizard-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.wizard-step-indicator {
    font-size: 0.85rem;
    opacity: 0.9;
}

.wizard-content {
    padding: var(--space-lg);
}

.wizard-content h3 {
    margin: 0 0 var(--space-xs) 0;
    font-size: 1.2rem;
}

.wizard-question {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.wizard-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.wizard-option {
    padding: var(--space-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.95rem;
}

.wizard-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.wizard-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    padding: var(--space-md);
    border-top: 1px solid var(--color-border);
}

.btn-wizard-back,
.btn-wizard-next {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-wizard-back {
    background: white;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.btn-wizard-back:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-wizard-next {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */

.kompass-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    background: var(--color-text-primary);
    color: white;
    font-size: 0.9rem;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    box-shadow: var(--shadow-medium);
}

.notification-success {
    background: #22c55e;
}

.notification-warning {
    background: #f59e0b;
}

.notification-error {
    background: #ef4444;
}

.kompass-notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ==========================================
   RESPONSIVE ADDITIONS
   ========================================== */

@media (max-width: 768px) {
    .matrix-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .zoom-controls {
        justify-content: center;
    }

    .btn-comparison-toggle {
        width: 100%;
        text-align: center;
    }

    .comparison-sidebar {
        width: 100%;
        right: -100%;
    }

    .presets-buttons {
        flex-direction: column;
    }

    .preset-btn {
        width: 100%;
        text-align: center;
    }

    .wizard-modal {
        width: 95%;
        max-height: 85vh;
    }

    .wizard-option {
        padding: var(--space-sm);
        font-size: 0.85rem;
    }

    .kompass-notification {
        left: 20px;
        right: 20px;
        bottom: 10px;
    }
}

/* Print Styles */
@media print {
    .kompass-filters,
    .detail-panel,
    .tour-modal,
    .btn-export {
        display: none !important;
    }

    .kompass-layout {
        grid-template-columns: 1fr;
    }

    .kompass-matrix {
        break-inside: avoid;
    }
}
