html,
body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden;
  width: 100%;
  height: 100%;
}


.buttons-text-adjustment {
  user-select: none;
  color: white;
  font-size: 0.5px;
  line-height: 20%;
}

/* ===== TOOLTIP STYLES ===== */
.tooltip {
  position: absolute;
  pointer-events: none;
  background: white;
  border: 2px solid #333;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  font-size: 14px;
  max-width: 90vw; /* Prevent tooltip from being wider than viewport on mobile */
}

/* Mobile tooltip adjustments */
@media screen and (max-width: 768px) {
  .tooltip {
    max-width: 95vw;
    padding: 6px;
    font-size: 12px;
  }
  
  /* Ensure bar chart containers don't overflow */
  .tooltip table {
    width: 100%;
    table-layout: auto;
  }
  
  /* Prevent text overflow in tooltip cells */
  .tooltip td,
  .tooltip th {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Ensure bar chart rows have adequate spacing */
  .tooltip tr {
    line-height: 1.4;
  }
  
  /* Add extra bottom padding to rows containing bar charts */
  .tooltip tr td[colspan="2"] {
    padding-bottom: 4px !important;
  }
}

.tooltip table {
  border-collapse: collapse;
  min-width: 200px;
}

.tooltip th {
  padding: 8px 12px;
  text-align: center;
  font-weight: bold;
  border-radius: 4px;
}

.tooltip td {
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
}

.tooltip tr:last-child td {
  border-bottom: none;
}

/* ===== ONBOARDING STYLES ===== */

#onboardingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
      #AA151B 0%,
      #C41E3A 25%,
      #F1BF00 50%,
      #C41E3A 75%,
      #AA151B 100%);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.8s ease;
}

#onboardingOverlay.hidden {
  animation: fadeOut 0.5s ease forwards;
}

.onboarding-container {
  background: white;
  border-radius: 24px;
  padding: 50px 40px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  animation: slideUpBig 0.8s ease;
}

