/* style.css */

@font-face {
    font-family: 'Ballinger';
    src: url('fonts/Ballinger-Regular.woff2') format('woff2'),
         url('fonts/Ballinger-Regular.woff') format('woff'),
         url('fonts/Ballinger-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Ballinger', sans-serif;
    overflow-x: hidden;
}

/* Container für die Dropdowns */
#dropdown-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Jede Zeile mit Dropdowns */
.dropdown-row {
    display: flex;
    justify-content: center;
    width: 90%;  
    max-width: 800px;  
    margin-bottom: 20px;  
}

#dropdown-line1, #dropdown-line2 {
    display: flex;
    width: 100%;  
}

/* Dropdown-Elemente in einer Zeile */
#dropdown-line1 select, #dropdown-line2 select {
    flex: 1;  
    margin-right: 10px;  
}

/* Entferne den rechten Rand beim letzten Dropdown in einer Zeile */
#dropdown-line1 select:last-child, #dropdown-line2 select:last-child {
    margin-right: 0;  
}

/* Tooltip-Styling */
.tooltip {
    max-width: 350px; 
    width: auto;
    overflow: visible; /* Ändert von auto zu visible */
    text-align: left;
    position: absolute;
    opacity: 0;
    pointer-events: auto;
    background-color: white;
    border: 1px solid black;
    padding: 15px;
    transition: opacity 0.3s;
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0px 4px 4px 0px #00000040;
    word-wrap: break-word;
    hyphens: auto;
    white-space: normal; /* Ermöglicht Zeilenumbrüche */
}

/* Labels im Dropdown-Container */
.dropdown-row label {
    margin-right: 5px;
}

/* Abstände der Selects */
.dropdown-row select {
    margin-bottom: 5px;
}

/* Select2: Volle Breite */
.select2-container {
    width: 100% !important; 
}

/* Falls du #gemeinde speziell anpassen willst */
#gemeinde {
    width: auto;
}

/* Abstand beim Label 'Einkommen' */
label[for="income"] {
    margin-left: 20px;
}

/* Legenden-Container */
#legendContainer {
    display: flex;
    justify-content: center;
    margin-top: 20px; 
}

/* Angepasste Legendengröße */
#legend {
    width: 60%;  
    height: 40px; /* Reduzierte Höhe von 60px auf 40px */
}

#legend text {
    font-family: 'Ballinger', sans-serif;
    font-size: 12px;
    fill: #000; /* Schwarze Schrift für bessere Lesbarkeit */
}

/* Entferne unnötige Linien der Achse */
#legend .axis path,
#legend .axis line {
    stroke: none;
}

/* Positioniere die Achse korrekt */
#legend .axis text {
    text-anchor: middle;
}

/* Hover/Highlight-Styling */
path.highlighted {
    stroke: black;
    stroke-width: 1px;
    
}

/* Lade-Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; 
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Select2-Styling */
.select2-container--default .select2-selection--single {
    border-radius: 4px;
    border-color: #888B95;
    height: 56px;
    background-color: #FFFFFF;
}

/* Tooltip-Inhalt */
.tooltip strong {
    font-size: 16px;
    font-weight: bold;
}

.tooltip span {
    font-size: 14px;
}

/* Responsive Layout */
@media (max-width: 768px) {
    .dropdown-row {
        flex-direction: column; 
        align-items: stretch; 
    }

    .dropdown-row label, .dropdown-row select {
        width: 100%;  
        margin-right: 0;
    }

    .dropdown-row select {
        margin-bottom: 10px;
    }

    label[for="income"] {
        margin-left: 0;
        padding-top: 15px;
    }

    #legend {
        width: 80%;  
        height: 40px; /* Beibehaltung der reduzierten Höhe */
    }

    #legend text {
        font-size: 10px; /* Kleinere Schriftgröße für kleinere Bildschirme */
    }

    .tooltip {
        max-width: 250px;
        font-size: 12px;
    }
}


/* Zoom-Buttons Styling */
.zoom-buttons rect {
    fill: #ffffff; /* Weißer Hintergrund */
    stroke: #000000; /* Schwarze Umrandung */
    stroke-width: 1px;
    rx: 4px; /* Abgerundete Ecken */
    ry: 4px;
    cursor: pointer; /* Cursor zeigt Hand beim Überfahren */
}

.zoom-buttons rect:hover {
    fill: #3498db; /* Blaue Farbe beim Hover */
    opacity: 1;
}

.zoom-buttons text {
    pointer-events: none; /* Verhindert, dass der Text die Klicks blockiert */
    fill: #000000; /* Schwarze Schriftfarbe */
    font-size: 18px; /* Angepasste Schriftgröße */
    font-family: Arial, sans-serif; /* Konsistente Schriftart */
}

/* Zoom-Overlay Styling */
.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* semi-transparent dunkler Hintergrund */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* über allen anderen Elementen */
}

.zoom-overlay-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 90%;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.3);
}

.zoom-overlay-content p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
}

.zoom-overlay-content button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.zoom-overlay-content button:hover {
    background-color: #2980b9;
}


#selectedTooltip {
    z-index: 2000; /* oder höher, je nach Bedarf */
    pointer-events: auto;
  }
  