html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
}

.app-header h1 {
    font-size: 2.2em;
    padding-left: 12px;
    padding-top: 7px;
    margin-bottom: 0px;
}

#content {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-height: 0;
}

/* MAP Container */
#map-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Karte */
#map {
    flex: 1 1 0;
    width: 100%;
    min-height: 200px;
    z-index: 0;
    overflow: hidden;
}

/* Legende */
#map-legende {
    flex: 0 0 auto;
    background: #f1f1f1;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 8px 15px;
    font-size: 0.9em;
    flex-wrap: wrap;
}


.portrait #content {
    flex-direction: column;
}

.portrait #map-container {
    height: 40%;
    width: 100%;
}

.portrait #pharmacy-list {
    height: 60%;
    width: 100%;
    overflow-y: auto;
}

/* Landscape Layout */
.landscape #content {
    flex-direction: row;
}

.landscape #map-container {
    height: 100%;
    width: 50%;
}

.landscape #pharmacy-list {
    height: 100%;
    width: 50%;
    overflow-y: auto;
}

#pharmacy-list {
    padding: 20px;
    background: #fff;
    overflow-y: auto;
}

/* --- Styling der Apotheken-Einträge --- */



.pharmacy-item {
    border-bottom: 1px solid #eee;
    margin-bottom: 14px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    background: #fff;
    color: #000;
}

.pharmacy-item.screen {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    border: 2px solid var(--bs-primary);
    padding: 8px;
    border-radius: 5px;
    color: #000;
}

.marker-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: gray;
    color: white;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 10px;
}

/* Legende */
#map-legende {
    background: #f1f1f1;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 15px;
    font-size: 0.9em;
    flex-wrap: wrap;
}

#map-legende > div {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

#map-legende > div:last-child {
    margin-right: 0;
}

.marker-standort {
    background: #b30000;
}

.marker-bereitschaft {
    background: #003366;
}

.marker-offen {
    background: #0a8f08;
}

/* --- Legende --- */

.legende {
    display: none; /* Alte Legende wird nicht mehr genutzt */
}

body.theme-red {
    --bs-primary: #b30000;
    --bs-primary-rgb: 179, 0, 0;
}

body.theme-blue {
    --bs-primary: #005f99;
    --bs-primary-rgb: 0, 95, 153;
}

body.theme-green {
    --bs-primary: #198754;
    --bs-primary-rgb: 25, 135, 84;
}

body.theme-dark {
    --bs-primary: #343a40;
    --bs-primary-rgb: 52, 58, 64;
    background-color: #121212;
    color: #ffffff;
}

body.theme-dark #pharmacy-list {
    background-color: #1e1e1e;
    color: #ffffff;
}

body.theme-dark .pharmacy-item {
    background: #1e1e1e;
    color: #ddd;
    border-color: #555;
}

body.theme-dark .pharmacy-item.screen {
    background: #333;
    color: white;
    border-color: var(--bs-primary);
}

body.theme-dark #map-legende {
    background-color: #1e1e1e;
    color: #ddd;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

body.theme-dark .form-label,
body.theme-dark .form-control,
body.theme-dark .form-select {
    color: #fff;
    background-color: #2a2a2a;
    border-color: #444;
}

body.theme-dark .btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* --- Leaflet & Controls --- */

.leaflet-container {
    height: 100%;
    width: 100%;
}

.leaflet-marker-icon {
    transform: scale(1.7);
}

#controls-panel {
    background-color: #f8f9fa;
    position: relative;
    z-index: 1001;
}

body.theme-dark #controls-panel {
    background-color: #2b2b2b;
    color: #fff;
}

body.theme-dark #controls-panel .form-label {
    color: #ddd;
}

.top-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    position: relative;
    z-index: 1001;
}

.top-controls .form-label {
    font-size: 0.85em;
    margin: 0;
    font-weight: 500;
}

.top-controls .form-control-sm {
    font-size: 0.85em;
    padding: 2px 6px;
    height: auto;
    max-width: 140px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: grayscale(100%);
    opacity: 0.6;
    cursor: pointer;
}

.top-controls .btn-outline-secondary {
    font-size: 0.85em;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

.tom-select-dropdown {
    z-index: 2000 !important;
}

.leaflet-control-attribution {
    display: none;
}

/* --- NEUE Pharmacy Struktur --- */

.pharmacy-content {
    font-size: 1.3em;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pharmacy-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
}

.pharmacy-name {
    margin: 0;
    font-size: 1.6em;
    font-weight: bold;
    flex: 1;
}

.distance-big {
    font-size: 1.6em;
    font-weight: bold;
    white-space: nowrap;
}

.address-phone {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.left-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 60px; /* gibt etwas Luft */
}

.phone {
    font-size: 1.2em;
    white-space: nowrap;
}

.pharmacy-status {
    font-size: 1.5em;
    white-space: nowrap;
    margin-top: 4px;
}

.address {
    text-align: right;
    white-space: normal;
    overflow-wrap: break-word;
    font-size: 1.2em;
}

.leaflet-control-container {
    display: none;
}