@keyframes slideUpBig {
  from {
    transform: translateY(80px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.onboarding-header {
  text-align: center;
  margin-bottom: 40px;
}

.flag-icon-large {
  width: 120px;
  height: auto;
  margin-bottom: 20px;
  animation: floatFlag 3s ease-in-out infinite;
}

@keyframes floatFlag {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

.onboarding-header h1 {
  color: #AA151B;
  margin: 0 0 10px 0;
  font-size: 2.5em;
  font-weight: bold;
}

.onboarding-header .subtitle {
  color: #666;
  font-size: 1.2em;
  margin: 10px 0;
}

.onboarding-content {
  margin: 40px 0;
}

.instruction-card {
  display: flex;
  align-items: flex-start;
  gap: 25px;
  margin-bottom: 35px;
  padding: 25px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 16px;
  border-left: 5px solid #F1BF00;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.instruction-card:hover {
  transform: translateX(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.instruction-number {
  background: linear-gradient(135deg, #AA151B 0%, #C41E3A 100%);
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(170, 21, 27, 0.3);
}

.instruction-text h3 {
  color: #333;
  margin: 0 0 10px 0;
  font-size: 1.4em;
}

.instruction-text p {
  color: #666;
  margin: 0;
  line-height: 1.6;
  font-size: 1em;
}

.onboarding-footer {
  text-align: center;
  margin-top: 40px;
}

.footer-note {
  color: #888;
  font-style: italic;
  margin-bottom: 25px;
  font-size: 1.05em;
}

.onboarding-button {
  padding: 18px 50px;
  font-size: 1.2em;
  background: linear-gradient(135deg, #AA151B 0%, #C41E3A 100%);
  box-shadow: 0 6px 20px rgba(170, 21, 27, 0.3);
}

.onboarding-button:hover {
  background: linear-gradient(135deg, #C41E3A 0%, #AA151B 100%);
  box-shadow: 0 8px 25px rgba(170, 21, 27, 0.4);
  transform: translateY(-3px);
}

/* ===== CRITERIA SELECTOR STYLES ===== */

/* Popup Overlay */
#criteriaOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
      #AA151B 0%,
      /* Start Red */
      #AA151B 25%,
      /* End Red at 25% */
      #F1BF00 25%,
      /* Start Yellow immediately */
      #F1BF00 75%,
      /* End Yellow at 75% */
      #AA151B 75%,
      /* Start Red immediately */
      #AA151B 100%
      /* End Red */
    );
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease;
}

.flag-icon {
  width: 80px;
  /* Adjust this to make it larger/smaller */
  height: auto;
  /* Maintains the correct aspect ratio */
  vertical-align: middle;
  /* Aligns the flag nicely with text */
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#criteriaOverlay.hidden {
  animation: fadeOut 0.5s ease;
  pointer-events: none;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* Popup Container */
.criteria-container {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.6s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.criteria-header {
  text-align: center;
  margin-bottom: 30px;
}

.criteria-header h1 {
  color: #3070B3;
  margin: 0 0 10px 0;
  font-size: 2em;
}

.criteria-header p {
  color: #666;
  margin: 5px 0;
  font-size: 1em;
}

.step-indicator {
  text-align: center;
  margin-bottom: 25px;
  color: #14519A;
  font-weight: bold;
  font-size: 1.1em;
}

.selection-count {
  text-align: center;
  margin-top: 15px;
  color: #3070B3;
  font-size: 0.95em;
  font-weight: 500;
}

/* Criteria Grid */
.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.criterion-card {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
}

.criterion-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.criterion-card.selected {
  background: linear-gradient(135deg,
      #ff9985 0%,
      /* Desaturated Salmon Red */
      #ffc68c 100%
      /* Soft Apricot Orange */
    );
  border-color: "orange";
  color: black;
  animation: pulse 0.3s ease;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.criterion-icon {
  font-size: 2em;
  margin-bottom: 10px;
}

.criterion-name {
  font-size: 0.9em;
  font-weight: 500;
}

.selection-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ffd700;
  color: #333;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

/* Ranking Section */
.ranking-section {
  display: none;
  animation: slideUp 0.5s ease;
}

.ranking-section.active {
  display: block;
}

/* Pairwise Comparison Styles */
.comparison-progress {
  margin-bottom: 30px;
  text-align: center;
}

.progress-text {
  color: #3070B3;
  font-weight: 600;
  font-size: 1em;
  margin-bottom: 10px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3070B3 0%, #14519A 100%);
  transition: width 0.4s ease;
  width: 0%;
}

.pairwise-container {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 20px;
  padding: 35px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.comparison-question {
  text-align: center;
  color: #333;
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 30px;
}

.criteria-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
}

.criterion-display {
  background: white;
  border: 3px solid #e9ecef;
  border-radius: 16px;
  padding: 30px 25px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.criterion-display.selected {
  border-color: #3070B3;
  background: linear-gradient(135deg, #3070B320 0%, #14519A20 100%);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
  transform: scale(1.02);
}

.criterion-display-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.criterion-display-name {
  font-size: 1.1em;
  font-weight: 600;
  color: #333;
}

.vs-divider {
  font-size: 1.5em;
  font-weight: bold;
  color: #999;
}

.importance-scale {
  margin-bottom: 30px;
}

.importance-label {
  text-align: center;
  color: #666;
  font-size: 0.95em;
  margin-bottom: 15px;
  font-weight: 500;
}

.scale-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.scale-option {
  background: white;
  border: 3px solid #e9ecef;
  border-radius: 12px;
  padding: 20px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.scale-option:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: #3070B3;
}

.scale-option.selected {
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  border-color: #3070B3;
  color: white;
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.scale-option.selected .scale-value,
.scale-option.selected .scale-label {
  color: white;
}

.scale-value {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
  line-height: 1;
}

.scale-label {
  font-size: 0.9em;
  font-weight: 600;
  color: #666;
  line-height: 1.2;
}

.comparison-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 10px;
}

.comparison-buttons .action-button {
  flex: 0 1 auto;
  min-width: 250px;
  margin-top: 0;
  padding: 18px 40px;
  font-size: 1.15em;
}

/* Results Section */
.results-section {
  animation: slideUp 0.5s ease;
}

.results-section h3 {
  text-align: center;
  color: #3070B3;
  margin-bottom: 25px;
  font-size: 1.5em;
}

#weightsList {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.weight-item {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.weight-rank {
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  color: white;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  font-weight: bold;
  flex-shrink: 0;
}

.weight-icon {
  font-size: 2em;
  flex-shrink: 0;
}

.weight-details {
  flex-grow: 1;
}

.weight-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  font-size: 1em;
}

.weight-bar-container {
  background: #e9ecef;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.weight-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3070B3 0%, #14519A 100%);
  border-radius: 6px;
  transition: width 0.6s ease;
}

.weight-percentage {
  color: #3070B3;
  font-weight: 600;
  font-size: 1.1em;
  flex-shrink: 0;
}

.ranking-item {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  cursor: move;
  position: relative;
}

.ranking-item:hover {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ranking-item:hover .delete-btn {
  opacity: 1;
}

.drag-handle {
  color: #999;
  font-size: 1.2em;
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.delete-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.5em;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.delete-btn:hover {
  background: #cc0000;
  transform: translateY(-50%) scale(1.1);
}

.ranking-number {
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  color: white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  font-weight: bold;
  flex-shrink: 0;
}

.ranking-icon {
  font-size: 2em;
  flex-shrink: 0;
}

.ranking-details {
  flex-grow: 1;
}

.ranking-name {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.ranking-weight {
  color: #3070B3;
  font-size: 0.9em;
}

/* Button */
.action-button {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.action-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.secondary-button {
  background: #6c757d;
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.secondary-button:hover {
  box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}

.button-group .action-button {
  margin-top: 0;
}

/* ===== MAP SECTION STYLES ===== */

/* Map Section */
#mapSection {
  display: block;
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

#mapContainer {
  position: absolute;
  top: 0;
  left: 0;
  right: 320px;
  /* Leave space for sidebar */
  bottom: 0;
  width: calc(100% - 320px);
  height: 100%;
  background: radial-gradient(circle, rgb(151, 182, 249) 0%, rgb(175, 210, 255) 50%, rgb(151, 182, 249) 100%);
  transition: right 0.3s ease, width 0.3s ease;
}

#criteriaPanel.minimized~#mapContainer {
  right: 0;
  width: 100%;
}

#mapContainer svg {
  width: 100%;
  height: 100%;
}

/* Fancy Map Update Animation */
@keyframes mapUpdatePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    transform: scale(1);
  }

  25% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.6);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    transform: scale(1);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    transform: scale(1);
  }
}

@keyframes mapUpdateFlash {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.95;
  }
}

@keyframes mapUpdateGlow {

  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.1);
  }
}

.map-updating {
  animation:
    mapUpdatePulse 0.4s ease-out,
    mapUpdateFlash 0.05s ease-in-out,
    mapUpdateGlow 0.4s ease-in-out;
  position: relative;
}

.map-updating::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle,
      rgba(170, 21, 27, 0.45) 0%,
      /* Yellow Center */
      rgba(241, 191, 0, 0.45) 50%,
      /* Red Edges */
      rgba(170, 21, 27, 0.45) 100%
      /* Red Edges */
    );
  animation: mapUpdateOverlay 1.3s ease-out;
  pointer-events: none;
  z-index: 1;
}

@keyframes mapUpdateOverlay {
  0% {
    opacity: 0;
    transform: scale(1.01);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }

  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

/* Criteria Panel Sidebar */
#criteriaPanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  /* Very high z-index when maximized to be above all elements */
  transition: transform 0.3s ease, z-index 0s;
}

#criteriaPanel.minimized {
  transform: translateX(320px);
  z-index: 1000;
  /* Lower z-index when minimized */
  transition: transform 0.3s ease, z-index 0s 0.3s;
  /* Delay z-index change until after slide */
}

#panelContent {
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

.toggle-panel-btn {
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 80px;
  background: #3070B3;
  border: none;
  border-radius: 8px 0 0 8px;
  color: white;
  font-size: 18px;
  cursor: pointer;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.toggle-panel-btn:hover {
  background: #14519A;
}

#toggleIcon {
  transition: transform 0.3s ease;
}

#criteriaPanel.minimized #toggleIcon {
  transform: rotate(180deg);
}

.panel-header {
  margin-bottom: 25px;
  border-bottom: 2px solid #3070B3;
  padding-bottom: 15px;
}

.panel-header h3 {
  margin: 0 0 5px 0;
  color: #3070B3;
  font-size: 1.5em;
}

.panel-subtitle {
  margin: 0;
  color: #666;
  font-size: 0.9em;
}

/* Filter Toggle */
.filter-toggle {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 8px;
}

.filter-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-option:hover {
  border-color: #3070B3;
  background: #f0f0ff;
}

.filter-option input[type="radio"] {
  display: none;
}

.filter-option input[type="radio"]:checked+span {
  color: #3070B3;
  font-weight: 600;
}

.filter-option:has(input[type="radio"]:checked) {
  border-color: #3070B3;
  background: #f0f0ff;
}

.filter-option span {
  font-size: 0.9em;
  transition: color 0.2s ease;
}

/* Season Selector */
.season-selector {
  margin-top: 8px;
  margin-bottom: 8px;
  margin-left: 32px;
  /* Indent to align with checkbox content */
  padding: 10px;
  background: #f0f0ff;
  border-left: 3px solid #3070B3;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.season-selector.inline-with-climate {
  /* Additional styling when positioned below climate checkbox */
  margin-top: 4px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f0f0ff 0%, #f8f9fa 100%);
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.season-label {
  font-size: 0.85em;
  font-weight: 600;
  color: #333;
}

.season-select {
  padding: 8px 12px;
  border: 2px solid #3070B3;
  border-radius: 6px;
  background: white;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.season-select:hover {
  border-color: #14519A;
  background: #f0f0ff;
}

.season-select:focus {
  border-color: #14519A;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.panel-section {
  margin-bottom: 25px;
}

.panel-section h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.1em;
  font-weight: 600;
}

/* Checkbox List */
#criteriaCheckboxList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.criterion-checkbox-item {
  display: flex;
  align-items: center;
  padding: 6px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.criterion-checkbox-item:hover {
  background: #e9ecef;
  transform: translateX(-3px);
}

.criterion-checkbox-item.selected {
  background: linear-gradient(135deg, #ff9985 0%, #ffc68c 100%);
  border-color: #3070B3;
}

.criterion-checkbox-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.criterion-checkbox-item input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.criterion-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 0.95em;
  font-weight: 500;
}

.criterion-checkbox-icon {
  font-size: 1.3em;
}

/* Weight Sliders */
#criteriaWeightsList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.weight-slider-item {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
}

.weight-slider-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.weight-slider-icon {
  font-size: 1.2em;
}

.weight-slider-name {
  flex: 1;
  font-size: 0.9em;
  font-weight: 600;
  color: #333;
}

.weight-slider-value {
  font-size: 0.9em;
  font-weight: bold;
  color: #3070B3;
  min-width: 45px;
  text-align: right;
}

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

.weight-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.weight-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: none;
}

