/**
 * CockpitOS Light Theme - Centerplan Floorplan
 * 
 * Verantwortlichkeit: Floorplan Styling
 * 
 * @package CockpitOS_Light_Theme
 * @version 1.0.0
 */

/* ========================================
   Floorplan Container
   ======================================== */

.centerplan-floorplan {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md, 1rem);
    padding: var(--spacing-md, 1rem);
    background-color: var(--color-white, #ffffff);
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
    position: relative;
    width: 100%;
    min-height: 500px; /* Reduzierte Min-Höhe für bessere Proportionen */
    height: auto;
}

/* Both-Mode: Volle Breite, Auto-Höhe */
.centerplan-floorplan--both-mode {
    height: auto !important;
    min-height: 500px;
    display: flex !important; /* Wichtig: Überschreibt potenzielle display:none */
    visibility: visible !important;
}

/* Horizontal-Mode: Optimierte Höhe */
.centerplan-directory-widget[data-directory-layout="horizontal"] .centerplan-floorplan--both-mode {
    min-height: 400px;
    max-height: 800px;
}

/* ========================================
   Floor Label
   ======================================== */

.centerplan-floorplan__floor-label {
    position: absolute;
    bottom: var(--spacing-md, 1rem);
    right: var(--spacing-md, 1rem);
    z-index: 10;
}

.centerplan-floorplan__floor-text {
    display: inline-block;
    padding: var(--spacing-xs, 0.25rem) var(--spacing-sm, 0.5rem);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-gray-200, #e2e8f0);
    border-radius: var(--radius-md, 0.5rem);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-medium, 500);
    color: var(--color-gray-700, #334155);
    box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
}

/* ========================================
   Map Container
   ======================================== */

.centerplan-floorplan__map-container {
    width: 100%;
    height: 100%; /* Volle Höhe des Parents */
    flex: 1; /* Nimmt verfügbaren Platz */
    min-height: 350px;
    position: relative;
    overflow: hidden; /* SVG bleibt im Container */
    border-radius: var(--radius-md, 0.5rem);
    background-color: var(--color-gray-50, #f9fafb);
    border: 1px solid #e5e7eb;
    padding: var(--spacing-md, 1rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.centerplan-floorplan__map-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.centerplan-floorplan__map-wrapper svg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    border: none !important;
    outline: none !important;
    object-fit: contain; /* SVG proportional skalieren */
}

/* Fallback: Wenn SVG keine viewBox hat */
.centerplan-floorplan__map-wrapper svg:not([viewBox]) {
    height: auto;
    max-height: 600px;
}

/* AGGRESSIV: Entfernt ALLE schwarzen Rahmen/Strokes von SVG */
.centerplan-floorplan__map-wrapper svg[style*="border"],
.centerplan-floorplan__map-wrapper svg[style*="stroke"] {
    border: none !important;
    stroke: none !important;
}

/* Entfernt schwarze Hintergrund-Rechtecke */
.centerplan-floorplan__map-wrapper svg > rect[fill="none"],
.centerplan-floorplan__map-wrapper svg > rect[fill="transparent"],
.centerplan-floorplan__map-wrapper svg > rect[stroke="black"],
.centerplan-floorplan__map-wrapper svg > rect[stroke="#000"],
.centerplan-floorplan__map-wrapper svg > rect[stroke="#000000"] {
    stroke: none !important;
    display: none !important; /* Versteckt komplett */
}

/* Entfernt alle schwarzen Strokes außer explizit benötigte */
.centerplan-floorplan__map-wrapper svg *[stroke="black"],
.centerplan-floorplan__map-wrapper svg *[stroke="#000"],
.centerplan-floorplan__map-wrapper svg *[stroke="#000000"] {
    stroke: transparent !important;
}

/* Falls SVG selbst einen Rahmen hat */
.centerplan-floorplan__map-wrapper svg {
    box-shadow: none !important;
    filter: none !important;
}

/* ========================================
   SVG Shop/Service Styling
   ======================================== */

.centerplan-floorplan__map-wrapper svg [id^="shop-"],
.centerplan-floorplan__map-wrapper svg [id^="service-"] {
    cursor: pointer;
    transition: opacity var(--transition-fast, 150ms ease), filter var(--transition-fast, 150ms ease);
}

.centerplan-floorplan__map-wrapper svg [id^="shop-"]:hover,
.centerplan-floorplan__map-wrapper svg [id^="service-"]:hover {
    opacity: 0.8;
    filter: brightness(1.1);
}

.centerplan-floorplan__map-wrapper svg [id^="shop-"].is-selected,
.centerplan-floorplan__map-wrapper svg [id^="service-"].is-selected {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
    stroke: var(--color-primary, #3b82f6);
    stroke-width: 2;
}

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

/* Laptop (13" MacBook, etc.) */
@media (max-width: 1440px) {
    .centerplan-floorplan {
        min-height: 450px;
    }
    
    .centerplan-floorplan__map-container {
        min-height: 400px;
    }
    
    /* Horizontal-Mode Sticky deaktivieren */
    .centerplan-directory-widget[data-directory-layout="horizontal"] .centerplan-floorplan {
        position: static !important;
        max-height: none !important;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .centerplan-floorplan {
        min-height: 400px;
    }
    
    .centerplan-floorplan__map-container {
        height: auto;
        min-height: 350px;
        padding: var(--spacing-sm, 0.5rem);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .centerplan-floorplan {
        padding: var(--spacing-sm, 0.5rem);
        min-height: 300px;
    }
    
    .centerplan-floorplan__map-container {
        height: auto;
        min-height: 250px;
        padding: var(--spacing-sm, 0.5rem);
    }
}

@media (max-width: 480px) {
    .centerplan-floorplan {
        min-height: 250px;
        padding: var(--spacing-xs, 0.25rem);
    }
    
    .centerplan-floorplan__map-container {
        height: auto;
        min-height: 200px;
        padding: var(--spacing-xs, 0.25rem);
    }
    
    .centerplan-floorplan__floor-label {
        bottom: var(--spacing-sm, 0.5rem);
        right: var(--spacing-sm, 0.5rem);
    }
    
    .centerplan-floorplan__floor-text {
        font-size: var(--font-size-xs, 0.75rem);
        padding: var(--spacing-xs, 0.25rem);
    }
}

