/* Improved Station Info Styles */

/* Base styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

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

.back-button-container {
  margin-top: 30px;
  margin-bottom: 20px;
  text-align: center;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.back-button:hover {
  background-color: #0069d9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.back-button i {
  margin-right: 8px;
}

h1 {
  margin-bottom: 5px;
  font-weight: 600;
  color: #1a1a1a;
}

.subtitle {
  color: #666;
  margin-top: 0;
  font-size: 1.1rem;
}

h2 {
  margin-bottom: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

h3 {
  margin-bottom: 12px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Search section */
.search-section {
  margin-bottom: 30px;
}

.search-container {
  position: relative;
  max-width: 550px;
  margin: 0 auto;
}

.search-box {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.search-box:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid #d1d1d1;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 350px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: none;
}

.search-results.show {
  display: block;
}

.result-item {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}

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

.result-item:hover {
  background-color: #f5f8ff;
}

.result-item.selected {
  background-color: #f0f7ff;
}

.result-station-name {
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.result-details {
  font-size: 0.85rem;
  color: #666;
}

.result-line {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  color: white;
  font-size: 0.75rem;
  margin-right: 6px;
  font-weight: 500;
}

.result-line.purple {
  background-color: #673ab7;
}

.result-line.green {
  background-color: #10b981;
}

.no-results {
  padding: 15px;
  text-align: center;
  color: #666;
}

/* Navigation tabs */
.navigation-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  border-bottom: 1px solid #e0e0e0;
}

.tab-button {
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab-button:hover {
  color: #000;
}

.tab-button.active {
  color: #007bff;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #007bff;
}

.tab-content {
  display: none;
  margin-bottom: 40px;
  animation: fadeIn 0.3s ease-in-out;
}

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

.tab-content.active {
  display: block;
}

/* Places & Landmarks */
.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.place-card {
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

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

.place-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #007bff;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}

.place-stations {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.place-stations li {
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
}

.place-stations li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #007bff;
  font-size: 1.2em;
}

.place-link {
  color: #333;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.place-link:hover {
  color: #007bff;
  text-decoration: underline;
}

/* Metro Lines */
.line-container {
  margin-bottom: 30px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.line-header {
  padding: 16px 20px;
  color: white;
}

.line-header.purple {
  background-color: #673ab7;
}

.line-header.green {
  background-color: #10b981;
}

.line-header h2 {
  margin: 0 0 5px 0;
  color: white;
}

.line-subtitle {
  font-weight: normal;
  font-size: 0.9rem;
  opacity: 0.9;
}

.line-map {
  background-color: white;
  padding: 22px 20px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f0f0f0;
}

.line-map::-webkit-scrollbar {
  height: 6px;
}

.line-map::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.line-map::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

.line-map.purple {
  border-top: 4px solid #673ab7;
}

.line-map.green {
  border-top: 4px solid #10b981;
}

.station-marker {
  display: inline-block;
  padding: 8px 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  margin: 5px 0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.station-marker:hover {
  transform: translateY(-3px);
  box-shadow: 0 3px 7px rgba(0,0,0,0.1);
}

.station-marker.terminus {
  font-weight: 600;
  background-color: #f0f0f0;
}

.station-marker.interchange {
  font-weight: 600;
  background: linear-gradient(135deg, rgba(103, 58, 183, 0.1), rgba(16, 185, 129, 0.1));
  position: relative;
  border: 1px dashed #aaa;
}

.station-marker.interchange::after {
  content: '⟷';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #666;
}

.line-segment {
  display: inline-block;
  width: 30px;
  height: 5px;
  margin: 0 2px;
  vertical-align: middle;
}

.purple .line-segment {
  background-color: #673ab7;
}

.green .line-segment {
  background-color: #10b981;
}

/* Alphabetical stations */
.alpha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.alpha-section {
  background-color: white;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

.alpha-section:hover {
  transform: translateY(-3px);
}

.alpha-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 8px;
  color: #007bff;
  text-align: center;
  font-size: 1.4rem;
}

.alpha-stations {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.alpha-stations li {
  margin-bottom: 12px;
  padding: 3px 0;
}

.station-alpha-link {
  display: flex;
  align-items: center;
  color: #333;
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.2s;
}

.station-alpha-link:hover {
  color: #007bff;
}

.station-line-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
}

.station-line-indicator.purple {
  background-color: #673ab7;
}

.station-line-indicator.green {
  background-color: #10b981;
}

/* Metro stats */
.metro-stats {
  background-color: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  margin-bottom: 30px;
}

.metro-stats h2 {
  margin-top: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
  text-align: center;
}

.stats-container {
  display: flex;
  justify-content: space-between;
  text-align: center;
  flex-wrap: wrap;
  gap: 15px;
}

.stat-item {
  flex: 1;
  min-width: 100px;
  margin-bottom: 15px;
  padding: 15px 10px;
  border-radius: 8px;
  background-color: #f8f9fa;
  transition: transform 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-3px);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #007bff;
}

.stat-label {
  color: #555;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .places-grid {
    grid-template-columns: 1fr;
  }
  
  .alpha-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .navigation-tabs {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 10px;
  }
  
  .tab-button {
    white-space: nowrap;
    padding: 12px 15px;
  }
  
  .stat-number {
    font-size: 1.8rem;
  }
  
  .back-button {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  .alpha-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .station-marker {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  .line-segment {
    width: 20px;
  }
  
  .tab-button {
    padding: 10px;
    font-size: 14px;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
  }
}