/* regional.html styles */

body {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  color: #252a53;
  margin: 0;
  padding: 40px 40px 40px 40px;
  display: flex;
  flex-direction: column;
  justify-content: top;
  height: 100vh;
}

.main-content {
  padding: 80px 0px 40px 0px;
  flex-grow: 1;
  display: flex;
  align-items: top;
  justify-content: center;
}

.hidden {
  display: none !important;
}

.region-left {
  width: 40%;
  background: white;
  padding: 20px;
  font-size: 12px;
}

.region-right {
  padding: 20px;
  width: 60%;
  font-size: 12px;
}

.dropdown-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 12px;
}

.dropdown-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.map-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  color: #252a53;
  flex: 1;
}

.map-dropdown label {
  font-size: 14px;
  font-weight: 700;
  color: #252a53;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.map-dropdown select {
  appearance: none;
  background: white;
  border: 1px solid #f5f5f5;
  border-radius: 0;
  padding: 8px 24px 8px 8px;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  color: #252a53;
  cursor: pointer;
  transition: background-color 0.2s ease;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23252a53' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 12px;
  height: 32px;
}

.map-dropdown select:hover {
  background-color: #f5f5f5;
}

.map-dropdown select:focus {
  outline: none;
  background-color: #252a53;
  color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

.map-dropdown select.searching {
  opacity: 0.6;
  pointer-events: none;
  background-color: #f5f5f5;
  color: #666;
}

.map-dropdown select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f5f5f5;
  color: #666;
}

.map-instruction {
  font-size: 12px;
  color: #666;
  margin: 10px 0;
  text-align: center;
}

#region-title {
  font-size: 18px;
  font-weight: 700;
  color: #252a53;
  margin: 15px 0 10px 0;
  padding: 0;
  background: none;
  border: none;
  min-height: auto;
}

#region-title:empty {
  display: none;
}

#map-container {
  width: 100%;
  height: 65vh;
  position: relative;
  border: 1px solid #ddd;
  margin: 10px 0;
}

.loading-indicator {
  display: none;
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}

.loading .loading-indicator {
  display: block;
}

.map-dropdown select option {
  padding: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
}

.region-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.region-tabs button:not(:last-child) {
  margin-right: 2px;
}

.region-tabs button {
  flex: 1;
  cursor: pointer;
  color: #252a53;
  background-color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 0.5rem 1rem;
  transition: background-color 0.2s ease-in-out;
  border: 3px solid #252a53;
  height: 44px;
}

.region-tabs button:hover, .region-tabs button.active {
  background-color: #252a53;
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.regional_development_tags,
.regional_migration_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
}

.regional_development_tags button,
.regional_migration_tags button {
  background: #eee;
  border: 1px solid #252a53;
  padding: 10px 16px;
  cursor: default;
  font-size: 12px;
  text-align: center;
  color: #252a53;
  transition: transform 0.3s ease;
}

.score-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  max-width: 100%;
}

.card {
  background: #eee;
  padding: 4px;
  text-align: center;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card h3 {
  margin: 0;
}

.card p {
  margin-top: 2px;
  font-weight: bold;
}

.total {
  background: #eee;
  color: #252a53;
  border: 1px solid #252a53;
}

.migration_projections_controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.migration-breakby label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  margin-bottom: 6px;
  display: block;
}

.migration-breakby-buttons {
  display: flex;
  gap: 6px;
}

.migration-breakby-btn {
  background: #eee;
  border: 1px solid #252a53;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 11px;
  color: #252a53;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.2s ease;
}

.migration-breakby-btn.active {
  background: #252a53;
  color: white;
  font-weight: 600;
}

.migration-multiselect {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.migration-multiselect label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  margin-right: 4px;
}

.migration-toggle-btn {
  padding: 6px 12px;
  border: 1px solid #252a53;
  background: #eee;
  cursor: pointer;
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
  color: #252a53;
  transition: all 0.2s ease;
}

.migration-toggle-btn.active {
  color: white;
  font-weight: 600;
}

.migration-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.migration-filter-group {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
}

.migration-filter-group label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  margin-bottom: 4px;
}

.migration-filter-group select {
  appearance: none;
  background: white;
  border: 1px solid #ccc;
  padding: 6px 8px;
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
  color: #252a53;
  cursor: pointer;
}

.migration-projection,
.migration-pyramid {
  display: none;
}

.migration-projection.show,
.migration-pyramid.show {
  display: block;
}

.plot-container {
  position: relative;
  overflow: hidden;
}

.plot-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.slider-container {
  display: flex;
  flex-direction: column;
  align-items: left;
  margin-top: 20px;
  margin-right: 50px;
  width: 100%;
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #ddd;
  border-radius: 5px;
  outline: none;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 5px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #4a3b55;
  border-radius: 50%;
  cursor: pointer;
  background-size: cover;
}