/* ===== INFO PANEL (Main Header/Title Panel) ===== */
#infoPanel {
  position: absolute;
  left: 20px;
  top: 10px;
  width: 260px;
  background: white;
  padding: 15px;
  opacity: 0.95;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

/* Info Panel Header */
.info-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.info-header .flag-icon {
  width: 40px;
  height: auto;
}

.info-title {
  margin: 0;
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1.3;
}

.info-description {
  margin: 5px 0;
  font-size: 0.9em;
  line-height: 1.4;
}

.info-credits {
  margin: 5px 0;
  font-size: 0.85em;
  line-height: 1.4;
  color: #666;
}

.credits-subtitle {
  display: inline;
}

/* Generic text styles within info panel */
#infoPanel h2 {
  margin: 0 0 10px 0;
  font-size: 1.2em;
}

#infoPanel p {
  margin: 5px 0;
  font-size: 0.9em;
}

/* ===== CITY SEARCH BOX ===== */
#citySearchContainer {
  margin-bottom: 15px;
  position: relative;
}

#citySearchInput {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #3070B3;
  border-radius: 8px;
  font-size: 0.9em;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#citySearchInput:focus {
  border-color: #14519A;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#citySearchInput::placeholder {
  color: #999;
}

#citySearchResults {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #3070B3;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#citySearchResults.active {
  display: block;
}

.search-result-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 0.9em;
}

.search-result-item:hover {
  background: #f0f0ff;
}

.search-result-item:last-child {
  border-radius: 0 0 6px 6px;
}

/* ===== ZOOM CONTROLS ===== */
#zoomControls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.zoom-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: #3070B3;
  color: white;
  font-size: 20px;
  font-weight: bold;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.zoom-btn:hover {
  background: #14519A;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.zoom-btn:active {
  transform: scale(0.95);
}

/* Finding styling */
.finding-1 {
  box-shadow: 0 -8px 0 YellowGreen inset;
  -webkit-box-shadow: 0 -8px 0 YellowGreen inset;
}

.finding-2 {
  box-shadow: 0 -7px teal inset;
  -webkit-box-shadow: 0 -7px 0 teal inset;
}

/* City Detail View */
#cityDetailView {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 2000;
}

#cityDetailHeader {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2001;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#cityDetailTitle {
  margin: 0 0 10px 0;
  color: #3070B3;
  font-size: 1.5em;
}

.back-btn {
  background: #3070B3;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: #14519A;
  transform: translateX(-3px);
}

