body, html {
    font-family: 'IBM Plex Sans', sans-serif;
    margin: 0;
    padding: 0;
}

/* Ensure all map elements use the font */
.map-title, 
.map-legend, 
.popup-content,
.legend-title,
.legend-label,
.mapboxgl-popup-content,
.mapboxgl-ctrl button {
    font-family: 'IBM Plex Sans', sans-serif;
}

#map { 
    position: absolute; 
    top: 0; 
    bottom: 0; 
    width: 100%; 
}

/* Legend Styles */
.map-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    max-width: 220px;
    z-index: 1;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-color {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.legend-label {
    font-size: 12px;
}

/* Map Title Styles */
.map-title {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 8px 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    z-index: 1;
}

/* Popup Styles */
.popup-content {
    font-family: Arial, sans-serif;
    padding: 5px;
    color: #000; /* Ensure text is dark for contrast */
}

.popup-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
}

.popup-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
    font-family: 'IBM Plex Sans', sans-serif;
    background-color: transparent;
}

.popup-table tr:nth-child(even) {
    background-color: rgba(242, 242, 242, 0.5); /* Semi-transparent light gray */
}

.popup-table td {
    padding: 4px;
    vertical-align: top;
    background-color: transparent;
}

.popup-table td:first-child {
    width: 40%;
}

/* Make popup background semi-transparent */
.mapboxgl-popup-content {
    background-color: rgba(255, 255, 255, 0.85); /* 85% opacity white background */
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

/* Optional: make the popup tip (arrow) semi-transparent too */
.mapboxgl-popup-tip {
    border-top-color: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.85);
}

.side-panel {
    position: absolute;
    top: 80px;       /* Adjust so it doesn't overlap with the title at top */
    left: 20px;      /* Keep it slightly away from the left edge */
    width: 250px;    /* Set a suitable width */
    max-height: 70%; /* Prevent overflow if the text is long */
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2;      /* Ensure it appears on top of the map */
    overflow-y: auto; /* If content is tall, scroll within the panel */
}

.side-panel h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.side-panel a {
    color: #1E88E5;   /* Match station color or your preferred link color */
    text-decoration: underline;
}

.side-panel a:hover {
    text-decoration: none;
}

/* 1) Button style inside the side panel */
.toggle-panel-btn {
    display: inline-block;
    margin: 0;
    padding: 6px 12px;
    cursor: pointer;
    background-color: #1E88E5;
    color: #fff;
    border: none;
    border-radius: 4px;
}

.toggle-panel-btn:hover {
    background-color: #1565C0;
}

.side-panel.minimized {
    width: 60px;                 /* Make it wide enough for the button's text */
    min-height: 60px;            /* A little height, so it's a neat square-ish box */
    padding: 5px;                /* Less padding to avoid big white margins */
    overflow: hidden;            /* Hide text, etc. */
    display: flex;               /* Flex container for vertical+horizontal centering */
    align-items: center;         /* Center vertically */
    justify-content: center;     /* Center horizontally */
    transition: all 0.3s ease;   /* Smooth animation */
}

/* Hide all text elements within the minimized panel */
.side-panel.minimized h2,
.side-panel.minimized p,
.side-panel.minimized a {
    display: none;
}

/* Basemap selector styles */
.basemap-control {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.basemap-select {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    min-width: 120px;
}

.basemap-select:hover {
    border-color: #999;
}

.basemap-select:focus {
    outline: none;
    border-color: #1E88E5;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.25);
}

.basemap-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}