/* UK Constituency Map (OEUK Advocacy Edition) — frontend styles */

#uk-map-container img { max-width:none !important; height:auto !important; margin:0 !important; padding:0 !important; box-shadow:none !important; border-radius:0 !important; }
#uk-map-container svg { max-width:none !important; height:auto !important; }
#uk-map-container { position:relative; z-index:0; font-family:Arial,Helvetica,sans-serif; }

/* Sidebar */
.ucm-sidebar { position:absolute; top:0; left:0; width:340px; height:100%; background:#fff; box-shadow:2px 0 8px rgba(0,0,0,.3); overflow-y:auto; padding:16px; font-size:14px; line-height:1.45; z-index:1100; display:none; }
.ucm-sidebar h2 { margin:0 0 8px; font-size:18px; padding-right:24px; }
.ucm-sidebar .close-btn { position:absolute; top:8px; right:12px; font-size:22px; font-weight:bold; cursor:pointer; color:#666; }
.ucm-sidebar img.mp-photo { float:left; margin:0 10px 6px 0; border-radius:4px; width:64px; height:auto; border:1px solid #ccc; }
.ucm-sidebar .mp-details { overflow:hidden; margin-bottom:10px; }
.ucm-sidebar .meta-row { margin:2px 0; }
.ucm-sidebar ul.member-list { padding-left:0; list-style:none; margin-top:6px; max-height:240px; overflow-y:auto; border-top:1px solid #ddd; border-bottom:1px solid #ddd; }
.ucm-sidebar ul.member-list li { margin:0; padding:5px 2px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid #f0f0f0; gap:8px; }
.ucm-sidebar .member-name { flex:1; }
.ucm-sidebar .member-sector { color:#777; font-size:12px; }
#uk-map-container .leaflet-control-container { left:340px !important; }
.leaflet-control-zoom { z-index:1200 !important; }

.ucm-section-title { font-weight:bold; margin:14px 0 6px; border-top:1px solid #e3e3e3; padding-top:10px; }

/* Pins */
.pin-btn { background:none; border:1px solid transparent; cursor:pointer; font-size:16px; padding:2px 6px; border-radius:4px; }
.pin-btn:hover { background:#f0f0f0; }
.pin-btn.active { background:#ff6b35; }
.clear-pins-btn { background:#dc3545; color:#fff; border:none; padding:6px 12px; border-radius:4px; cursor:pointer; font-size:12px; margin-top:10px; display:none; }

/* Engagement editor */
.ucm-eng { background:#f7f9fc; border:1px solid #e1e7ef; border-radius:6px; padding:10px 12px; margin-top:8px; }
.ucm-eng label { display:block; font-weight:600; font-size:12px; margin:8px 0 3px; color:#333; }
.ucm-eng select, .ucm-eng input[type=text], .ucm-eng input[type=date], .ucm-eng textarea { width:100%; box-sizing:border-box; padding:6px 8px; border:1px solid #ccc; border-radius:4px; font-size:13px; }
.ucm-eng textarea { min-height:54px; resize:vertical; }
.ucm-eng .save-eng { margin-top:10px; background:#2271b1; color:#fff; border:none; padding:8px 14px; border-radius:4px; cursor:pointer; }
.ucm-eng .save-eng:disabled { opacity:.6; cursor:default; }
.ucm-eng .eng-meta { font-size:11px; color:#888; margin-top:6px; }
.ucm-status-pill { display:inline-block; padding:1px 9px; border-radius:10px; color:#fff; font-size:12px; font-weight:600; }
.ucm-meeting-row { display:flex; gap:6px; margin-bottom:6px; }
.ucm-meeting-row input { font-size:12px; }
.ucm-add-meeting { background:none; border:1px dashed #aaa; border-radius:4px; padding:4px 8px; cursor:pointer; font-size:12px; width:100%; }
.ucm-briefing-link { display:inline-block; margin-top:10px; font-size:13px; }

/* Top controls */
#ucm-controls { position:absolute; top:10px; left:360px; right:14px; z-index:1300; display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; background:rgba(255,255,255,.96); padding:8px 12px; border-radius:6px; box-shadow:0 0 10px rgba(0,0,0,.15); font-size:14px; }
.ucm-overlay-pick label, .ucm-filter label { display:block; font-weight:bold; margin-bottom:4px; font-size:12px; }
.ucm-overlay-pick select, .ucm-filter select { padding:6px 8px; border:1px solid #ccc; border-radius:4px; font-size:13px; }
#ucm-filters { display:flex; gap:10px; flex:1; flex-wrap:wrap; }
.ucm-filter { position:relative; min-width:140px; flex:1; }
.ucm-filter input[type=text] { width:100%; box-sizing:border-box; padding:6px 8px; border:1px solid #ccc; border-radius:4px; font-size:13px; }
.ucm-filter ul { position:absolute; top:54px; left:0; right:0; max-height:220px; overflow-y:auto; background:#fff; border:1px solid #ccc; border-radius:4px; box-shadow:0 2px 6px rgba(0,0,0,.15); margin:0; padding:0; list-style:none; z-index:1400; display:none; }
.ucm-filter ul li { padding:6px 8px; cursor:pointer; }
.ucm-filter ul li:hover { background:#eee; }
.ucm-eng-hidden { display:none !important; }

/* Region summary */
.ucm-summary { position:absolute; bottom:10px; left:360px; z-index:1250; background:rgba(255,255,255,.96); border-radius:6px; box-shadow:0 0 10px rgba(0,0,0,.15); padding:8px 12px; font-size:13px; max-width:300px; }
.ucm-summary strong { display:block; margin-bottom:4px; }

/* Member count markers */
.member-count-icon { background:rgba(40,167,69,.9); color:#fff; border-radius:50%; width:22px; height:22px; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:600; border:1.5px solid #fff; box-shadow:0 1.5px 6px rgba(40,167,69,.2); line-height:22px; text-align:center; }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color:rgba(40,167,69,.9) !important; color:#fff !important; border:2px solid #fff !important; font-weight:600; }
.marker-cluster div { background-color:transparent !important; }
.marker-cluster span { font-size:14px !important; font-weight:600; color:#fff !important; }

/* Legend */
.ucm-legend { padding:8px 10px; font:13px/16px Arial,sans-serif; background:rgba(255,255,255,.92); box-shadow:0 0 15px rgba(0,0,0,.2); border-radius:5px; color:#333; max-height:420px; overflow-y:auto; }
.ucm-legend i { width:18px; height:18px; float:left; margin-right:8px; opacity:.9; border:1px solid #999; }
.ucm-legend .party-row, .ucm-legend .legend-row { display:flex; align-items:center; gap:6px; line-height:20px; }

/* Mobile bottom sheets */
#ucm-legend-panel, #ucm-backdrop, #ucm-mobile-fabs { display:none !important; }
#uk-map-container.ucm-mobile-mode #ucm-legend-panel,
#uk-map-container.ucm-mobile-mode #ucm-backdrop,
#uk-map-container.ucm-mobile-mode #ucm-mobile-fabs { display:block !important; }
#uk-map-container.ucm-mobile-mode .ucm-legend { display:none !important; }
#uk-map-container.ucm-mobile-mode .ucm-sidebar { width:100%; }
#uk-map-container.ucm-mobile-mode #uk-map-container .leaflet-control-container { left:0 !important; }

@media (max-width:768px) {
  #ucm-controls { position:absolute; left:0; right:0; top:auto; bottom:0; transform:translateY(100%); transition:transform .25s ease; max-height:80dvh; overflow-y:auto; border-radius:12px 12px 0 0; box-shadow:0 -8px 24px rgba(0,0,0,.18); flex-direction:column; z-index:3000; }
  #ucm-controls.ucm-open { transform:translateY(0); }
  #ucm-filters { flex-direction:column; }
  .ucm-filter, .ucm-overlay-pick { width:100%; }
  .ucm-summary { display:none; }
  #uk-map-container .leaflet-control-container { left:0 !important; }
  .ucm-legend { display:none !important; }
  #ucm-legend-panel { position:absolute; left:0; right:0; bottom:0; transform:translateY(100%); transition:transform .25s ease; z-index:3100; background:rgba(255,255,255,.98); border-radius:12px 12px 0 0; box-shadow:0 -8px 24px rgba(0,0,0,.18); max-height:70dvh; overflow-y:auto; padding:12px 14px; font:14px/1.4 Arial,sans-serif; }
  #ucm-legend-panel.ucm-open { transform:translateY(0); }
  #ucm-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.35); z-index:2950; opacity:0; pointer-events:none; transition:opacity .2s ease; }
  #ucm-backdrop.ucm-show { opacity:1; pointer-events:auto; }
  .ucm-fab { position:absolute; right:12px; bottom:12px; z-index:2900; display:flex; flex-direction:column; gap:10px; }
  .ucm-fab button { border:none; border-radius:22px; padding:10px 14px; background:rgba(255,255,255,.95); box-shadow:0 6px 18px rgba(0,0,0,.16); font:600 14px/1.1 Arial,sans-serif; cursor:pointer; }
  .ucm-fab.is-hidden { opacity:0; pointer-events:none; }
}
