/* Enhanced Map Styles */
.zoom-controls {
  position: relative;
  z-index: 200;
}
/* Route Search Section */
.route-search-section {
  background: #f8f9fa;
  padding: 20px;
}

.route-search-section h4 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
}

.route-search-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.search-field {
  position: relative;
}

.search-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: #495057;
}

.country-search-input {
  width: 100%;
  padding: 10px 12px !important;
  border: 1px solid #d6dfec !important;
  border-radius: 60px !important;
  font-size: 16px;
  transition: border-color 0.3s ease;
  background-color: white;
  &::placeholder {
    color: #A2B4CF;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
  }
}

.country-search-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.country-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f8f9fa;
  transition: background-color 0.2s ease;
}

.suggestion-item:hover {
  background-color: #f8f9fa;
}

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

.search-route-btn {
  background: #f56d36;
  color: #28365c;
  border: none;
  padding: 12px 24px;
  border-radius: 60px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.search-route-btn:hover {
  background: #28365c;
  color: white;
}

.search-route-btn:active {
  transform: translateY(0);
}

/* Route Result Styles */
.route-result {
  margin-top: 15px;
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid;
  animation: slideIn 0.3s ease-out;
  font-size: 14px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.route-result.success {
  background-color: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.route-result.error {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.route-result.unavailable {
  background-color: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.route-status {
  font-weight: 400;
}

.route-details p {
  margin: 5px 0;
  font-size: 14px;
}

/* Region Accordion Styles */
.region-group {
  border-top: 1px solid #e9ecef;
  margin-bottom: 0px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.region-group:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.region-header {
  background: #d6dfec;
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background-color 0.3s ease;
}

.region-header:hover {
  background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.region-header.collapsed {
  border-bottom: none;
}

.region-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.country-count {
  font-size: 12px;
  color: #6c757d;
  font-weight: 400;
  background: rgba(0, 123, 255, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
}

.region-toggle {
  font-size: 18px;
  font-weight: 400;
  color: #28365c;
  transition: transform 0.3s ease;
}

.country-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: white;
  max-height: 300px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.country-item {
  padding: 8px 15px;
  border-bottom: 1px solid #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.country-item:hover {
  background-color: #f8f9fa;
  padding-left: 20px;
}

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

.country-item.selected {
  background-color: #e3f2fd;
  color: #1976d2;
  font-weight: 500;
  padding-left: 30px;
}

.country-item.selected::before {
  content: "→";
  position: absolute;
  left: 8px;
  color: #1976d2;
}

/* Map highlighting styles */
.country.highlighted-from,
.country.highlighted-to {
  fill: #f56d36 !important;
}

.country.dimmed {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .route-search-form {
    gap: 12px;
  }
  
  .route-search-section {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  .search-route-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .region-header {
    padding: 10px 12px;
  }
  
  .region-title {
    font-size: 14px;
  }
  
  .country-item {
    padding: 6px 12px;
    font-size: 14px;
  }
  
  .country-suggestions {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .route-search-section h4 {
    font-size: 16px;
  }
  
  .search-field label {
    font-size: 13px;
  }
  
  .country-search-input {
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* Animation for accordion */
@keyframes accordionSlide {
  from {
    max-height: 0;
    opacity: 0;
  }
  to {
    max-height: 300px;
    opacity: 1;
  }
}

.country-list[data-region-list] {
  animation: accordionSlide 0.3s ease-out;
}

/* Scrollbar styling for country lists */
.country-list::-webkit-scrollbar {
  width: 6px;
}

.country-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

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

.country-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
/* Animated Route Lines */
.route-line {
  stroke-dasharray: 10, 5;
  animation: routeFlow 3s linear infinite;
  opacity: 0;
  transition: opacity 0.5s ease;
}

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

@keyframes routeFlow {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 50;
  }
}


/* Hub points animation */
.hub-point {
  opacity: 0;
  transition: all 0.3s ease;
}

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

/* Hub text animation */
.hub-point-text {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease 0.2s;
}

.hub-point-text.active {
  opacity: 1;
  transform: translateY(0);
}


/* Country highlighting with animation */
.country {
  transition: all 0.3s ease;
}

.country:hover {
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
}

/* Route connection animation */
.route-connection {
  opacity: 0;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: all 1s ease;
}

.route-connection.active {
  opacity: 1;
  stroke-dashoffset: 0;
  animation: routeConnect 2s ease-in-out;
}

@keyframes routeConnect {
  0% {
    stroke-dashoffset: 1000;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* Loading animation for search */
.search-route-btn.loading {
  position: relative;
  color: transparent;
}

.search-route-btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: buttonSpin 1s linear infinite;
}

@keyframes buttonSpin {
  to {
    transform: rotate(360deg);
  }
}
/* Country Info Popup Styles */
.country-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.country-popup.show {
  opacity: 1;
}

.popup-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.country-popup.show .popup-content {
  transform: scale(1);
  opacity: 1;
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 1;
}

.popup-close:hover {
  color: #333;
}

.popup-header {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  padding: 20px 25px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popup-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.country-flag {
  width: 32px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.popup-body {
  padding: 25px;
}

.popup-section {
  margin-bottom: 20px;
}

.popup-section:last-of-type {
  margin-bottom: 0;
}

.popup-section h4 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid #f8f9fa;
  padding-bottom: 5px;
}

.popup-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.popup-section li {
  padding: 5px 0;
  color: #495057;
  position: relative;
  padding-left: 20px;
}

.popup-section li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #28a745;
  font-weight: bold;
}

.popup-section p {
  margin: 0;
  color: #495057;
  line-height: 1.5;
}

.popup-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.popup-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popup-btn.primary {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.popup-btn.primary:hover {
  background: linear-gradient(135deg, #20c997, #28a745);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.popup-btn.secondary {
  background: #6c757d;
  color: white;
}

.popup-btn.secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Mobile responsiveness for popup */
@media (max-width: 768px) {
  .popup-content {
    width: 95%;
    max-height: 90vh;
    margin: 20px;
  }
  
  .popup-header {
    padding: 15px 20px;
  }
  
  .popup-header h3 {
    font-size: 20px;
  }
  
  .popup-body {
    padding: 20px;
  }
  
  .popup-actions {
    flex-direction: column;
  }
  
  .popup-btn {
    margin-bottom: 10px;
  }
  
  .popup-btn:last-child {
    margin-bottom: 0;
  }
}

/* Fullscreen and Zoom Controls */
.map-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.map-control-btn {
  width: 40px;
  height: 40px;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-control-btn:hover {
  background: #f8f9fa;
  border-color: #007bff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.map-control-btn svg {
  width: 20px;
  height: 20px;
  fill: #495057;
}

.map-control-btn:hover svg {
  fill: #007bff;
}

/* Fullscreen mode */
.map-section.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  z-index: 9999;
  overflow: hidden;
}

.map-section.fullscreen .map_svg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-section.fullscreen svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

/* Zoom controls */
.zoom-controls {
  position: absolute;
  bottom: 50%;
  right: 20px;
  transform: translateY(50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
}

.zoom-btn {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  color: #495057;
  transition: all 0.2s ease;
}

.zoom-btn:hover {
  background: white;
  color: #007bff;
  border-color: #007bff;
}

/* Pan and zoom functionality */
.map_svg {
  position: relative;
  overflow: hidden;
  cursor: grab;
}

.map_svg:active {
  cursor: grabbing;
}

.map_svg svg {
  transition: transform 0.3s ease;
  transform-origin: center center;
}

/* Mobile zoom controls */
@media (max-width: 768px) {
  .map-controls {
    top: 10px;
    right: 10px;
  }
  
  .zoom-controls {
    right: 10px;
  }
  
  .map-control-btn,
  .zoom-btn {
    width: 35px;
    height: 35px;
  }
}