/* Reset spacing for full-width map */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Wrapper forces full viewport width */
.livebuses-map-wrapper {
    width: 100vw;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Leaflet map container MUST have a height */
#livebuses-map {
    width: 100%;
    height: 100%;
}

.leaflet-control-zoom {
    top: 80px !important;
}

/* Search */

.livebuses-search {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 5px;
}

#livebuses-search {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ccc;
    min-width: 150px;
}

/* Improve search layout on smaller screens */
.livebuses-search {
    flex-wrap: wrap;
    max-width: calc(100vw - 20px);
    box-sizing: border-box;
    width: max-content;
}

#livebuses-search-btn {
    padding: 8px 12px;
    font-size: 13px;
    color: #3b3b3b;
    border-radius: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
}

/* Locate Me Button */
#livebuses-location-btn {
    padding: 8px 12px;
    font-size: 13px;
    color: #3b3b3b;
    border-radius: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
}

/* Bus Marker */
.bus-marker div {
    width: 20px;
    height: 20px;
    background: rgba(34, 139, 34, 0.85);
    border: 2px solid rgba(25, 100, 25, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(50, 160, 50, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile fix */
.bus-marker {
    will-change: transform;
    transform: translateZ(0);
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.9;
    }
}

/* Route text inside marker */
.bus-route {
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    text-shadow:
        0 0 2px rgba(0, 0, 0, 0.8),
        0 0 4px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

.bus-popup {
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.bus-popup strong {
  color: #2a3f54;
}

.operator-name {
    color: #2a3f54;
    font-size: 1em;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    padding-bottom: 4px;
    margin-bottom: 6px;
    display: inline-block;
}

.bus-popup {
    min-width: 180px;
    max-width: 300px;
    white-space: normal;
    line-height: 1.4;
}

/* Theme edits */

main.wp-block-group.has-global-padding.is-layout-constrained.wp-block-group-is-layout-constrained {
    padding: 0 !important;
    margin: 0 !important;
}

main.wp-block-group .entry-content.has-global-padding {
    padding: 0 !important;
    margin: 0 !important;
}

main.wp-block-group > .wp-block-group.alignfull.has-global-padding.is-layout-constrained.wp-block-group-is-layout-constrained {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}