body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #333;
  background: #0b1120;
}

html,
body {
  height: 100%;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 1;
}

#sidebar {
  position: absolute;
  top: 20px;
  right: 20px;
  bottom: 20px;
  width: 380px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.6);
  z-index: 10;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom scrollbar for sidebar */
#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Component Styles */
.section {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.section h3 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section h3::before {
  content: '';
  display: block;
  width: 4px;
  height: 14px;
  background: #4caf50;
  border-radius: 2px;
}

.section ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section li {
  background: #ffffff;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.04);
  font-size: 13px;
  line-height: 1.5;
  transition: transform 0.2s;
}

.section li:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Input Styles */
.file-input-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#file {
  width: 100%;
  padding: 10px;
  border: 1px dashed #bbb;
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s;
  box-sizing: border-box;
}

#file:hover {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.05);
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #f0f4f8;
  color: #0a2e5c;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(10, 46, 92, 0.1);
}

.download-link:hover {
  background: #e1e8f0;
  color: #061d3b;
}

/* Marker Styles */
.custom-marker {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  background: #ff9800;
  position: relative;
  transform: rotate(-45deg);
  border: 2px solid #ffffff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.custom-marker:hover {
  transform: rotate(-45deg) scale(1.1);
  z-index: 1000 !important;
}

.custom-marker-content {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 11px;
  font-weight: 700;
  transform: translate(-50%, -50%) rotate(45deg);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-marker.large {
  width: 32px;
  height: 32px;
}

.custom-marker.small {
  width: 22px;
  height: 22px;
}

/* Route Control Styles */
.route-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.route-control label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
}

/* Modern Toggle Switch */
.route-control input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  background: #ccc;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 0.3s;
  margin: 0;
}

.route-control input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.route-control input[type="checkbox"]:checked {
  background: #4caf50;
}

.route-control input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}

/* Stop List Styles */
.stop-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px !important;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.02) !important;
  border: none !important;
  box-shadow: none !important;
  margin-bottom: 4px;
}

.stop-marker {
  position: static !important;
  transform: none !important;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Popup Styles */
.custom-popup .mapvinagl-popup-content {
  padding: 16px;
  max-width: 300px;
  max-height: 250px;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  font-family: 'Inter', -apple-system, sans-serif;
  border: none;
}

.mapvinagl-popup-close-button {
  font-size: 18px;
  color: #999;
  padding: 4px 8px;
  right: 4px;
  top: 4px;
  transition: all 0.2s;
}

.mapvinagl-popup-close-button:hover {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  color: #333;
}

.popup-title {
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.popup-detail {
  margin: 6px 0;
  font-size: 13px;
  color: #555;
  display: flex;
  justify-content: space-between;
}

.popup-detail strong {
  color: #222;
}

/* Utility Classes */
.text-green {
  color: #4caf50;
  font-weight: 600;
}

.text-red {
  color: #f44336;
  font-weight: 600;
}

.text-blue {
  color: #2196f3;
  font-weight: 600;
}

.text-purple {
  color: #9c27b0;
  font-weight: 600;
}

.text-orange {
  color: #ff9800;
  font-weight: 600;
}

/* Loading State */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(76, 175, 80, 0.2);
  border-top: 2px solid #4caf50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  #sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 40vh;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
}
