* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy-dark: #0a1929;
  --navy-medium: #1a2332;
  --navy-light: #2d3e50;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --white: #ffffff;
  --off-white: #f8fafc;
  --gray-light: #e2e8f0;
  --gray-medium: #94a3b8;
  --gray-dark: #475569;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --header-height: 70px;
  --sidebar-width: 420px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
  --transition-quick: 0.15s ease;
  --transition-normal: 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-dark);
  background-color: var(--off-white);
  overflow-x: hidden;
}

header {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-medium) 100%);
  color: var(--white);
  padding: 0 32px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout {
  display: flex;
  height: calc(100vh - var(--header-height) - 48px);
  background-color: var(--off-white);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--gray-light);
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--off-white);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-medium);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-dark);
}

#routeForm {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.inputGroup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inputGroup label {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-wrapper {
  position: relative;
}

.inputGroup input,
.inputGroup select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-light);
  border-radius: var(--border-radius);
  font-size: 15px;
  color: var(--navy-dark);
  background-color: var(--white);
  transition: all var(--transition-normal);
  font-family: inherit;
}

.inputGroup input:focus,
.inputGroup select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.inputGroup input:hover,
.inputGroup select:hover {
  border-color: var(--gray-medium);
}

.inputGroup input::placeholder {
  color: var(--gray-medium);
}

.inputGroup select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.geocode-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  margin-top: 4px;
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.geocode-results:not(:empty) {
  display: block;
}

.geocode-results div {
  padding: 5px 10px;
  cursor: pointer;
  transition: background-color var(--transition-quick);
  font-size: 14px;
  color: var(--gray-dark);
}

.geocode-results div:last-child {  
  border-bottom: 1px solid var(--gray-light);
  /* border-bottom: none; */
  font-weight: bold;
}

.geocode-results div:hover {
  background-color: var(--off-white);
  color: var(--navy-dark);
}

.geocode-results div:active {
  background-color: var(--gray-light);
}

.searchBtn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-hover) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
}

.searchBtn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--accent-blue-hover) 0%, #1d4ed8 100%);
}

.searchBtn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.searchBtn:disabled {
  background: var(--gray-light);
  color: var(--gray-medium);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.status-message {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-message.info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue-hover);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-message.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-message.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-message.warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

#results {
  border-top: 1px solid var(--gray-light);
  padding-top: 24px;
  animation: slideIn 0.3s ease;
}

#results h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy-dark);
  margin-bottom: 16px;
}

#routeList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.route-card {
  padding: 16px;
  background: var(--off-white);
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  transition: all var(--transition-quick);
}

.route-card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-sm);
}

.map-section {
  flex: 1;
  position: relative;
  background-color: var(--gray-light);
}

#map {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.leaflet-control-container .leaflet-top.leaflet-left {
  margin-top: 16px;
  margin-left: 16px;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: var(--border-radius) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 18px !important;
  border: none !important;
  background-color: var(--white) !important;
  color: var(--navy-dark) !important;
  transition: background-color var(--transition-quick) !important;
}

.leaflet-control-zoom a:hover {
  background-color: var(--off-white) !important;
  color: var(--accent-blue) !important;
}

footer {
  background-color: var(--white);
  border-top: 1px solid var(--gray-light);
  padding: 14px 32px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-medium);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

footer p {
  margin: 0;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 360px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }
  
  header {
    padding: 0 16px;
  }
  
  header h1 {
    font-size: 18px;
  }
  
  .layout {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - var(--header-height) - 48px);
  }
  
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--gray-light);
    max-height: none;
    padding: 20px 16px;
  }
  
  .map-section {
    min-height: 400px;
    height: 50vh;
  }
  
  .geocode-results {
    max-height: 200px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 16px;
  }
  
  .sidebar {
    padding: 16px;
  }
  
  .inputGroup input,
  .inputGroup select {
    font-size: 14px;
    padding: 10px 14px;
  }
  
  .searchBtn {
    padding: 12px 20px;
    font-size: 15px;
  }
  
  #results h3 {
    font-size: 16px;
  }
  
  footer {
    padding: 12px 16px;
    font-size: 12px;
  }
}

[hidden] {
  display: none !important;
}

*:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
}

@media print {
  .sidebar {
    width: 100%;
  }
  
  .map-section {
    page-break-after: always;
  }
  
  footer {
    position: fixed;
    bottom: 0;
  }
}
.custom-marker {
  background: none;
  border: none;
}

.marker-from,
.marker-to {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 14px;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.marker-from {
  background-color: #10b981;
}

.marker-to {
  background-color: #ef4444;
}