/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
}

/* Header Styles */
.header {
  background: #d00000;
  color: white;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.title-link {
  color: white;
  text-decoration: none;
}

.title-link:hover {
  text-decoration: none;
  color: white;
}

.title-short {
  display: none;
}

.nav-short {
  display: none;
}

.desktop-nav {
  display: flex;
  gap: 1.5rem;
}

.desktop-nav .nav-link {
  margin-top: 0;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: inline-block;
}

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

/* Main Page Styles */
#display {
  background: white;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ddd;
  font-size: 0.9rem;
  color: #666;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

.container {
  display: flex;
  height: calc(100vh - 160px);
}

#results {
  width: 350px;
  background: white;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
}

.controls-panel {
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
}

.find-button {
  width: 100%;
  background: #d00000;
  color: white;
  border: none;
  padding: 0.65rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 0.75rem;
}

.find-button:hover {
  background: #b00000;
}

.find-button:active {
  background: #900000;
}

.filter-group {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-left: 0.25rem;
}

.filter-group label {
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}

.filter-group input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

#map {
  flex: 1;
  height: 100%;
}

#station-list {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.station-item {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s;
  cursor: pointer;
}

.station-item:hover {
  background: #f0f0f0;
  border-color: #d00000;
}

.station-item.nearest {
  background: #fff3f3;
  border-color: #d00000;
  border-width: 2px;
}

.station-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  line-height: 1.3;
}

.station-location {
  color: #333;
  font-weight: 600;
  font-size: 0.9rem;
}

.station-location:after {
  content: " -";
  color: #999;
}

.station-freq {
  font-weight: bold;
  color: #d00000;
  font-size: 0.95rem;
}

.station-call {
  color: #333;
  font-weight: 600;
  font-size: 0.95rem;
}

.station-distance {
  color: #999;
  font-size: 0.9rem;
}

.distance-short {
  display: none;
}

.station-power {
  color: #666;
  font-size: 0.85em;
  background: #e8f5e9;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  display: inline-block;
  margin-top: 0.2rem;
}

.station-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.4rem;
  gap: 0.5rem;
}

.station-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.signal-indicator {
  font-size: 0.95em;
  font-weight: bold;
  letter-spacing: -1px;
  cursor: help;
}

