/**
 * Location Filter Component (Län & Kommun)
 * Two-column layout for hierarchical location selection
 */

/* Wide dropdown for two-column layout */
.jfilters__dropdown-menu--wide {
  min-width: 700px;
  max-width: 800px;
}

/* Two-column container */
.location-filter {
  display: flex;
  gap: 0;
  height: 420px;
  background: #fff;
}

/* Left column: Counties */
.location-filter__counties {
  flex: 0 0 280px;
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
  padding: 12px 0;
}

/* Right column: Municipalities */
.location-filter__municipalities {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* Heading styles */
.location-filter__heading {
  margin: 0 0 12px 0;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* County list */
.county-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* County item */
.county-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-left: 3px solid transparent;
}

.county-list__item:hover {
  background: #e9ecef;
}

.county-list__item.is-active {
  background: #e7f5ff;
  border-left-color: #228be6;
  font-weight: 500;
}

.county-list__item--foreign {
  margin-top: 10px;
  border-top: 1px solid #cfd8e3;
  background: #f2f6fb;
}

.county-list__item--foreign:hover {
  background: #e8f0f9;
}

.county-list__name {
  font-size: 14px;
  color: #212529;
}

.county-list__count {
  font-size: 12px;
  color: #6c757d;
}

/* Municipality header with actions */
.municipality-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  flex-shrink: 0;
}

.municipality-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Checkbox label for "Välj alla" */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #495057;
  cursor: pointer;
  margin: 0;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

/* Clear button */
.btn-clear-municipalities {
  padding: 4px 12px;
  font-size: 13px;
  color: #dc3545;
  background: transparent;
  border: 1px solid #dc3545;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-municipalities:hover {
  background: #dc3545;
  color: #fff;
}

.btn-clear-municipalities:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-apply-municipalities {
  padding: 4px 12px;
  font-size: 13px;
  color: #fff;
  background: #198754;
  border: 1px solid #198754;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-apply-municipalities:hover {
  background: #157347;
  border-color: #146c43;
}

/* Municipality list container */
.municipality-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
}

/* Municipality list item */
.municipality-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.municipality-list__item:hover {
  background: #f8f9fa;
}

/* Municipality checkbox container */
.municipality-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
}

.municipality-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #28a745;
}

.municipality-checkbox label {
  font-size: 14px;
  color: #212529;
  cursor: pointer;
  margin: 0;
}

/* Municipality job count */
.municipality-count {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
}

/* Placeholder when no county selected */
.municipality-list__placeholder {
  padding: 40px 16px;
  text-align: center;
  color: #868e96;
  font-size: 14px;
  font-style: italic;
}

/* Loading state */
.municipality-list__loading {
  padding: 40px 16px;
  text-align: center;
  color: #868e96;
  font-size: 14px;
}

/* Empty state */
.municipality-list__empty {
  padding: 40px 16px;
  text-align: center;
  color: #868e96;
  font-size: 14px;
}

/* Custom scrollbar for lists */
.location-filter__counties::-webkit-scrollbar,
.municipality-list::-webkit-scrollbar {
  width: 8px;
}

.location-filter__counties::-webkit-scrollbar-track,
.municipality-list::-webkit-scrollbar-track {
  background: #f1f3f5;
}

.location-filter__counties::-webkit-scrollbar-thumb,
.municipality-list::-webkit-scrollbar-thumb {
  background: #adb5bd;
  border-radius: 4px;
}

.location-filter__counties::-webkit-scrollbar-thumb:hover,
.municipality-list::-webkit-scrollbar-thumb:hover {
  background: #868e96;
}

/* Responsive: Stack columns on smaller screens */
@media (max-width: 768px) {
  .jfilters__dropdown-menu--wide {
    min-width: 100%;
    max-width: 100%;
  }

  .location-filter {
    flex-direction: column;
    height: auto;
    max-height: 420px;
  }

  .location-filter__counties {
    flex: 0 0 auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
  }

  .location-filter__municipalities {
    flex: 1;
    min-height: 220px;
  }
}
