/* birds.css — Bird detection tab styles */

/* Tab navigation */
.tab-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}
.tab-link {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.15s;
}
.tab-link:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface2);
}
.tab-active {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
  background: rgba(168,196,74,0.08) !important;
}

/* Birds layout — same grid as main but wider main area */
.birds-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 64px);
}

/* Station summary stats */
.bird-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.bird-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.bird-stat-val {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: #5bc8f5;
  line-height: 1;
}
.bird-stat-label {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.station-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
}
.meta-label { color: var(--muted); }
.meta-val   { color: var(--text); }

.bird-hr-bar { background: #5bc8f5 !important; }

.bw-link {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: #5bc8f5;
  text-decoration: none;
  padding: 8px 0;
  transition: color 0.15s;
}
.bw-link:hover { color: var(--accent); text-decoration: underline; }

/* Daily trend chart */
.bird-trend-panel { margin-bottom: 20px; }
.daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  margin-top: 10px;
  overflow: hidden;
}
.day-bar-wrap {
  flex: 1;
  min-width: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.day-bar {
  width: 100%;
  background: linear-gradient(to top, #1e6a8a, #5bc8f5);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.4s ease;
}
.day-bar:hover { filter: brightness(1.25); }
.day-label {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
}

/* Species grid */
.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.species-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  animation: fadeUp 0.3s ease both;
}
.species-card:hover {
  transform: translateY(-2px);
  border-color: #5bc8f5;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.species-img-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface2);
  overflow: hidden;
}
.species-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.species-card:hover .species-img-wrap img { transform: scale(1.05); }
.no-bird-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--muted);
}
.species-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: #5bc8f5;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid rgba(91,200,245,0.3);
}
.species-card-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.species-common {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.species-scientific {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
.species-count-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.species-det-count {
  font-family: var(--mono);
  font-size: 12px;
  color: #5bc8f5;
  font-weight: 500;
}
.species-prob {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

/* Confidence breakdown bar */
.confidence-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface2);
  cursor: help;
}
.cb-seg { height: 100%; transition: width 0.4s ease; }
.cb-certain   { background: #5db87a; }
.cb-likely    { background: #a8c44a; }
.cb-uncertain { background: #e8a030; }
.cb-unlikely  { background: #e05a3a; }
.confidence-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}
.cl-certain   { color: #5db87a; }
.cl-likely    { color: #a8c44a; }
.cl-uncertain { color: #e8a030; }

.species-link {
  font-family: var(--mono);
  font-size: 10px;
  color: #5bc8f5;
  text-decoration: none;
  margin-top: 2px;
}
.species-link:hover { text-decoration: underline; }

/* Recent detections table */
.recent-panel { margin-top: 8px; }
.recent-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 4px;
}
.recent-table th {
  background: var(--surface2);
  color: var(--muted);
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.recent-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.recent-table tr:hover td { background: var(--surface2); }
.recent-species {
  display: flex;
  align-items: center;
  gap: 8px;
}
.recent-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.recent-name {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.recent-name:hover { color: #5bc8f5; text-decoration: underline; }
.recent-sci { color: var(--muted); font-style: italic; }
.recent-time { color: var(--muted); white-space: nowrap; }
.recent-certainty { color: var(--muted); text-transform: lowercase; }
.no-audio { color: var(--border); }

/* Confidence badges */
.conf-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
}
.conf-almost_certain { background: rgba(93,184,122,0.2); color: #5db87a; border: 1px solid rgba(93,184,122,0.3); }
.conf-very_likely    { background: rgba(168,196,74,0.2); color: #a8c44a; border: 1px solid rgba(168,196,74,0.3); }
.conf-uncertain      { background: rgba(232,160,48,0.2); color: #e8a030; border: 1px solid rgba(232,160,48,0.3); }
.conf-unlikely       { background: rgba(224,90,58,0.2);  color: #e05a3a; border: 1px solid rgba(224,90,58,0.3); }

/* Audio player */
.mini-audio {
  height: 24px;
  width: 160px;
  accent-color: #5bc8f5;
}

/* Responsive */
@media(max-width:900px) {
  .birds-layout { grid-template-columns: 1fr; }
  .tab-nav { margin: 0; }
  .species-grid { grid-template-columns: 1fr 1fr; }
}
@media(max-width:500px) {
  .species-grid { grid-template-columns: 1fr; }
}