.station-sports {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.station-sport {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  background: #e0e0e0;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-right: 0;
  line-height: 1.2;
}

.station-sport.football {
  background: #d00000;
  color: white;
}

.station-sport.volleyball {
  background: #333;
  color: white;
}

.station-sport.mens-basketball,
.station-sport.men-s-basketball {
  background: #6c6d70;
  color: white;
}

.station-sport.womens-basketball,
.station-sport.women-s-basketball {
  background: #FF1493;
  color: white;
}

.sport-short {
  display: none;
}

/* About Page Specific Styles */
body.about-page {
  line-height: 1.6;
}

.about-page .container {
  max-width: 800px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  height: auto;
  display: block;
}

h2 {
  color: #d00000;
  margin-bottom: 1rem;
  border-bottom: 2px solid #d00000;
  padding-bottom: 0.5rem;
}

h3 {
  color: #333;
  margin: 1.5rem 0 0.75rem 0;
}

p {
  margin-bottom: 1rem;
  color: #444;
}

.highlight {
  background: #fff3f3;
  padding: 1rem;
  border-left: 4px solid #d00000;
  margin: 1rem 0;
}

.highlight strong {
  color: #d00000;
}

a {
  color: #d00000;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* GPS Banner Styles */
.gps-banner {
  background: #fff3f3;
  padding: 1.5rem;
  border-left: 4px solid #d00000;
  margin: 1rem 0 2rem 0;
  border-radius: 4px;
}

.gps-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.gps-banner-text {
  flex: 1;
}

.gps-banner-title {
  color: #d00000;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  border: none;
  padding: 0;
}

.gps-banner-subtitle {
  color: #444;
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

.gps-banner-button {
  display: block;
  width: 80%;
  max-width: 500px;
  margin: 2rem auto;
  background: #d00000;
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(208, 0, 0, 0.3);
  border: 3px solid #d00000;
}

.gps-banner-button:hover {
  background: #b00000;
  border-color: #b00000;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(208, 0, 0, 0.4);
  text-decoration: none;
}

.gps-banner-button:active {
  transform: translateY(-1px);
  background: #900000;
  border-color: #900000;
  box-shadow: 0 3px 10px rgba(208, 0, 0, 0.3);
}

/* Station Table Styles */
.station-source {
  background: #fff3f3;
  padding: 1rem;
  border-left: 4px solid #d00000;
  margin: 1rem 0;
  border-radius: 4px;
}

.station-list-details {
  margin: 1.5rem 0;
}

.toggle-list-button {
  width: 100%;
  background: #f8f8f8;
  border: 2px solid #d00000;
  color: #d00000;
  padding: 1rem;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  list-style: none;
  text-align: center;
}

.toggle-list-button:hover {
  background: #fff3f3;
  border-color: #b00000;
  color: #b00000;
}

.toggle-list-button::-webkit-details-marker {
  display: none;
}

.station-list-details[open] .toggle-list-button {
  margin-bottom: 1.5rem;
}

.filter-controls {
  margin: 1.5rem 0;
  display: flex;
  gap: 1.5rem;
}

.filter-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
}

.filter-controls input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
}

.station-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.station-table th,
.station-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.station-table th {
  background: #f8f8f8;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
}

.station-table tr:hover {
  background: #f9f9f9;
}

.station-table tr:last-child td {
  border-bottom: none;
}

.station-count {
  text-align: center;
  color: #666;
  font-style: italic;
  margin-top: 1rem;
}


/* FAQ Section Styles */
.faq-section {
  background: white;
  padding: 1.5rem;
  margin: 0;
  border-top: 1px solid #e0e0e0;
}

.faq-section h2 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1rem;
  border-bottom: none;
  padding-bottom: 0;
}

.faq-section details {
  margin-bottom: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fafafa;
}

.faq-section summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
  list-style: none;
}

.faq-section summary::-webkit-details-marker {
  display: none;
}

.faq-section summary::before {
  content: "+ ";
  color: #d00000;
  font-weight: bold;
}

.faq-section details[open] summary::before {
  content: "- ";
}

.faq-section summary:hover {
  background: #f0f0f0;
}

.faq-section details p {
  padding: 0.75rem 1rem;
  margin: 0;
  font-size: 0.85rem;
  color: #555;
  border-top: 1px solid #e0e0e0;
  background: white;
}