#cityDetailMapContainer {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgb(151, 182, 249) 0%, rgb(175, 210, 255) 50%, rgb(151, 182, 249) 100%);
}

#cityDetailMapContainer svg {
  width: 100%;
  height: 100%;
}

/* City Zoom Controls */
#cityZoomControls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2001;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Tourism Legend */
.tourism-legend {
  position: absolute;
  top: 120px;
  left: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  z-index: 2001;
}

.tourism-legend h3 {
  margin: 0 0 10px 0;
  color: #3070B3;
  font-size: 1.1em;
}

.tourism-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 0.85em;
}

.tourism-emoji {
  font-size: 1.2em;
  min-width: 25px;
  text-align: center;
}

/* Credits Styling */
.credits {
  font-size: 0.75em;
  color: #666;
  margin: 8px 0 0 0;
  line-height: 1.4;
  font-style: italic;
}

.credits strong {
  color: #3070B3;
  font-weight: 600;
}

/* Methodology Button */
.methodology-btn {
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  border: none;
  color: white;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.methodology-icon {
  font-size: 16px;
}

.methodology-label {
  font-size: 13px;
  letter-spacing: 0.3px;
}

.methodology-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

/* Modal Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f44336;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.modal-close:hover {
  background: #d32f2f;
  transform: rotate(90deg);
}

.modal-title {
  color: #3070B3;
  margin: 0 0 10px 0;
  font-size: 2em;
}

.modal-subtitle {
  color: #666;
  margin: 0 0 30px 0;
  font-size: 1.1em;
}

/* Methodology Grid */
.methodology-grid {
  display: grid;
  gap: 20px;
}

.methodology-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-left: 4px solid #3070B3;
}

.methodology-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.methodology-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
  gap: 15px;
}

.methodology-card-title {
  flex: 1;
}

.methodology-card h3 {
  color: #3070B3;
  margin: 0 0 5px 0;
  font-size: 1.3em;
}

.methodology-card .criteria-code {
  background: #3070B3;
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-family: monospace;
  white-space: nowrap;
}

.methodology-card .source-name {
  color: #14519A;
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.methodology-card .metadata-info {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.methodology-card .metadata-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85em;
}

.methodology-card .metadata-label {
  color: #14519A;
  font-weight: 600;
}

.methodology-card .metadata-value {
  color: #333;
  font-weight: 500;
}

.methodology-card .methodology-text {
  color: #333;
  line-height: 1.6;
  font-size: 0.95em;
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  white-space: pre-wrap;
}

.methodology-card .source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #3070B3;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9em;
  transition: all 0.2s ease;
  word-break: break-all;
}

.methodology-card .source-link:hover {
  background: #14519A;
  transform: translateX(5px);
}

/* Scrollbar Styling */
.modal-content::-webkit-scrollbar {
  width: 10px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #3070B3;
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #14519A;
}

/* ===== MOBILE RESPONSIVENESS ===== */
/* Only applies to devices with screen width <= 768px (smartphones and small tablets) */

