/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Box sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Global */
body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  padding: 1em;
  background: #f3f4f6;
  color: #2d2d2d;
  line-height: 1.6;
}

/* Container */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 1em;
}

/* Logo */
h1 {
  margin: 0.5em 0 0.2em;
  text-align: center;
}

h1 img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  max-height: 44px;
}

/* Red divider */
.header-divider {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, transparent, #d71920 15%, #d71920 85%, transparent);
  margin: 0.5em auto 1.4em;
  border-radius: 2px;
}

/* Controls panel */
.controls {
  background: #fff;
  padding: 1.4em 1.6em;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid #e5e7eb;
}

/* "Starting point" section label above radio options */
.starting-conditions::before {
  content: "Starting point";
  display: block;
  width: 100%;
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9ca3af;
  margin-bottom: 0.5em;
}

/* Starting conditions layout */
.starting-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em;
}

.starting-conditions label {
  flex: 1;
  min-width: 200px;
}

/* Labels */
.controls label {
  display: block;
  font-size: 0.88em;
  font-weight: 500;
  color: #4b5563;
}

/* Radio button accent */
.controls label input[type="radio"] {
  accent-color: #d71920;
  margin-right: 0.35em;
  vertical-align: -1px;
}

/* Form controls */
.controls select,
.controls input[type="text"] {
  width: 100%;
  margin-top: 0.45em;
  padding: 0.58em 2.2em 0.58em 0.75em;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.9em;
  font-family: inherit;
  background-color: #f9fafb;
  color: #2d2d2d;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236b7280' d='M5 7L0.67 2h8.66z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75em center;
}

.controls input[type="text"] {
  background-image: none;
  padding-right: 0.75em;
}

.controls select:focus,
.controls input[type="text"]:focus {
  outline: none;
  border-color: #d71920;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.1);
  background-color: #fff;
}

/* Divider between start options and show home picker */
.showhome-row {
  display: flex;
  gap: 0.7em;
  margin-top: 1.3em;
  padding-top: 1.2em;
  border-top: 1px solid #f0f1f3;
  align-items: flex-end;
}

.showhome-row select {
  flex: 3;
}

/* Search button */
.showhome-row button {
  flex: 1;
  padding: 0.6em 1em;
  background: #d71920;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.9em;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(215, 25, 32, 0.3);
  white-space: nowrap;
}

.showhome-row button:hover {
  background: #b5151b;
  box-shadow: 0 4px 12px rgba(215, 25, 32, 0.38);
}

.showhome-row button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(215, 25, 32, 0.2);
}

/* Results container */
#results {
  margin-top: 1.5em;
}

/* Nearest show home card */
.nearest-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8em;
  background: #fff;
  padding: 1.1em 1.3em 1.1em 1.5em;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  border: 1px solid #e5e7eb;
  border-left: 4px solid #d71920;
  margin-bottom: 0.9em;
  font-size: 0.95em;
}

/* Filled red pill label */
.nearest-card .card-label {
  position: absolute;
  top: -0.9em;
  left: 1.2em;
  background: #d71920;
  color: #fff;
  font-size: 0.62em;
  font-weight: 700;
  padding: 0.2em 0.8em;
  border-radius: 999px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(215, 25, 32, 0.3);
  white-space: nowrap;
}

.nearest-card .info {
  flex: 1;
  color: #333;
}

.nearest-card .info strong {
  display: block;
  color: #d71920;
  font-size: 1.05em;
}

.nearest-card a {
  padding: 0.45em 1em;
  background: #d71920;
  color: #fff;
  border-radius: 7px;
  text-decoration: none;
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(215, 25, 32, 0.25);
}

.nearest-card a:hover {
  background: #b5151b;
  box-shadow: 0 3px 10px rgba(215, 25, 32, 0.35);
}

/* Other results — chip style */
.other-results {
  background: #fff;
  padding: 1em 1.2em;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 0.88em;
  color: #555;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.other-results strong {
  display: block;
  margin-bottom: 0.55em;
  color: #374151;
  font-weight: 600;
  font-size: 0.9em;
}

.other-results a {
  display: inline-block;
  margin: 0.2em 0.3em 0.2em 0;
  padding: 0.22em 0.7em;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  color: #4b5563;
  text-decoration: none;
  font-size: 0.88em;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.other-results a:hover {
  background: #d71920;
  color: #fff;
  border-color: #d71920;
}

/* Map */
#map {
  height: 380px;
  width: 100%;
  border: 1px solid #e0e3e7;
  border-radius: 10px;
  margin-top: 1.5em;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
}

/* Last sync */
#lastsync {
  color: #9ca3af;
  font-size: 0.78em;
  margin-top: 0.8em;
  text-align: center;
}

/* Disclaimer */
.updated {
  margin: 1.2em auto 1.5em;
  font-size: 0.78em;
  color: #9ca3af;
  text-align: center;
  max-width: 580px;
  line-height: 1.5;
}

/* Credit */
.credit {
  margin: 0.5em auto 1.5em;
  font-size: 0.82em;
  color: #9ca3af;
  text-align: center;
}

.credit a {
  display: inline-block;
  position: relative;
  font-weight: 600;
  text-decoration: none;
  /* Holographic foil: gradient sweeps left-to-right on a loop */
  background: linear-gradient(90deg,
    #d71920 0%,
    #ff6b6b 20%,
    #ffc0c0 35%,
    #ff6b6b 50%,
    #d71920 65%,
    #b01018 80%,
    #d71920 100%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: foil-sweep 4s linear infinite;
  transition: transform 0.25s ease, letter-spacing 0.25s ease, filter 0.25s ease;
}

.credit a:hover {
  transform: translateY(-2px);
  letter-spacing: 0.04em;
  filter: drop-shadow(0 0 6px rgba(215, 25, 32, 0.55));
}

/* Underline that draws in from the left on hover */
.credit a::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, #d71920, #ff9999);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 1px;
}

.credit a:hover::before {
  transform: scaleX(1);
}


@keyframes foil-sweep {
  0%   { background-position: 0% center; }
  100% { background-position: 250% center; }
}

/* Mobile */
@media (max-width: 600px) {
  body {
    padding: 0.5em;
  }

  .container {
    padding: 0.5em;
  }

  .controls {
    padding: 1em 1.1em;
  }

  .starting-conditions {
    display: block;
  }

  .starting-conditions label {
    display: block;
    margin-bottom: 0.8em;
  }

  .controls select,
  .controls input[type="text"] {
    font-size: 1em;
  }

  .showhome-row {
    flex-direction: column;
  }

  .showhome-row select,
  .showhome-row button {
    width: 100%;
  }

  #map {
    height: 280px;
  }

  .nearest-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .nearest-card a {
    align-self: stretch;
    text-align: center;
  }
}

/* Desktop */
@media (min-width: 600px) {
  h1 {
    margin: 1em 0;
  }

  h1 img {
    max-height: 52px;
  }
}