/* Static stations (noscript fallback) */
.static-stations {
  background: white;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.static-stations h2 {
  color: #d00000;
  border-bottom: 2px solid #d00000;
  padding-bottom: 0.5rem;
}

.static-stations h3 {
  margin-top: 1.5rem;
}

.static-stations ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.static-stations li {
  margin-bottom: 0.5rem;
}

/* FAQ on about page */
.about-faq {
  padding: 0;
  border-top: none;
  margin-top: 0.5rem;
}

/* Footer Styles */
.footer {
  background: #f8f8f8;
  border-top: 1px solid #e0e0e0;
  padding: 1rem;
  text-align: center;
  color: #666;
  font-size: 0.85rem;
  line-height: 1.4;
}

.about-page .footer {
  margin-top: 2rem;
}

.footer a {
  color: #d00000;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-divider {
  margin: 0 0.5rem;
  color: #ccc;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Header Navigation */
  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0.6rem 0.75rem;
  }

  .header h1 {
    font-size: 1rem;
    flex: 1;
    min-width: 0;
  }

  .title-link {
    white-space: nowrap;
  }

  .title-long {
    display: none;
  }

  .title-short {
    display: inline;
  }

  .nav-long {
    display: none;
  }

  .nav-short {
    display: inline;
  }

  .desktop-nav {
    flex-shrink: 0;
    gap: 0.75rem;
  }

  .desktop-nav .nav-link {
    font-size: 0.8rem;
  }

  .container {
    flex-direction: column;
    height: calc(100vh - 120px); /* Reduced from 200px to account for smaller header/footer */
  }

  #results {
    width: 100%;
    height: auto;
    max-height: 280px; /* Reduced from 320px */
    border-right: none;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
  }

  #station-list {
    max-height: 180px; /* Reduced from 200px */
    overflow-y: auto;
  }

  #map {
    flex: 1;
    min-height: 300px; /* Increased from 250px */
    max-height: none; /* Remove max-height restriction */
  }

  .controls-panel {
    padding: 0.75rem;
  }

  .find-button {
    padding: 0.6rem;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }

  .filter-group {
    flex-wrap: wrap;
  }

  .station-item {
    padding: 0.5rem;
    margin-bottom: 0.3rem;
    display: block;
  }

  .station-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
  }

  .station-location {
    font-size: 0.9rem;
    font-weight: 600;
  }

  .station-freq {
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
  }

  .station-call {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .station-distance {
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .distance-long {
    display: none;
  }

  .distance-short {
    display: inline;
  }

  .station-meta {
    margin-top: 0.35rem;
    gap: 0.5rem;
  }

  .station-sports {
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
  }

  .station-sport {
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
  }

  .station-right {
    gap: 0.35rem;
  }

  .signal-indicator {
    font-size: 0.9em;
  }

  .sport-long {
    display: none;
  }

  .sport-short {
    display: inline;
  }

  /* Footer - compact for mobile */
  .footer {
    padding: 0.5rem;
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .footer-divider {
    display: none; /* Hide dividers on mobile */
  }

  .footer a {
    display: inline-block;
    margin: 0 0.25rem;
  }

  /* About page mobile styles */
  .about-page .container {
    margin: 1rem;
    padding: 1.5rem;
  }

  /* GPS Banner mobile styles */
  .gps-banner {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .gps-banner-content {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .gps-banner-title {
    font-size: 1.2rem;
  }

  .gps-banner-subtitle {
    font-size: 0.9rem;
  }

  .gps-banner-button {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  /* Station table mobile styles */
  .filter-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    justify-content: center;
    overflow-x: auto;
  }

  .filter-controls label {
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .filter-controls label span {
    font-size: 0.85rem;
  }

  .station-table {
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .station-table thead {
    display: none; /* Hide header on mobile */
  }

  .station-table tbody {
    display: block;
  }

  .station-table tr {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.5rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
  }

  .station-table tr:hover {
    background: white;
  }

  .station-table td {
    display: block;
    padding: 0.2rem 0;
    border: none;
    text-align: left;
  }

  .station-table td:before {
    display: none; /* Remove labels on mobile */
  }

  /* City, Frequency and call sign all on same line */
  .station-table td:first-child,
  .station-table td:nth-child(3),
  .station-table td:nth-child(4) {
    display: inline;
  }

  /* Style city */
  .station-table td:first-child {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
  }

  .station-table td:first-child:after {
    content: " - ";
    color: #999;
    font-weight: normal;
  }

  /* Frequency */
  .station-table td:nth-child(3) {
    color: #333;
    font-weight: 600;
  }

  .station-table td:nth-child(3):after {
    content: " ";
    color: #999;
  }

  /* Call sign */
  .station-table td:nth-child(4) {
    color: #d00000;
    font-weight: 600;
  }

  /* Sports row */
  .station-table td:last-child {
    padding-top: 0.4rem;
  }

  /* Sports badges in table */
  .station-table .station-sport {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin-right: 0.3rem;
    margin-bottom: 0.3rem;
    display: inline-block;
  }

  /* Hide state on mobile via data attribute */
  .station-table td:nth-child(2) {
    display: none;
  }

  .gps-banner-button {
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
  }
}