.map {
  padding: 0 0 100px;
}
.map .title {
  max-width: 80%;
  margin-bottom: 40px;
}
.map .map_svg {
  margin: 0 auto;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.map .map_svg svg {
  width: 100%;
  height: auto;
}
#map-section {
  position: relative;
}
.country {
  cursor: pointer;
}

.country.highlighted {
  fill: #28365c;
}
.country.active {
  fill: #fc9f50;
  opacity: 0.8;
}
.country.dimmed {
  fill: #28365c;
}

.hub-point {
  fill: #e74c3c;
  stroke: white;
  stroke-width: 2;
  opacity: 0;
  transition: all 0.5s ease;
  visibility: hidden;
}

.hub-point.active {
  opacity: 1;
  visibility: visible;
}

.hub-point-text {
  font-size: 14px;
  fill: #000;
  text-anchor: middle;
  opacity: 0;
  transition: all 0.5s ease;
  visibility: hidden;
}
.hub-point-text.active {
  opacity: 1;
  visibility: visible;
}

.route-line {
  stroke: #e74c3c;
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 10, 5;
  opacity: 0;
  transition: all 0.5s ease;
  visibility: hidden;
}

.route-line.active {
  opacity: 1;
  visibility: visible;
}

.route-details {
  padding-left: 20px;
  margin: 0;
}

.route-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  background: #305ea1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.info-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 24px;
  padding-top: 23px;
  margin-top: 23px;
  border-top: 1px solid #28365c;
}

.route-info.active .legend-color {
  background: #f56d36;
}
.route-info h3 {
  color: #28365c;
  font-weight: 500;
  font-size: 20px;
  margin: 0;
}

.map-content {
  display: flex;
  justify-content: center;
  gap: 50px;
  padding: 0 20px;
}
.available-info {
  display: none;
}
.available-info.active {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  max-width: 200px;
}
.available-color {
  background-color: #28365c;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
}

/* Countries Panel */
.countries-panel {
  width: 350px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 0;
  height: fit-content;
  border: 1px solid #e5e7eb;
}

.countries-header {
  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 12px 12px 0 0;
  color: #28365c;
  background: #d6dfec;
}

.countries-header h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
}

.countries-header p {
  margin: 0;
  font-size: 14px;
}

.countries-list {
  max-height: 600px;
  overflow-y: auto;
  border-bottom-right-radius: 12px;
  border-bottom-left-radius: 12px;
}

.countries-list::-webkit-scrollbar {
  width: 6px;
}

.countries-list::-webkit-scrollbar-track {
  background: #f1f3f4;
}

.countries-list::-webkit-scrollbar-thumb {
  background: #c1c8cd;
  border-radius: 3px;
}

.countries-list::-webkit-scrollbar-thumb:hover {
  background: #a8b3ba;
}

.region-group {
  margin-bottom: 24px;
}

.region-group:last-child {
  margin-bottom: 0;
}

.region-title {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  padding: 0 16px;
  position: relative;
}

.region-title::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 16px;
  width: 30px;
  height: 2px;
  background: #f56d36;
  border-radius: 1px;
}

.country-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.country-item {
  padding: 6px 16px;
  font-size: 14px;
  color: #28365c;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.country-item:hover {
  background: linear-gradient(
    90deg,
    rgba(102, 126, 234, 0.08) 0%,
    rgba(89, 75, 162, 0.08) 100%
  );
  color: #28365c;
  border-left-color: #28365c;
}

.country-item:active {
  background: linear-gradient(
    90deg,
    rgba(102, 126, 234, 0.12) 0%,
    rgba(89, 75, 162, 0.08) 100%
  );
}

.country-item.selected {
  background: linear-gradient(
    90deg,
    rgba(102, 126, 234, 0.15) 0%,
    rgba(89, 75, 162, 0.08) 100%
  );
  color: #28365c;
  border-left-color: #f56d36;
  font-weight: 500;
}

.map-toggle-icon {
  display: none;
}

@media screen and (max-width: 1460px) {
  .map .title {
    font-size: 42px;
  }
}

@media screen and (max-width: 1250px) {
  .countries-panel {
    width: 280px;
  }
  .info-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media screen and (max-width: 1024px) {
  .map-content {
    gap: 24px;
    flex-direction: column;
  }
  .countries-panel {
    order: 2;
  }
  .map-toggle-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #28365c;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: transform 0.3s ease;
  }
  .map-toggle-icon::after,
  .map-toggle-icon::before {
    content: "";
    position: absolute;
    border-radius: 2px;
    background-color: #28365c;
    transition: transform 0.3s ease;
  }
  .map-toggle-icon::before {
    width: 14px;
    height: 1px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .map-toggle-icon::after {
    width: 1px;
    height: 14px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  .map-toggle-icon.active:after {
    display: none;
  }
  .countries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .countries-panel {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
  }
  .countries-list {
    display: none;
  }
  .countries-list.active {
    display: block;
  }
}

@media screen and (max-width: 768px) {
  .map .title {
    font-size: 32px;
  }
  .info-panel {
    grid-template-columns: 1fr;
  }
  .route-info h3,
  .countries-header h3 {
    font-size: 16px;
  }
  .legend-color {
    width: 8px;
    height: 8px;
  }
  .route-legend {
    margin-bottom: 8px;
  }
  .route-details {
    font-size: 12px;
  }
}