@media screen and (max-width: 768px) {

  /* Body and base elements */
  html,
  body {
    font-size: 12px;
  }

  .buttons-text-adjustment {
    user-select: none;
    color: white;
    font-size: 0.001px;
    line-height: 0.001%;
  }

  /* ===== ONBOARDING MOBILE ===== */
  .onboarding-container {
    padding: 30px 20px;
    width: 95%;
    max-height: 95vh;
  }

  .flag-icon-large {
    width: 80px;
  }

  .onboarding-header h1 {
    font-size: 1.8em;
  }

  .onboarding-header .subtitle {
    font-size: 1em;
  }

  .instruction-card {
    flex-direction: column;
    gap: 15px;
    padding: 20px 15px;
    margin-bottom: 20px;
  }

  .instruction-number {
    width: 50px;
    height: 50px;
    font-size: 1.6em;
  }

  .instruction-text h3 {
    font-size: 1.2em;
  }

  .instruction-text p {
    font-size: 0.95em;
  }

  .onboarding-button {
    padding: 14px 35px;
    font-size: 1em;
    width: 100%;
  }

  /* ===== CRITERIA SELECTOR MOBILE ===== */
  .criteria-container {
    padding: 25px 15px;
    width: 95%;
    max-height: 95vh;
  }

  .criteria-header h1 {
    font-size: 1.6em;
  }

  .criteria-header p {
    font-size: 0.9em;
  }

  .criteria-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .criterion-card {
    padding: 15px 10px;
  }

  .criterion-icon {
    font-size: 1.8em;
  }

  .criterion-name {
    font-size: 0.8em;
  }

  .pairwise-container {
    padding: 20px 15px;
  }

  .criteria-comparison {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .vs-divider {
    writing-mode: horizontal-tb;
    padding: 10px 0;
  }

  .criterion-display {
    padding: 20px 15px;
  }

  .intensity-slider {
    width: 100%;
  }

  /* ===== INFO PANEL MOBILE - ULTRA COMPACT ===== */
  #infoPanel {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    max-width: 80%;
    height: 110px;
    padding: 2px 4px;
    border-radius: 0 0 6px 6px;
    overflow: visible;
    z-index: 900;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.95);
  }

  /* Info Panel Header - Ultra Compact Mobile Layout */
  .info-header {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 0;
  }

  .info-header .flag-icon {
    width: 14px !important;
    height: auto;
    flex-shrink: 0;
  }

  .info-title {
    font-size: 0.9em !important;
    margin: 0 !important;
    line-height: 2;
    font-weight: 700;
    white-space: nowrap;
  }

  /* Show description on mobile, but extremely compact */
  .info-description {
    display: block !important;
    font-size: 0.7em !important;
    margin: 0 !important;
    line-height: 1.5 !important;
  }

  .info-credits {
    display: block !important;
    font-size: 0.8em !important;
    margin: 0 !important;
    line-height: 1.5 !important;
  }

  .credits-subtitle {
    display: none !important;
  }

  /* Generic text in info panel on mobile */
  #infoPanel h2 {
    font-size: 0.9em !important;
    margin: 0 !important;
  }

  #infoPanel p {
    font-size: 0.7em !important;
    margin: 0 !important;
    line-height: 1.5 !important;
  }

  /* City Search - ultra compact */
  #citySearchContainer {
    margin-bottom: 1px;
  }

  #citySearchInput {
    font-size: 0.7em;
    padding: 2px 3px;
    border-width: 1px;
  }

  #citySearchResults {
    max-height: 150px;
    font-size: 0.7em;
  }

  .search-result-item {
    padding: 2px 4px;
  }

  /* Methodology Button - minimal */
  .methodology-btn {
    margin: 1px auto 0 auto;
    padding: 1px 3px;
    font-size: 0.6em;
    width: auto;
    align-items: center;
    gap: 1px;
    line-height: 1.3 !important;
    display: block;
  }

  .methodology-icon {
    font-size: 0.85em;
  }

  .methodology-label {
    font-size: 1em;
    /* Hide text on mobile */
  }

  /* ===== ZOOM CONTROLS MOBILE ===== */
  #zoomControls {
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px;
    gap: 4px;
    z-index: 950;
  }

  .zoom-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  /* ===== CRITERIA PANEL MOBILE - MINIMAL TAB ===== */
  #criteriaPanel {
    position: fixed;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 65vh;
    border-radius: 10px 10px 0 0;
    /* Match button radius */
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    z-index: 10000;
    /* Very high z-index when maximized */
    /* Add vertical slide transition */
    transition: transform 0.3s ease, max-height 0.3s ease, z-index 0s;
    transform: translateY(0);
  }

  #criteriaPanel.minimized {
    height: 20px;
    /* Match new button height */
    max-height: 20px;
    /* Slide down when minimized */
    transform: translateY(calc(100% - 20px));
    z-index: 1000;
    /* Lower z-index when minimized */
    transition: transform 0.3s ease, max-height 0.3s ease, z-index 0s 0.3s;
  }

  .toggle-panel-btn {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 20px;
    /* Reduced to half */
    min-height: 20px;
    /* Ensure consistent height */
    border-radius: 10px 10px 0 0;
    /* Adjusted for smaller height */
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    /* Slightly smaller font */
    padding: 0;
    transition: background-color 0.2s ease;
    /* Smooth color transition only */
  }

  #criteriaPanel.minimized .toggle-panel-btn {
    border-radius: 10px 10px 0 0;
    height: 20px;
    /* Lock height */
    min-height: 20px;
  }

  #toggleIcon {
    transform: none !important;
    /* Override desktop rotation */
    font-size: 0.85em;
    /* Smaller icon for smaller button */
    transition: none;
    /* No transition on mobile */
    display: inline-block;
    /* Prevent size changes */
    width: 16px;
    /* Reduced width */
    height: 16px;
    /* Reduced height */
    line-height: 16px;
    text-align: center;
  }

  #criteriaPanel.minimized #toggleIcon {
    transform: none !important;
    /* Override desktop rotation */
  }

  #panelContent {
    padding: 10px;
    overflow-y: auto;
    max-height: calc(65vh - 20px);
    /* Adjusted for smaller button */
  }

  .panel-header h3 {
    font-size: 1em;
    margin-bottom: 4px;
    /* Reduced from 6px */
  }

  .panel-subtitle {
    font-size: 0.9em;
    margin-bottom: 5px;
    /* Reduced from 8px */
  }

  .filter-toggle {
    flex-direction: row;
    gap: 4px;
    /* Reduced from 6px */
    justify-content: center;
    margin-bottom: 6px;
    /* Reduced from 10px */
  }

  .filter-option {
    padding: 4px 8px;
    /* Reduced from 5px 10px */
    font-size: 0.85em;
  }

  .season-selector {
    margin-top: 4px;
    margin-bottom: 8px;
    margin-left: 24px;
    /* Reduced indent for mobile */
    padding: 6px;
    gap: 4px;
  }

  .season-label {
    font-size: 0.85em;
  }

  .season-select {
    padding: 5px 8px;
    /* Reduced from 8px 12px */
    font-size: 0.85em;
  }

  .panel-section {
    margin-bottom: 6px;
    /* Reduced from 10px */
  }

  .panel-section h4 {
    font-size: 0.9em;
    margin-bottom: 4px;
    /* Reduced from 6px */
  }

  .criteria-checkbox-item {
    padding: 4px;
    /* Reduced from 5px */
    font-size: 0.8em;
    /* Match filter option size */
    margin-bottom: 2px;
    /* Reduced from 3px */
    min-height: 32px;
    /* Reduce overall height */
  }

  .criterion-icon {
    font-size: 1.2em;
    /* Reduced from 2em desktop */
    margin-bottom: 4px;
    /* Reduced from 10px */
  }

  .criterion-name {
    font-size: 0.75em;
    /* Match filter option size (0.75em) */
  }

  .criterion-weight-item {
    padding: 4px;
    /* Reduced from 5px */
    margin-bottom: 3px;
    /* Reduced from 4px */
  }

  .weight-slider-item {
    padding: 6px;
    /* Reduced from 12px desktop */
    margin-bottom: 4px;
  }

  .weight-slider-header {
    gap: 4px;
    /* Reduced from 8px */
    margin-bottom: 4px;
    /* Reduced from 8px */
    font-size: 1em;
  }

  .weight-slider-icon {
    font-size: 1em;
    /* Reduced from 1.2em */
  }

  .weight-slider-name {
    font-size: 0.9em;
    /* Match filter option size */
    font-weight: 600;
  }

  .weight-slider-value {
    font-size: 0.95em;
    /* Match filter option size */
    min-width: 35px;
    /* Reduced from 45px */
  }

  .weight-slider {
    height: 4px;
    /* Reduced from 6px - thinner bar */
  }

  .weight-slider::-webkit-slider-thumb {
    width: 14px;
    /* Reduced from 18px */
    height: 14px;
    /* Reduced from 18px */
  }

  .weight-slider::-moz-range-thumb {
    width: 14px;
    /* Reduced from 18px */
    height: 14px;
    /* Reduced from 18px */
  }

  .criterion-label {
    font-size: 0.9em;
  }

  .weight-input {
    width: 42px;
    padding: 3px 4px;
    font-size: 0.9em;
  }

  .action-button {
    padding: 7px 14px;
    /* Reduced from 8px 16px */
    font-size: 0.9em;
    width: 100%;
    margin-top: 5px;
    /* Reduced from 8px */
  }

  /* ===== MAP CONTAINER MOBILE ===== */
  #mapContainer {
    width: 100%;
    height: 100%;
    padding: 0;
  }

  #mapContainer svg {
    width: 100%;
    height: 100%;
  }

  #pieChartContainer {
    top: 130px !important;
    left: 5px !important;
    padding: 1px !important;
    max-width: 40px;
    width: 30px !important;
    height: 130px !important;
    font-size: 0.65em;
  }

  #pieChartContainer>div:first-child {
    font-size: 1.2em !important;
    margin-bottom: 0.5px !important;
  }

  #pieChartContainer svg {
    width: 70px !important;
    height: 70px !important;
  }

  #pieChartContainer svg>div {
    width: 50px !important;
  }

  */

  /* ===== TOOLTIP MOBILE ===== */
  .tooltip {
    font-size: 6px;
    padding: 3px;
    max-width: 80vw;
  }

  .tooltip table {
    min-width: 150px;
  }

  .tooltip th {
    padding: 3px 4px;
    font-size: 6px;
  }

  .tooltip td {
    padding: 1px 2px;
    font-size: 6px;
  }

  /* ===== CITY DETAIL VIEW MOBILE ===== */
  #cityDetailHeader {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 8px 10px;
    max-width: calc(100% - 16px);
  }

  #cityDetailTitle {
    font-size: 1em;
    margin: 0 0 5px 0;
  }

  .back-btn {
    padding: 6px 10px;
    font-size: 0.75em;
    width: 100%;
  }

  #cityZoomControls {
    bottom: 10px;
    gap: 4px;
    padding: 4px;
  }

  /* Tourism Legend Mobile */
  .tourism-legend {
    top: auto;
    bottom: 55px;
    left: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
    max-height: 30vh;
    padding: 8px;
  }

  .tourism-legend h3 {
    font-size: 0.85em;
    margin-bottom: 5px;
  }

  .tourism-legend-item {
    font-size: 0.65em;
    margin: 2px 0;
    gap: 5px;
  }

  .tourism-emoji {
    font-size: 0.9em;
    min-width: 16px;
  }

  /* ===== METHODOLOGY MODAL MOBILE ===== */
  .modal {
    padding: 8px;
    align-items: flex-start;
  }

  .modal-content {
    padding: 20px 12px;
    max-height: 95vh;
    margin-top: 8px;
  }

  .modal-close {
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .modal-title {
    font-size: 1.2em;
    padding-right: 38px;
    margin-bottom: 6px;
  }

  .modal-subtitle {
    font-size: 0.8em;
    margin-bottom: 12px;
  }

  .methodology-card {
    padding: 10px;
  }

  .methodology-card h3 {
    font-size: 0.95em;
  }

  .methodology-card .criteria-code {
    font-size: 0.6em;
    padding: 2px 5px;
  }

  .methodology-card .source-name {
    font-size: 0.75em;
    margin-bottom: 6px;
  }

  .methodology-card .metadata-info {
    gap: 8px;
    margin-bottom: 8px;
  }

  .methodology-card .metadata-item {
    font-size: 0.7em;
    padding: 4px 8px;
  }

  .methodology-card .methodology-text {
    font-size: 0.75em;
    padding: 8px;
    margin-bottom: 8px;
  }

  .methodology-card .source-link {
    font-size: 0.7em;
    padding: 4px 8px;
  }

  /* ===== ADJUSTMENTS FOR VERY SMALL SCREENS ===== */
  @media screen and (max-width: 400px) {

    html,
    body {
      font-size: 13px;
    }

    #infoPanel {
      padding: 4px 6px;
    }

    #infoPanel h2 {
      font-size: 0.7em;
    }

    .criteria-grid {
      grid-template-columns: 1fr;
    }

    .zoom-btn {
      width: 34px;
      height: 34px;
      font-size: 16px;
    }

    #criteriaPanel {
      max-height: 70vh;
    }

    #panelContent {
      max-height: calc(70vh - 40px);
    }
  }

  #pieChartContainer svg>div {
    width: 50px !important;
  }

  /* ===== LANDSCAPE ORIENTATION ADJUSTMENTS ===== */
  @media screen and (max-width: 768px) and (orientation: landscape) {
    #infoPanel {
      padding: 3px 6px;
    }

    #infoPanel h2 {
      font-size: 0.65em;
      margin-bottom: 2px;
    }

    #infoPanel>div:last-of-type>div span {
      font-size: 0.55em !important;
    }

    #criteriaPanel {
      max-height: 60vh;
    }

    #panelContent {
      max-height: calc(60vh - 40px);
    }

    .tourism-legend {
      max-height: 40vh;
    }

    .modal-content {
      max-height: 92vh;
    }

    #zoomControls {
      bottom: 55px;
    }
  }
}

