/* SBB Leaflet Map Styles */

.sbb-leaflet-map-section {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="%23e0e0e0" opacity="0.3"/></svg>');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.sbb-map-header {
    max-width: 1440px;
    margin: 0 auto 60px;
    padding: 0 30px;
    text-align: center;
}

.sbb-map-header-content {
    display: inline-block;
}

.sbb-map-subtitle {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #8B7355;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.sbb-map-title {
    font-size: 42px;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin: 0;
}

.sbb-map-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 30px;
    position: relative;
}

.sbb-map-wrapper {
    position: relative;
    z-index: 1;
}

#sbb-leaflet-map {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1;
}

/* Modal Overlay */
.sbb-map-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.sbb-map-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* Information Box Modal */
.sbb-map-info-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 500px;
    width: 90%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.sbb-map-info-box.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.sbb-map-info-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease, transform 0.3s ease;
    color: #1e3a5f;
}

.sbb-map-info-close:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.sbb-map-info-close svg {
    width: 16px;
    height: 16px;
}

.sbb-map-info-header {
    background: #BDD646;
    padding: 20px 24px;
    padding-right: 60px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sbb-map-info-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    flex: 1;
}

.sbb-map-info-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #1e3a5f;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    text-decoration: none;
    transition: transform 0.3s ease, background 0.3s ease;
}

.sbb-map-info-link:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.sbb-map-info-link svg {
    width: 16px;
    height: 16px;
}

.sbb-map-info-body {
    padding: 24px;
    background: #ffffff;
}

.sbb-map-info-body p {
    font-size: 16px;
    color: #666666;
    line-height: 1.6;
    margin: 0;
}

.sbb-map-info-footer {
    padding: 24px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sbb-map-info-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.sbb-map-info-icon-wrapper {
    width: 40px;
    height: 40px;
    background: #F5E6D3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sbb-map-info-icon-wrapper svg {
    width: 18px;
    height: 18px;
    color: #8B7355;
    stroke: #8B7355;
}

.sbb-map-info-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sbb-map-info-label {
    font-size: 12px;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sbb-map-info-value {
    font-size: 14px;
    color: #666666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sbb-map-info-value:hover {
    color: #1e3a5f;
}

/* Pointer - hidden for modal */
.sbb-map-info-pointer {
    display: none;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    padding: 20px;
    min-width: 250px;
}

.sbb-map-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.sbb-map-popup-content {
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
}

.sbb-map-popup-content p {
    margin: 0 0 8px 0;
}

.sbb-map-popup-content p:last-child {
    margin-bottom: 0;
}

.sbb-map-popup-content strong {
    color: #1e3a5f;
    font-weight: 600;
}

/* Custom Marker Styling */
.sbb-custom-marker {
    background: transparent !important;
    border: none !important;
    width: 20px !important;
    height: 20px !important;
}

.sbb-marker-inner {
    width: 20px;
    height: 20px;
    background: #BDD646;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    display: block;
}

.sbb-marker-inner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #1e3a5f;
    border-radius: 50%;
}

.sbb-marker-active .sbb-marker-inner {
    background: #1e3a5f;
    border-color: #BDD646;
    border-width: 4px;
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

.sbb-marker-active .sbb-marker-inner::after {
    background: #BDD646;
}

/* Ensure marker is visible */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .sbb-map-title {
        font-size: 36px;
    }
    
    .sbb-map-container {
        padding: 0 20px;
    }
    
    .sbb-map-info-box {
        max-width: 85%;
        width: 85%;
    }
}

@media (max-width: 768px) {
    .sbb-leaflet-map-section {
        padding: 60px 0;
    }
    
    .sbb-map-header {
        margin-bottom: 40px;
        padding: 0 20px;
    }
    
    .sbb-map-subtitle {
        font-size: 12px;
    }
    
    .sbb-map-title {
        font-size: 28px;
    }
    
    .sbb-map-container {
        padding: 0 20px;
    }
    
    .sbb-map-info-box {
        max-width: 95%;
        width: 95%;
    }
    
    .sbb-map-info-header {
        padding: 16px 20px;
        padding-right: 50px;
    }
    
    .sbb-map-info-title {
        font-size: 18px;
    }
    
    .sbb-map-info-body {
        padding: 20px;
    }
    
    .sbb-map-info-body p {
        font-size: 14px;
    }
    
    .sbb-map-info-footer {
        padding: 16px 20px;
    }
    
    .sbb-map-info-item {
        font-size: 13px;
    }
    
    #sbb-leaflet-map {
        border-radius: 8px;
    }
    
    .leaflet-popup-content {
        min-width: 200px;
        padding: 16px;
    }
    
    .sbb-map-popup-title {
        font-size: 18px;
    }
    
    .sbb-map-popup-content {
        font-size: 13px;
    }
}
