/**
 * CARANA UNPOL Senior Planning Exercise — Map Styling
 * Authentic Vector Operational Planning Map (P4/P5 Strategic Model)
 */

.map-container-card {
  position: relative;
  overflow: hidden;
  background: #FFFFFF;
}

.map-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
}

.deployment-map-bar {
  background: #F0F9FF;
  border-bottom: 1px solid #BAE6FD;
}

.map-layer-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selector-label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.layer-dropdown {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text-main);
  font-weight: 600;
  outline: none;
}

.layer-dropdown:focus {
  border-color: var(--un-blue-bright);
}

/* Structural Layer Toggles */
.map-structural-toggles {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-toggle-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #475569;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.map-toggle-btn:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}

.map-toggle-btn.active {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0369A1;
}

.map-disclaimer-pill {
  font-size: 10px;
  color: #64748B;
  background: #F1F5F9;
  padding: 3px 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.svg-map-wrapper {
  position: relative;
  width: 100%;
  background: #E0F2FE;
  overflow: hidden;
}

.carana-svg-map {
  width: 100%;
  height: auto;
  display: block;
}

/* Area Paths */
.map-area-path {
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-area-path:hover {
  filter: brightness(0.93);
  stroke: #0284C7;
  stroke-width: 2.5;
}

.map-area-path.selected {
  stroke: #004F8A;
  stroke-width: 3.5;
  filter: drop-shadow(0 0 6px rgba(0, 79, 138, 0.45));
}

.area-interactive-group {
  cursor: pointer;
}

.area-label-anchor {
  cursor: pointer;
  pointer-events: all;
}

.map-area-name {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 800;
  fill: #0F172A;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9), 0 0 4px #FFFFFF;
}

.map-area-name.capital-label {
  font-size: 13.5px;
  fill: #004F8A;
  font-weight: 900;
}

.map-area-type {
  font-family: var(--font-family);
  font-size: 8px;
  font-weight: 700;
  fill: #64748B;
  pointer-events: none;
  letter-spacing: 0.5px;
}

.map-town-label {
  font-family: var(--font-family);
  font-size: 9.5px;
  font-weight: 600;
  fill: #0F172A;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.fpu-text {
  font-size: 8px;
  font-weight: bold;
  fill: #FFFFFF;
  text-anchor: middle;
  font-family: monospace;
}

/* Floating Legend Card */
.map-legend-card {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  box-shadow: var(--shadow-md);
  font-size: 10.5px;
  min-width: 180px;
  max-width: 250px;
  pointer-events: none;
  z-index: 10;
}

.legend-header {
  margin-bottom: 4px;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 3px;
}

.legend-title {
  font-weight: 700;
  color: #1E293B;
  text-transform: uppercase;
  font-size: 9.5px;
}

.legend-scale {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 10px;
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* Deployment Map Popover */
.deployment-map-popover {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: #FFFFFF;
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  min-width: 210px;
  max-width: 280px;
  z-index: 10;
  overflow: hidden;
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #F0F9FF;
  border-bottom: 1px solid #BAE6FD;
  font-size: 11px;
}

.popover-body {
  padding: 8px 10px;
}

.popover-streams-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stream-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #334155;
  border-bottom: 1px dashed #F1F5F9;
  padding-bottom: 2px;
}

.stream-stat-row:last-child {
  border-bottom: none;
}

.stream-name {
  color: #64748B;
}

.stream-val {
  color: #0284C7;
}

/* Compact map variant for Decision Brief */
.compact-map .carana-svg-map {
  max-height: 280px;
}