/*Ringtone style
/* Call Overlay */
/* ===== START EXPERIENCE OVERLAY ===== */

.start-experience-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15000;
  /* Highest - appears first before everything */
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.start-experience-container {
  text-align: center;
  padding: 40px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  animation: slideUp 0.6s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.start-flag {
  width: 100px;
  height: auto;
  margin-bottom: 20px;
  animation: wave 2s ease-in-out infinite;
}

@keyframes wave {

  0%,
  100% {
    transform: rotate(-3deg);
  }

  50% {
    transform: rotate(3deg);
  }
}

.start-title {
  font-size: 2em;
  color: #333;
  margin: 0 0 10px 0;
  font-weight: bold;
}

.start-subtitle {
  font-size: 1.1em;
  color: #666;
  margin: 0 0 30px 0;
  line-height: 1.5;
}

.start-experience-btn {
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  color: white;
  border: none;
  padding: 18px 40px;
  font-size: 1.3em;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  animation: pulse 2s infinite;
}

.start-experience-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.start-experience-btn:active {
  transform: scale(0.98);
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  }

  50% {
    box-shadow: 0 4px 25px rgba(102, 126, 234, 0.7);
  }
}

.start-note {
  margin-top: 15px;
  font-size: 0.9em;
  color: #999;
  font-style: italic;
}

