
.legend-fp {
    margin-top: 5px;
}
.legend-fp ul {
    list-style: none;
    padding-left: 0;
}
.legend-fp li {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}
.legend-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    border: 1px solid #333;
}
.legend-subtitle {
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
}


/* =======================================================================
*  For USACE popup
*  ======================================================================= */

/* Bigger title text inside USACE modal header */
#usaceModalTitle {
    font-size: 18px;
    font-weight: 600;
}

/* Keep Leaflet popups (the small ones) above the header */
.leaflet-popup-pane {
    z-index: 10000;
}

/* Fullscreen backdrop for USACE modal */
.hydro-usace-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;              /* will be changed to flex when opened */
    align-items: center;        /* vertical center */
    justify-content: center;    /* horizontal center */
    z-index: 20000;             /* higher than header and map */
}

/* Center modal box */
.hydro-usace-modal {
    background: #ffffff;
    width: min(1000px, 90vw);   /* responsive width, never over 1000px */
    max-height: 80vh;           /* at most 80% window height */
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

/* Title row */
.hydro-usace-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #dddddd;
    font-weight: bold;
    font-size: 14px;
}

/* Close button */
.hydro-usace-close-btn {
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
}

/* Scrollable content area */
.hydro-usace-modal-body {
    padding: 10px 14px;
    overflow-y: auto;   /* scroll only when content really higher than 80vh */
    flex: 1 1 auto;
}

/* SVG container */
.dam-popup-body {
    width: 100%;
    text-align: center;
    /* Use flex to center the SVG and force it to use full width */
    display: flex;
    justify-content: center;
}

/* Make SVG strictly follow container size */
.dam-popup-body svg {
    display: block;
    width: 100%;        /* fill modal body width */
    height: auto;       /* keep aspect ratio */
    max-height: 60vh;   /* ensure SVG itself will not exceed ~60% viewport height */
}

/* Three-column info table in USACE modal */
.usace-info-table {
    width: auto;
    border-collapse: collapse;
    margin: 4px 0 8px 0;
    font-size: 13px;
}

.usace-info-table td {
    border: none;             /* no borders */
    padding: 0px 12px 2px 0;  /* small spacing */
    text-align: left;         /* left align all cells */
    vertical-align: top;
    white-space: nowrap;
}

.usace-info-label {
    font-weight: bold;
    color: #222;
}

.usace-info-datetime {
    white-space: nowrap;
    font-size: 11px;
    color: #555;
}