.explore-comparable button {
  font-weight: 400;
  display: flex;
  padding: 6px;
  cursor: pointer;
  width: 100%;
  color: #252a53;
  font-size: 12px;
  background-color: white;
  transition: background-color 0.2s ease-in-out;
  border: 1px solid #252a53;
  align-items: center;
}

.explore-comparable button:hover {
  background-color: #252a53;
  color: white;
  font-weight: 700;
}

.explore-comparable {
  display: none;
}

.explore-comparable.show {
  display: block;
}

.deck-widget {
  --button-size: 36px;
}

.deck-tooltip {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: white !important;
  background-color: #252a53 !important;
}

.policy-filter-section {
  margin-bottom: 20px;
}

.policy-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.policy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-bottom: 15px;
}

.policy-tag-button {
  background: #eee;
  border: 1px solid #252a53;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
  color: #252a53;
  transition: all 0.3s ease;
  border-radius: 4px;
  font-weight: 400;
}

.policy-tag-button:hover {
  transform: translateY(-2px);
  background-color: #f5f5f5;
}

.policy-tag-button.active {
  background: #252a53;
  color: white;
  font-weight: 600;
}

.policy-scope-button {
  background: #e8f4f8;
  border: 1px solid #4a90a4;
  color: #2c5f6f;
}

.policy-scope-button:hover {
  background-color: #d0e9f0;
}

.policy-scope-button.active {
  background: #4a90a4;
  color: white;
}

.policy-origin-button {
  background: #f6e3dd;
  border: 1px solid #ac5737;
  color: #6e2f1e;
}

.policy-origin-button:hover {
  background-color: #edc9bc;
}

.policy-origin-button.active {
  background: #ac5737;
  color: white;
}

.policy-summaries {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.policy-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.policy-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: #252a53;
}

.policy-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.policy-card-tag {
  background: #252a53;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 500;
}

.policy-card-summary {
  font-size: 13px;
  line-height: 1.4;
  color: #333;
}

.policy-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.policy-modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 8px;
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.policy-modal-close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.policy-modal-close:hover {
  color: #252a53;
  background-color: #f5f5f5;
}

.policy-modal-title {
  font-family: 'Lora', serif;
  font-size: 20px;
  font-weight: 700;
  color: #252a53;
  margin-bottom: 15px;
  padding-right: 40px;
}

.policy-modal-description {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 20px;
}

.policy-modal-meta {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.policy-modal-meta-item {
  margin-bottom: 10px;
  font-size: 12px;
  display: block;
}

.policy-modal-meta-label {
  font-weight: 600;
  color: #252a53;
  display: inline-block;
  min-width: 120px;
  margin-right: 8px;
}

.policy-modal-link {
  display: inline-block;
  background: #252a53;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.policy-modal-link:hover {
  background: #1a1e3a;
}

.no-policies-message {
}

.policy-count {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 500;
}

@media (max-width: 1600px) {
  body {
    background-size: 48% 26%;
  }
}

@media (max-width: 1200px) {
  .dropdown-container {
    gap: 0.75rem;
  }

  .dropdown-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .map-dropdown {
    flex: none;
  }

  #map-container {
    height: 50vh;
  }
}

@media (max-width: 768px) {
  .region-left {
    padding: 1.5rem;
  }

  .dropdown-container {
    gap: 0.5rem;
  }

  .map-dropdown select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 13px;
  }

  #region-title {
    font-size: 18px;
    padding: 0.5rem 0.75rem;
  }

  #map-container {
    height: 40vh;
  }
}

.corner-feedback {
  position: fixed;
  top: 160px;
  right: 20px;
  background: #ac5737;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  z-index: 1000;
  animation: pulse-glow 2s infinite;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  font-family: 'Montserrat', sans-serif;
  display: none;
}

.corner-feedback.visible {
  display: block;
}

.corner-feedback:hover {
  background: #8b4429;
  animation: none;
  transform: scale(1.05);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(172, 87, 55, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px rgba(172, 87, 55, 0.8);
    transform: scale(1.02);
  }
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  transition: transform 0.3s ease;
  position: relative;
}

.popup-overlay.active .popup-content {
  transform: scale(1);
}

.popup-subtitle {
  color: #252a53;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.form-iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.popup-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #e2e6f0;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  color: #252a53;
  transition: background-color 0.3s ease;
}

.popup-close-btn:hover {
  background: #d4d8e3;
}

.popup-option-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #f8f9fb;
  color: #252a53;
  text-decoration: none;
  border-radius: 4px;
  border: 2px solid #e2e6f0;
  transition: all 0.3s ease;
  font-weight: 500;
  font-family: 'Montserrat', sans-serif;
}

.popup-option-button:hover {
  background-color: #252a53;
  color: white;
  border-color: #252a53;
}