/* Logo Footer Styles */
.start-logos-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid #e0e0e0;
}

.footer-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  opacity: 1;
}

/* Mobile responsiveness for start overlay */
@media screen and (max-width: 768px) {
  .start-experience-container {
    padding: 30px 20px;
    margin: 0 20px;
  }

  .start-flag {
    width: 80px;
  }

  .start-title {
    font-size: 1.6em;
  }

  .start-subtitle {
    font-size: 1em;
  }

  .start-experience-btn {
    padding: 15px 35px;
    font-size: 1.1em;
  }

  .start-logos-footer {
    gap: 20px;
    margin-top: 25px;
    padding-top: 20px;
  }

  .footer-logo {
    height: 40px;
  }
}

@media screen and (max-width: 400px) {
  .start-title {
    font-size: 1.4em;
  }

  .start-subtitle {
    font-size: 0.9em;
  }

  .start-experience-btn {
    padding: 12px 30px;
    font-size: 1em;
  }

  .start-logos-footer {
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
  }

  .footer-logo {
    height: 35px;
  }
}

/* ===== CALL OVERLAY & INTRO MODAL - POPUP STYLE ===== */

/* Call Overlay - Popup over map */
.call-overlay-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  /* Semi-transparent instead of solid */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 14000;
  /* Second highest - appears after start screen */
  backdrop-filter: blur(5px);
  /* Blur the map behind */
}

.call-phone {
  background: #111;
  color: white;
  padding: 30px;
  border-radius: 30px;
  width: 100%;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: pulse 2s infinite;
  transition: transform 0.3s ease;
  position: relative;
}

.call-phone:hover {
  transform: scale(1.02);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9);
}

.close-popup-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.close-popup-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.incoming {
  opacity: 0.8;
  font-size: 0.9em;
  margin-bottom: 5px;
}

.call-phone h2 {
  margin: 10px 0;
  color: #2ecc71;
  font-size: 1.8em;
}

.subtitle {
  font-size: 0.85em;
  opacity: 0.7;
  margin-bottom: 25px;
}

.call-actions {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 25px;
}

.call-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: none;
  font-size: 1.8em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.call-btn:active {
  transform: scale(0.95);
}

.call-btn.answer {
  background: #2ecc71;
  color: white;
}

.call-btn.answer:hover {
  background: #27ae60;
}

.call-btn.decline {
  background: #e74c3c;
  color: white;
}

.call-btn.decline:hover {
  background: #c0392b;
}

/* Intro Modal - Popup over map */
.intro-modal-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  /* Semi-transparent */
  z-index: 13000;
  /* Third highest - appears after call overlay */
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  backdrop-filter: blur(5px);
  /* Blur the map behind */
}

.intro-content {
  background: white;
  width: 100%;
  max-width: 600px;
  padding: 30px;
  border-radius: 20px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro-content h2 {
  margin-top: 0;
  color: #3070B3;
  font-size: 1.8em;
}

.intro-content h3 {
  color: #333;
  margin-top: 20px;
  font-size: 1.3em;
}

.intro-content p {
  line-height: 1.6;
  color: #555;
  margin: 10px 0;
}

.intro-content ul {
  padding-left: 20px;
  margin: 15px 0;
}

.intro-content li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.intro-content li strong {
  color: #333;
}

.intro-content li em {
  color: #777;
  font-size: 0.9em;
}

.intro-content .closing {
  font-style: italic;
  margin-top: 25px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #3070B3;
  font-size: 1.1em;
  color: #333;
}

/* Mobile responsiveness for popups */
@media screen and (max-width: 768px) {
  .call-phone {
    padding: 25px 20px;
    max-width: 280px;
  }

  .call-phone h2 {
    font-size: 1.5em;
  }

  .call-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5em;
  }

  .call-actions {
    gap: 20px;
  }

  .intro-content {
    padding: 20px;
    max-height: 85vh;
  }

  .intro-content h2 {
    font-size: 1.4em;
    padding-right: 30px;
  }

  .intro-content h3 {
    font-size: 1.1em;
  }

  .intro-content p,
  .intro-content li {
    font-size: 0.9em;
  }

  .intro-content .closing {
    font-size: 1em;
    padding: 12px;
  }
}

@media screen and (max-width: 400px) {
  .call-phone {
    padding: 20px 15px;
  }

  .call-phone h2 {
    font-size: 1.3em;
  }

  .subtitle {
    font-size: 0.8em;
  }

  .call-btn {
    width: 55px;
    height: 55px;
    font-size: 1.3em;
  }

  .intro-content {
    padding: 15px;
  }

  .intro-content h2 {
    font-size: 1.2em;
  }
}

/* ===== DATA TABLE MODAL STYLES ===== */

