* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
  min-height: 100dvh;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────────────── */

.header {
  text-align: center;
  margin-bottom: 32px;
  color: white;
}

.header h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
}

.header p {
  margin: 8px 0 0 0;
  font-size: 15px;
  opacity: 0.9;
}

/* ── Controls ────────────────────────────────────────────────────── */

.controls {
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  outline: none;
  margin-bottom: 12px;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.status-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-filter-btn {
  padding: 8px 14px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.status-filter-btn:active {
  transform: scale(0.96);
}

.status-filter-btn.active {
  background: white;
  color: #1a75d1;
  border-color: white;
}

.add-species-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  background: white;
  color: #1a75d1;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.add-species-btn:active {
  transform: scale(0.97);
}

/* ── Table ───────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  margin-bottom: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  border-bottom: 2px solid #f0f0f0;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  color: #1a1a1a;
}

.name-cell {
  font-size: 15px;
  font-weight: 700;
}

.row-edit-link {
  color: inherit;
  text-decoration: none;
}

.row-edit-link:hover {
  text-decoration: underline;
}

.wbic-linked-icon {
  display: inline-block;
  margin-left: 6px;
  font-size: 13px;
  cursor: help;
  vertical-align: middle;
}

.catch-count-link {
  color: #4FACFE;
  font-weight: 700;
  text-decoration: none;
}

.catch-count-link:hover {
  text-decoration: underline;
}

.catch-count-zero {
  color: #ccc;
}

.data-row {
  cursor: pointer;
  transition: background 0.15s;
}

.data-row:hover {
  background: #f0f8ff;
}

.data-row:last-child td {
  border-bottom: none;
}

.empty-state {
  text-align: center;
  color: white;
  opacity: 0.9;
  font-size: 14px;
  margin: 20px 0;
}

/* ── Pills ───────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.pill-green { background: #e6fff2; color: #0d5c3f; }
.pill-red   { background: #fff0f0; color: #c0392b; }
.pill-amber { background: #fff8e6; color: #d98c00; }

/* ── Loading indicator ───────────────────────────────────────────── */

.loading-indicator {
  text-align: center;
  padding: 32px 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  margin-bottom: 16px;
}

.fishing-animation {
  font-size: 48px;
  margin-bottom: 12px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bobber {
  display: inline-block;
  margin-left: 8px;
  font-size: 24px;
  animation: bobbing 2s ease-in-out infinite;
}

@keyframes bobbing {
  0%, 100% { transform: translateY(0px);   opacity: 0.6; }
  50%       { transform: translateY(-12px); opacity: 1;   }
}

.loading-indicator p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: white;
}

/* ── Error card ──────────────────────────────────────────────────── */

.error-card {
  text-align: center;
  padding: 24px 16px;
  background: white;
  border-radius: 12px;
  margin-bottom: 16px;
}

.error-card .error-icon {
  font-size: 40px;
  margin: 0 0 12px 0;
}

.error-card p {
  font-size: 14px;
  color: #666;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.primary-button {
  display: inline-block;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
  color: white;
  cursor: pointer;
}

/* ── Back button ─────────────────────────────────────────────────── */

.back-button {
  display: block;
  width: 100%;
  padding: 14px 12px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.6);
  transition: background 0.2s, transform 0.2s;
}

.back-button:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.25);
}

/* ── Utility ─────────────────────────────────────────────────────── */

.hidden {
  display: none !important;
}
