/* Netzwerkkarte Container */
.netzwerkkarte-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: Circular, Helvetica, Arial, sans-serif;
}

/* Zeile 1: Header */
.netzwerkkarte-header {
    margin-bottom: 30px;
}

.netzwerkkarte-header h2 {
    position: relative;
    vertical-align: bottom;
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #333;
}
.netzwerkkarte-header h2 span img {
    margin-right: 10px;
    height: 2.5rem;
    width: auto;
}
.netzwerkkarte-header p {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

/* Zeile 2: Main Layout (Sidebar 20% + Karte 80%) */
.netzwerkkarte-main {
    display: flex;
    margin-bottom: 30px;
    gap:10px;
}

/* Sidebar (20%) */
.netzwerkkarte-sidebar {
    flex: 0 0 20%;
    min-width: 250px;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.search-box {
    margin-bottom: 20px;
}

.search-box h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.search-input {
    width: 93%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.filter-section details {
    margin-bottom: 10px;
    border: none;
    background: #f4f4f4;
    border-radius: 4px;
    padding: 0px;
}

.filter-section summary {
    cursor: pointer;
    font-weight: 500;
    padding: 10px 15px;
    user-select: none;
}
.filter-section summary::-webkit-details-marker {
    display: none;
}
.filter-section summary{
    list-style: none;
    &::after {
        content: '»';
        float: right;
        transition: transform 0.2s;
    }
    [open] &::after {
        content: "-";
    }
}
.filter-section summary:hover {
    color: #007bff;
}
.filter-section details:open .filter-options{
    background: #fdfdfd;
}

.filter-options {
    margin-top: 10px;
    padding: 10px;
}

.filter-checkbox {
    display: block;
    padding: 8px 0;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 4px;
    padding-left: 5px;
}

.filter-checkbox:hover {
    background: #f5f5f5;
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Karte (80%) */
.netzwerkkarte-map {
    flex: 1;
    z-index: 1;
}

#map {
    border-radius: 8px;
    border: 1px solid #ddd;
}

path.hidden {
    opacity: 0;
}
.bundesland {
    stroke: #666;
    stroke-width: 1;
    fill-opacity: 0.05;
}  
/* Zeile 3: Tabelle */
.netzwerkkarte-table {
    margin-bottom: 30px;
    overflow-x: auto;
}

.table-info {
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    font-size: 14px;
    color: #555;
}

.entries-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.entries-table thead {
    background: #000;
    color: #fff;
}

.entries-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.entries-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.entries-table tbody tr:hover {
    background: #f8f9fa;
}

.entries-table td {
    padding: 15px;
    font-size: 14px;
}

.entries-table a {
    color: #007bff;
    text-decoration: none;
}

.entries-table a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 20px 0;
    margin-top: 20px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 40px;
}

.pagination-btn:hover:not(.disabled) {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    font-weight: 600;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: #999;
}

/* Zeile 4: Legende */
.netzwerkkarte-legend {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.netzwerkkarte-legend h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.legend-items {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-icon {
    font-size: 1.5rem;
}

.reset-filters-btn {
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.reset-filters-btn:hover {
    background: #e0e0e0;
}
/* Popup Styles */
.leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: 0px !important;
}
.leaflet-popup-content {
    font-family: Circular, Helvetica, Arial, sans-serif;
    margin:0 !important;
    padding:0 !important;
    font-size: 14px;
    color: #333;
    max-width: 600px;
}   
.leaflet-popup-content p {
    margin: 0.3rem 0 !important;
}
.popup-info {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
}



.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999;
}

.popup-overlay.active {
    display: block;
}
.popup-image{
    width: 180px;
    background: url(../Images/placeholder_popup_side.webp) no-repeat;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.popup-content{
    max-width: 400px;
}
.popup-social-media {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: flex;
    gap: 10px;
}
.popup-social-media li{
    margin: 0;
}
.popup-social-media li a {
    color: #333;
    font-size: 18px;
    transition: color 0.2s;
}
.popup-social-media li a:hover {
    color: #007bff;
}

.popup-linklist{
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}
.popup-linklist li{
    margin: 10px 0;
}
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    background: #f5f5f5;
    color: #333;
}

.popup-body {
    padding: 24px;
    font-size: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.popup-body p {
    margin: 0 0 16px 0;
    line-height: 1.6;
    color: #4a4a4a;
}

.popup-body p:last-child {
    margin-bottom: 0;
}

.popup-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.popup-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.popup-button-primary {
    background: #0366d6;
    color: white;
}

.popup-button-primary:hover {
    background: #0256b8;
}

.popup-button-secondary {
    background: #eee;
    color: #333 !important;
    text-decoration: none;
}

.popup-button-secondary:hover {
    background: #ddd;
}
.popup-details {
    padding: 0;
    margin: 0 0 16px 0;
}
.popup-details li{
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    color: #555;
}
.popup-contact-details {
    padding: 0;
    margin: 8px 0 16px 0;
}
.popup-contact-details li{
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    color: #555;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}
.popup-contact-details li i{
    margin-right: 8px;
    font-size: 1.2rem;
    min-width: 30px;
    text-align: center;
}
.popup-divider {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 8px 0;
}
.popup-contact-info-container p{
    margin: 12px 0 !important;
}
.popup-copyright-image-container{
    line-height: 0.6;
}
.popup-copyright-logo-container{
    line-height: 0.6;
}
.popup-copyright-institution-container{
    line-height: 0.6;
}
/* Marker Icon Overlay */
.iconOverlay {
    position: absolute;
    width: 25px;
    height: 25px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: bold;
    color: rgb(0, 0, 0);
    pointer-events: none;
}
/* Cluster Marker Icon Overlay */
.clusterIconOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-family: Circular, Helvetica, Arial, sans-serif;
    color: rgb(0, 0, 0);
    pointer-events: none;
}
/*Legend specific*/
.legend {
  padding: 6px 8px;
  font: 14px Arial, Helvetica, sans-serif;
  background: white;
  background: rgba(255, 255, 255, 0.8);
  /*box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);*/
  /*border-radius: 5px;*/
  line-height: 24px;
  color: #555;
}
.legend h4 {
  text-align: center;
  font-size: 16px;
  margin: 2px 12px 8px;
  color: #777;
}

.legend span {
  position: relative;
  bottom: 3px;
}

.legend i {
  width: 18px;
  height: 18px;
  float: left;
  margin: 0 8px 0 0;
  opacity: 0.7;
}

.legend i.icon {
  background-size: 18px;
  background-color: rgba(255, 255, 255, 1);
}
/* Responsive Design */
@media (max-width: 1024px) {
    .netzwerkkarte-main {
        flex-direction: column;
    }
    
    .netzwerkkarte-sidebar {
        flex: 0 0 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .netzwerkkarte-header h1 {
        font-size: 1.8rem;
    }
    
    .entries-table {
        font-size: 12px;
    }
    
    .entries-table th,
    .entries-table td {
        padding: 10px;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 15px;
    }
}

/* Mobile Bottom Sheet */
.mobile-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-popup-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-popup-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    overflow: hidden;
    transition: bottom 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.mobile-popup-sheet.open {
    bottom: 0;
}

.bottom-sheet-header {
    padding: 12px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.bottom-sheet-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.bottom-sheet-close:hover,
.bottom-sheet-close:focus {
    background-color: #f0f0f0;
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

.bottom-sheet-content {
    overflow-y: auto;
    padding: 20px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Bottom Sheet nur auf Mobile Portrait anzeigen */
@media (min-width: 769px), (orientation: landscape) {
    .mobile-popup-overlay,
    .mobile-popup-sheet {
        display: none !important;
    }
    
    /* Debug-Modus: Bottom Sheet auch auf Desktop anzeigen */
    body.debug-mobile-bottom-sheet .mobile-popup-overlay,
    body.debug-mobile-bottom-sheet .mobile-popup-sheet {
        display: block !important;
    }
}

/* Popup-Inhalte im Bottom Sheet anpassen */
@media (max-width: 768px) and (orientation: portrait) {
    .mobile-popup-sheet .marker-popup {
        box-shadow: none;
        border: none;
    }
    
    .mobile-popup-sheet .popup-info {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-popup-sheet .popup-image {
        width: 100%;
        height: 200px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .mobile-popup-sheet .popup-content {
        width: 100%;
    }
    
    .mobile-popup-sheet .popup-header h3 {
        font-size: 1.25rem;
    }
}
