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

body {
  font-family: system-ui, sans-serif;
  background: #f0f8ff;
  color: #1a2a3a;
  min-height: 100vh;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.8rem;
  color: #005f8e;
}

header p {
  color: #4a6a8a;
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

thead th {
  background: #005f8e;
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

thead th:nth-child(1) { width: 3%; }
thead th:nth-child(2) { width: 22%; }
thead th:nth-child(3) { width: 15%; }
thead th:nth-child(4) { width: auto; }

tbody tr.video-row {
  cursor: pointer;
  border-bottom: 1px solid #e0ecf4;
  transition: background 0.15s;
}

tbody tr.video-row:hover { background: #e8f4fb; }

tbody tr.video-row td {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  text-align: left;
}

.toggle-icon {
  display: inline-block;
  width: 1.2em;
  transition: transform 0.2s;
  color: #005f8e;
  font-style: normal;
}

.toggle-icon.open { transform: rotate(90deg); }

tr.sightings-row td {
  padding: 0;
  background: #f5fbff;
}

.sightings-inner {
  padding: 0.75rem 1.5rem 1rem 2.5rem;
}

.sightings-inner table {
  table-layout: auto;
  box-shadow: none;
  border-radius: 4px;
  border: 1px solid #c8dff0;
}

.sightings-inner thead th {
  background: #3a8ab5;
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
}

.sightings-inner tbody td {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #ddeef8;
  text-align: left;
}

.sightings-inner tbody tr:last-child td { border-bottom: none; }

.no-sightings {
  color: #7a9ab5;
  font-style: italic;
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

a { color: #005f8e; text-decoration: none; }
a:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  background: #d0eeff;
  color: #005f8e;
  border-radius: 999px;
  padding: 0.1em 0.6em;
  font-size: 0.85em;
  font-weight: 600;
}

.badge.zero {
  background: #fde8e8;
  color: #c0392b;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.pagination button {
  padding: 0.4rem 1rem;
  border: 1px solid #005f8e;
  background: #fff;
  color: #005f8e;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.pagination button:hover:not(:disabled) { background: #005f8e; color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: default; }

.pagination span { font-size: 0.9rem; color: #4a6a8a; }

.loading { text-align: center; padding: 2rem; color: #4a6a8a; }
.error { text-align: center; padding: 2rem; color: #c0392b; }

@media (max-width: 600px) {
  body { padding: 1rem 0.5rem; }

  header h1 { font-size: 1.3rem; }

  /* Let the table fill width without fixed column sizes */
  table { table-layout: auto; }
  thead th:nth-child(1) { width: 2em; }
  thead th:nth-child(2),
  thead th:nth-child(3),
  thead th:nth-child(4) { width: auto; }

  thead th,
  tbody tr.video-row td {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }

  /* Shorten the YouTube link text on mobile */
  tbody tr.video-row td:nth-child(4) a::before { content: "Watch ↗"; }
  tbody tr.video-row td:nth-child(4) a { font-size: 0; }
  tbody tr.video-row td:nth-child(4) a::before { font-size: 0.8rem; }

  .sightings-inner {
    padding: 0.5rem 0.5rem 0.75rem 0.5rem;
    overflow-x: auto;
  }

  .sightings-inner table {
    min-width: 420px; /* allow horizontal scroll rather than wrapping */
  }
}
