@view-transition {
  navigation: auto;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 600px;
  width: 100%;
  view-transition-name: main;
}

::view-transition-old(main),
::view-transition-new(main) {
  animation-duration: 0.25s;
  animation-timing-function: ease-in-out;
}

h1 { color: #333; margin-bottom: 10px; font-size: 1.8em; text-align: center; }
.subtitle { color: #666; margin-bottom: 30px; text-align: center; }

.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #2a5298;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #2a5298;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.suggestions.active {
  display: block;
}

.suggestion {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.suggestion:hover {
  background: #f5f5f5;
}

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

.suggestion-name {
  font-weight: 500;
}

.suggestion-meta {
  color: #888;
  font-size: 0.85em;
}

.examples {
  margin-top: 15px;
  text-align: center;
  font-size: 0.9em;
  color: #888;
}

.examples a {
  background: #f0f0f0;
  padding: 4px 10px;
  border-radius: 15px;
  margin: 0 5px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.examples a:hover {
  background: #e0e0e0;
}

.location-header {
  background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
  color: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
}

.location-header h2 {
  font-size: 1.5em;
  margin-bottom: 5px;
}

.location-header .state {
  opacity: 0.8;
  font-size: 0.9em;
}

.current-conditions {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  border-left: 4px solid #ff9800;
}

.current-conditions h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.current-temps {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 15px;
}

.current-temps .temp-main {
  font-size: 3em;
  font-weight: 300;
  color: #333;
}

.current-temps .feels-like {
  color: #666;
  font-size: 0.9em;
}

.current-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.current-details .detail {
  background: white;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.current-details .detail-label {
  font-size: 0.75em;
  color: #888;
  text-transform: uppercase;
}

.current-details .detail-value {
  font-size: 1.1em;
  color: #333;
  font-weight: 500;
}

.current-details .detail-source {
  font-size: 0.7em;
  color: #999;
  margin-top: 3px;
  font-style: italic;
}

/* Temperature Graph */
.temperature-graph {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.temperature-graph h4 {
  color: #555;
  font-size: 0.95em;
  font-weight: 500;
  margin-bottom: 12px;
}

.temp-chart {
  width: 100%;
  height: auto;
  max-height: 200px;
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.forecast-section h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.forecast-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
  border-left: 4px solid #2a5298;
  display: flex;
  align-items: center;
  gap: 15px;
}

.forecast-card .day {
  min-width: 80px;
  font-weight: 600;
  color: #333;
}

.forecast-card .icon {
  font-size: 1.5em;
}

.forecast-card .conditions {
  flex: 1;
  color: #555;
  font-size: 0.9em;
}

.forecast-card .temps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.forecast-card .temp {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85em;
}

.temp.min { background: #e3f2fd; color: #1565c0; }
.temp.max { background: #ffebee; color: #c62828; }
.temp.rain { background: #e8f5e9; color: #2e7d32; }

.other-matches {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.other-matches h4 {
  color: #888;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.other-matches a {
  display: inline-block;
  background: #f0f0f0;
  padding: 4px 12px;
  border-radius: 15px;
  margin: 3px;
  font-size: 0.85em;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.other-matches a:hover {
  background: #e0e0e0;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #2a5298;
  text-decoration: none;
  font-size: 0.9em;
}

.back-link:hover {
  text-decoration: underline;
}

.error {
  text-align: center;
  color: #c62828;
  padding: 20px;
  background: #ffebee;
  border-radius: 8px;
}

.not-found {
  text-align: center;
  padding: 40px 20px;
}

.not-found h2 {
  color: #333;
  margin-bottom: 10px;
}

.not-found p {
  color: #666;
  margin-bottom: 20px;
}

.tech-stack {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  color: #888;
  font-size: 0.85em;
  text-align: center;
}

/* Stations link on home page */
.stations-link {
  text-align: center;
  margin-top: 20px;
}

.stations-link a {
  color: #2a5298;
  text-decoration: none;
  font-size: 0.95em;
}

.stations-link a:hover {
  text-decoration: underline;
}


/* Station detail page */
.location-header .coordinates {
  font-size: 0.8em;
  opacity: 0.7;
  margin-top: 5px;
}

.no-data {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  background: #f8f9fa;
  border-radius: 12px;
}

/* Stations Map */
.stations-map {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 2px solid #ddd;
}

/* Capitals Weather Map (home page) */
.capitals-map {
  width: 100%;
  height: 520px;
  border-radius: 12px;
  margin: 20px 0;
  border: 2px solid #ddd;
}

/* Capital city markers with weather emoji */
.capital-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.capital-icon {
  font-size: 28px;
  line-height: 1;
}

.capital-name {
  font-size: 11px;
  font-weight: 500;
  color: #333;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
  margin-top: 2px;
}

.capital-temp {
  font-size: 12px;
  font-weight: 700;
  color: #e65100;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

@media (max-width: 600px) {
  body {
    padding: 0;
    background: white;
  }

  .container {
    border-radius: 0;
    box-shadow: none;
    padding: 20px 16px;
    max-width: none;
  }

  .subtitle {
    display: none;
  }

  .search-box {
    margin-bottom: 0.5rem;
  }

  .capitals-map {
    height: 360px;
    border-radius: 0;
    margin-left: -16px;
    margin-right: -16px;
    margin-top: 0;
    margin-bottom: 0;
    width: calc(100% + 32px);
  }
}

.station-popup {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.station-popup h4 {
  margin: 0 0 5px 0;
  font-size: 0.95em;
  color: #333;
}

.station-popup .state {
  color: #666;
  font-size: 0.85em;
  margin-bottom: 8px;
}

.station-popup .view-link {
  display: inline-block;
  background: #2a5298;
  color: white;
  padding: 5px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85em;
}

.station-popup .view-link:hover {
  background: #1e3c72;
}