.data-table-modal-content {
  max-width: 95vw;
  width: 1400px;
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.data-table-header {
  padding: 30px;
  border-bottom: 2px solid #e0e0e0;
  background: linear-gradient(135deg, #3070B3 0%, #14519A 100%);
  color: white;
  flex-shrink: 0;
}

.data-table-header .modal-title {
  color: white;
  margin-bottom: 8px;
}

.data-table-header .modal-subtitle {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
}

.table-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.9em;
  margin-top: 10px;
}

.table-info span {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
  backdrop-filter: blur(10px);
}

.data-table-container {
  flex: 1;
  overflow: auto;
  padding: 20px;
  background: #f8f9fa;
}

.city-data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.city-data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.city-data-table th {
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9em;
  color: #333;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 2px solid #dee2e6;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.city-data-table th:hover {
  background: linear-gradient(180deg, #e9ecef 0%, #dee2e6 100%);
}

.city-data-table th.sortable {
  position: relative;
  padding-right: 28px;
}

.city-data-table th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.3;
  font-size: 0.9em;
}

.city-data-table th.sorted-asc::after {
  content: '▲';
  opacity: 1;
  color: #3070B3;
}

.city-data-table th.sorted-desc::after {
  content: '▼';
  opacity: 1;
  color: #3070B3;
}

.city-data-table td {
  padding: 12px;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.85em;
  color: #495057;
}

.city-data-table tbody tr {
  transition: background 0.15s ease;
}

.city-data-table tbody tr:hover {
  background: #f8f9fa;
}

.city-data-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.city-data-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.city-data-table tbody tr:nth-child(odd):hover {
  background: #f0f2f5;
}

.city-data-table tbody tr:nth-child(even):hover {
  background: #f0f2f5;
}

/* Rank column styling */
.city-data-table td.rank-cell {
  font-weight: 700;
  font-size: 1em;
  color: #3070B3;
  text-align: center;
  width: 60px;
}

.city-data-table td.rank-cell.top-rank {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #8b6914;
  border-radius: 8px;
  font-size: 1.1em;
}

.city-data-table td.rank-cell.second-rank {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
  color: #5a5a5a;
  border-radius: 8px;
}

.city-data-table td.rank-cell.third-rank {
  background: linear-gradient(135deg, #cd7f32 0%, #e09856 100%);
  color: #5a3a1a;
  border-radius: 8px;
}

/* City name column styling */
.city-data-table td.city-name-cell {
  font-weight: 600;
  color: #212529;
  font-size: 0.95em;
}

/* Index column styling */
.city-data-table td.index-cell {
  font-weight: 600;
  color: #28a745;
  font-size: 0.95em;
}

/* Numeric value styling */
.city-data-table td.numeric-cell {
  text-align: right;
  font-family: 'Courier New', monospace;
  color: #6c757d;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
  .data-table-modal-content {
    max-width: 100vw;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .data-table-header {
    padding: 20px 15px;
  }

  .data-table-header .modal-title {
    font-size: 1.3em;
  }

  .data-table-header .modal-subtitle {
    font-size: 0.85em;
  }

  .table-info {
    font-size: 0.75em;
    gap: 8px;
  }

  .data-table-container {
    padding: 10px;
    /* Enable horizontal scrolling on mobile */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
  }

  /* Ensure table doesn't shrink on mobile - allow horizontal scroll */
  .city-data-table {
    min-width: 800px;
    /* Minimum width to ensure all columns are visible */
    width: max-content;
    /* Allow table to expand to fit content */
  }

  .city-data-table th {
    padding: 10px 6px;
    font-size: 0.75em;
  }

  .city-data-table td {
    padding: 8px 6px;
    font-size: 0.75em;
  }

  .city-data-table td.rank-cell {
    width: 40px;
    font-size: 0.85em;
  }

  .city-data-table td.city-name-cell {
    font-size: 0.8em;
  }

  .city-data-table td.index-cell {
    font-size: 0.8em;
  }

  /* REMOVED: No longer hiding columns on mobile - all columns visible with horizontal scroll */
}

/* Scrollbar styling for table container */
.data-table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.data-table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.data-table-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.data-table-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ===== PIE CHART CONTAINER RESPONSIVE STYLES ===== */

/* Main sidebar container - unified vertical stack */
#pieChartContainer {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* 20px vertical gap between sections */
  width: 210px;
  /* Consistent width on desktop */
}

/* Desktop container alignment */
.pie-container-desktop {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Mobile container alignment */
.pie-container-mobile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Individual sections - shrink-wrap content */
#pieChartSection{
  height: 180px;}
#cityLegendSection {
  width: 210px;
  /* Consistent width */
  box-sizing: border-box;
  /* NO fixed heights - shrink-wrap content */
  height: auto;
  min-height: auto;
  max-height: none;

  /* Consistent styling */
  background: white;
  border-radius: 12px;
  padding: 20px;
  /* Consistent 20px internal padding */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Ensure content doesn't expand containers */
#pieChartSection {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#cityLegendSection {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Mobile-specific media query */
@media screen and (max-width: 768px) {
  #pieChartContainer {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 220px !important;
    gap: 2px !important;
    font-size: 1.05em !important;
    padding: 6px !important;
    line-height: 3px;
    /* Slightly smaller gap on mobile */
  }

  #pieChartSection,
  #cityLegendSection {
    width: 100% !important;
    padding: 15px !important;
    /* Slightly smaller padding on mobile */
  }

  /* Ensure pie chart SVG scales properly */
  #pieChartSection svg {
    max-width: 100%;
    height: auto;
  }

  /* Compact legend items on mobile */
  #proportionalLegendInContainer>div {
    gap: 6px;
  }
}

/* Desktop media query for larger screens */
@media screen and (min-width: 769px) {
  #pieChartContainer {
    width: 180px !important;
  }

  #pieChartSection svg,
  #cityLegendSection {
    width: 180px !important;
  }
}

/* Extra small devices (phones in portrait, less than 375px) */
@media screen and (max-width: 375px) {
  #pieChartContainer {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 180px !important;
    gap: 4px !important;
    font-size: 1em;
  }

  #pieChartSection,
  #cityLegendSection {
    padding: 12px !important;
    font-size: 1em !important;
  }
}

/* Landscape orientation on mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
  #pieChartContainer {
    width: auto !important;
    max-width: 210px !important;
    gap: 15px !important;
  }
}