/* Layout */
body {
    margin: 0;
    font-family: sans-serif;
    overflow: hidden;
}

#map {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: #1A1A1A;
}

a {
    color: #0066CC;
}

/* Map Overlays */
.map-overlay.top-right {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.search-row {
    display: flex;
    gap: 8px;
    position: relative;
    height: 30px;
}

.leaflet-top.leaflet-left .leaflet-control-zoom {
    margin: 0;
    position: absolute;
    top: 50px;
    left: 10px;
    width: 30px;
    height: 30px;
    border-radius: 4px;
}

/* Shared Elements */
#filter-container,
#data-display-container,
#postcode-input,
#legend-container,
#top-container {
    background: #EFF1F5;
    color: #4C4F69;
    border: 1px solid #CCD0DA;
    border-radius: 4px;
    width: max-content;
}

#filter-container,
#data-display-container {
    padding: 8px 12px;
}

#search-button,
#info-button {
    width: 30px;
    height: 30px;
    background: #C6A0F6;
    color: #000000;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#search-button:hover,
#info-button:hover {
    background: #CA9EE6;
}

/* Info Button */
#info-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

#info-button:focus-visible,
#close-info-menu:focus-visible {
    outline: 2px solid #0066CC;
    outline-offset: 2px;
}

#edm240-info-button,
#party-info-button {
    color: #0066CC;
    cursor: pointer;
}

#edm240-info-button:hover,
#party-info-button:hover {
    text-decoration: underline;
}

/* Info Menu */
#info-menu {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#info-dialog {
    position: relative;
    display: flex;
    width: 75%;
    max-height: min(88vh, 900px);
    max-height: min(88dvh, 900px);
    background: #EFF1F5;
    color: #4C4F69;
    border: 1px solid #CCD0DA;
    border-radius: 12px;
    overflow: hidden;
}

#info-content {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    padding: 28px 24px 24px;
    font-size: 15px;
    line-height: 1.55;
}

#info-content blockquote {
    margin: 4px 0 8px 12px;
    padding: 0;
    line-height: 1.6;
}


#close-info-menu {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #4C4F69;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

#close-info-menu:hover {
   font-size: 36px;
}

/* Postcode Search */
#search-container {
    display: flex;
    gap: 6px;
    height: 30px;
}

#postcode-input {
    box-sizing: border-box;
    text-transform: uppercase;
    font-weight: bold;
    max-width: 125px;
    height: 30px;
    padding: 0 12px;
}

#postcode-input.error-state {
    border-color: #FF0000;
}

#postcode-input.error-state::placeholder {
    color: #FF0000;
    opacity: 1;
}

/* Legend */
#legend-container {
    position: absolute;
    right: calc(100% + 6px);
    cursor: pointer;
}

.legend-details summary {
    padding: 4px 12px;
    line-height: 20px;
    display: list-item;
    cursor: pointer;
}

.legend-list {
    padding: 4px 12px 12px 12px;
    max-height: 25dvh;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    white-space: nowrap;
}

/* Data Box */
#data-box-content {
    margin-top: 6px;
    font-size: 14px;
}

#data-box-content p {
    margin: 4px 0;
}

/* Popup */
.popup-card {
    text-align: center;
    font-size: 14px;
    max-width: 200px;
}

.popup-card img {
    width: 70px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 3px solid;
}

.popup-card h3 {
    margin: 4px 0;
    font-size: 16px;
}

.popup-card p {
    margin: 2px 0;
    color: #555555;
}
