:root {
  --primary: #19253685;
  --background: #f0f4f8;
  --panel-bg: #ffffff;
  --border: #dce4ec;
  --highlight: #f5f9ff;
  --map-fill: #dbe5f5;
  --map-hover: #b6cbf5;
  --map-selected: #7080c0;
}

* {
  box-sizing: border-box;
}

/* Prevent browser default focus outline on SVG paths */
.map-state:focus,
.map-state:focus-visible {
  outline: none;
}


/*
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0; 
  background: var(--background);
  color: #1a202c;
}
*/

.custom-map {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/*header {
  margin-bottom: 16px;
}*/

/*
h1 {
  color: var(--primary);
  margin: 0;
}

.subtitle {
  margin: 4px 0 0;
  color: #4a5568;
}
*/

.layout {
  display: grid;
  grid-template-columns: 4fr 1fr;
  gap: 20px;
}

.map-column,
.info-column, 
.dist-column{
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.dist-column{
	grid-column-start: 1;
	grid-column-end: 3;
}
	
.map-wrapper {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: radial-gradient(circle at 30% 30%, #f8fbff, #f1f6ff);
  padding: 12px;
}

.map-container {
  width: 100%;
  height: 100%;
}

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

.map-state {
  fill: var(--map-fill);
  stroke: #b7c5de;
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

.map-state:hover {
  fill: var(--map-hover);
  stroke: #9fb4dc;
}

.map-state.selected {
  fill: var(--map-selected);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
}

.selected-outline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none; /* so clicks go to the real map */
}

/* 2 check */
/* Outline clone drawn in #selectionOverlay */
/*
.selected-outline {
  fill: none !important;
  stroke: var(--primary, #1d3557) !important;
  stroke-width: 3 !important;
  stroke-linejoin: round !important;
  stroke-linecap: round !important;
  pointer-events: none !important;
}
*/


/* Custom keyboard focus style */
.map-state.kb-focus {
  stroke: var(--primary);
  stroke-width: 2.5;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.12));
}

.map-state.selected.kb-focus {
  stroke-width: 2.5; /* keep same, no extra */
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.12));
}



.state-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--primary);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.state-tooltip.visible {
  opacity: 1;
}

.states-panel,
.distributors-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fcfeff;
}

.panel-header {
  background: var(--highlight);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
  color: var(--primary);
}

.state-list {
  list-style: none;
  margin: 0;
  padding: 0;
  /*max-height: 320px;*/
  max-height: 500px;
  overflow-y: auto;
}

.state-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.state-item:last-child {
  border-bottom: none;
}

.state-item:hover {
  background: #eef3fa;
}

.state-item.selected {
  background: #e3ecfa;
  color: var(--primary);
  font-weight: 600;
}

.distributor-content {
  padding: 14px;
  min-height: 120px;
}

.distributor-title {
  margin: 0 0 8px;
  font-weight: 600;
}

.distributor-list {
  margin: 0;
  padding-left: 18px;
  color: #2d3748;
}

.distributor-list li {
  margin-bottom: 6px;
}

.empty-state {
  margin: 0;
  color: #718096;
}

.map-state:focus {
  outline: none;
  stroke: var(--primary);
  stroke-width: 3;
}

.map-state:focus-visible {
  stroke: var(--primary);
  stroke-width: 3;
  filter: drop-shadow(0 0 0 rgba(0,0,0,0));
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .map-wrapper {
    min-height: 260px;
  }

  .dist-column{
    grid-column-start: 1;
    grid-column-end: 1;
  }
	
	.state-list {
		max-height: 320px;
	}

}

@media (max-width: 600px) {
  .map-wrapper {
    padding: 8px;
  }
}