* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f4f8;
  color: #1a2332;
}

/* ── HEADER ── */
header {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  color: white;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo { font-size: 26px; }

header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* NAV */
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.18);
  color: white;
  transform: translateY(-1px);
}

.nav-btn.active {
  background: #38bdf8;
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(56,189,248,0.4);
}

/* PAGES */
.page { display: none; padding: 20px; }
.page.active { display: block; }

/* MAP */
#map {
  width: 100%;
  height: 70vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* PANEL */
.panel {
  background: white;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin-bottom: 16px;
  border-left: 4px solid #38bdf8;
}

/* CONTROLS */
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

select, button, input, textarea {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #d1d9e0;
  font-size: 14px;
  font-family: inherit;
}

select, input { background: white; }

button { cursor: pointer; background: #f1f5f9; color: #1a2332; }

.danger-btn {
  background: #dc2626;
  color: white;
  border: none;
}
.danger-btn:hover { background: #b91c1c; }

/* FISH LIST */
.fish-list { display: grid; gap: 12px; }

.fish-card {
  background: white;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 4px solid #38bdf8;
}
.fish-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.fish-card h3 { margin: 0 0 8px 0; font-size: 16px; }

/* TEXT */
.muted { color: #64748b; font-size: 14px; }
.empty {
  background: white; padding: 24px;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  color: #64748b; text-align: center;
}
.small-note { margin-top: 8px; color: #0369a1; font-size: 12px; font-weight: 600; }

/* ── STATISTICS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  text-align: center;
  border-top: 3px solid #38bdf8;
}

.stat-card .stat-icon { font-size: 30px; margin-bottom: 6px; }
.stat-card .stat-number { font-size: 28px; font-weight: 800; color: #0f172a; }
.stat-card .stat-label { font-size: 12px; color: #64748b; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

.stats-section-title {
  font-size: 15px; font-weight: 700; color: #1e3a5f;
  margin: 20px 0 10px; text-transform: uppercase;
  letter-spacing: 0.5px;
}

.top-list {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin-bottom: 20px;
}

.top-list-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.top-list-row:last-child { border-bottom: none; }
.top-list-row:hover { background: #f8fafc; }

.top-rank { font-size: 18px; width: 28px; text-align: center; }
.top-info { flex: 1; }
.top-name { font-weight: 600; font-size: 14px; }
.top-meta { font-size: 12px; color: #64748b; }
.top-value { font-weight: 800; color: #0f172a; font-size: 16px; }

.chart-bar-wrap { margin-bottom: 20px; }

.chart-row {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 8px;
}
.chart-label { width: 100px; font-size: 13px; color: #334155; font-weight: 500; flex-shrink: 0; }
.chart-bar-bg { flex: 1; height: 22px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: linear-gradient(90deg, #38bdf8, #0ea5e9); border-radius: 999px; transition: width 0.6s ease; }
.chart-count { width: 28px; text-align: right; font-size: 13px; font-weight: 700; color: #0f172a; }

/* ── ENCYCLOPEDIA ── */
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }

.enc-filter {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid #d1d9e0;
  background: white;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.enc-filter:hover { border-color: #38bdf8; color: #0ea5e9; }
.enc-filter.on { background: #0ea5e9; color: white; border-color: transparent; box-shadow: 0 3px 10px rgba(14,165,233,0.3); }

.search-box { margin-left: auto; }
.search-box input {
  width: 220px;
  background: white;
  transition: width 0.2s;
}
.search-box input:focus { width: 260px; outline: none; border-color: #38bdf8; }

.enc-section-title {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: #94a3b8; margin: 24px 0 12px;
  display: flex; align-items: center; gap: 12px;
}
.enc-section-title::after {
  content: ''; flex: 1; height: 1px; background: #e2e8f0;
}

.enc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.enc-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: all 0.25s;
  border: 1px solid #e8f0f6;
}
.enc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
  border-color: #bae6fd;
}
.enc-card.enc-hide { display: none; }

.enc-card-top {
  padding: 20px 20px 0;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.enc-icon { font-size: 44px; line-height: 1; transition: transform 0.3s; }
.enc-card:hover .enc-icon { transform: scale(1.1) rotate(-4deg); }

.enc-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

.enc-badge {
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap;
}
.b-fresh  { background: #e0f2fe; color: #0369a1; }
.b-sea    { background: #dbeafe; color: #1d4ed8; }
.b-river  { background: #dcfce7; color: #166534; }
.b-both   { background: #ede9fe; color: #7c3aed; }
.diff-lett     { background: #dcfce7; color: #166534; }
.diff-middels  { background: #fef9c3; color: #854d0e; }
.diff-krevende { background: #fee2e2; color: #991b1b; }

.enc-card-body { padding: 14px 20px 20px; }

.enc-name { font-size: 20px; font-weight: 800; color: #0f172a; margin-bottom: 2px; }
.enc-latin { font-size: 11px; font-style: italic; color: #94a3b8; margin-bottom: 10px; }
.enc-desc { font-size: 13px; line-height: 1.65; color: #475569; margin-bottom: 16px; }

.enc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.enc-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 8px 10px;
}
.enc-stat-l { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: #94a3b8; margin-bottom: 2px; }
.enc-stat-v { font-size: 12px; font-weight: 600; color: #1e293b; }

.enc-record {
  grid-column: 1/-1;
  background: linear-gradient(90deg, #fefce8, #fefbe8);
  border: 1px solid #fde68a;
  border-radius: 8px; padding: 8px 10px;
  display: flex; align-items: center; gap: 8px;
}
.enc-record-l { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: #92400e; opacity: 0.7; }
.enc-record-v { font-size: 12px; font-weight: 700; color: #92400e; }

.enc-log-btn {
  width: 100%; margin-top: 12px;
  padding: 10px; border-radius: 9px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1; font-weight: 600;
  font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.enc-log-btn:hover { background: #e0f2fe; border-color: #38bdf8; }

/* LURES */
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content {
  width: min(260px, 70vw);
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 12px;
  padding-right: 6px;
}

.popup-form { max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.popup-form label {
  display: block; margin-top: 8px; margin-bottom: 4px;
  font-weight: 600; font-size: 12px; color: #334155;
}
.popup-form input, .popup-form select, .popup-form textarea,
.popup-form button { width: 100%; box-sizing: border-box; }
.popup-form button {
  margin-top: 10px;
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  color: white; border: none; cursor: pointer; border-radius: 10px;
  font-weight: 600; padding: 10px;
}
.popup-form button:hover { background: #0f172a; }

.lure-card {
  background: white; border-radius: 14px; padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07); transition: all 0.2s;
  border-left: 4px solid #f59e0b;
}
.lure-card:hover { transform: translateY(-2px); }
.lure-card h3 { margin: 0 0 10px 0; font-size: 15px; }
.lure-meta { margin: 5px 0; font-size: 13px; }
.lure-tag {
  display: inline-block; background: #fef3c7; color: #92400e;
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; margin-bottom: 8px;
}
.lure-note { margin-top: 10px; font-style: italic; color: #64748b; font-size: 13px; }
.lure-funfact { margin-top: 8px; font-size: 12px; color: #0369a1; background: #f0f9ff; border-left: 3px solid #38bdf8; padding: 6px 10px; border-radius: 0 8px 8px 0; }

/* Lure card layout — image on right */
.lure-card-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.lure-card-content { flex: 1; min-width: 0; }

.lure-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 6px;
  flex-shrink: 0;
}

/* SVG bait icon on right side */
.lure-bait-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
}
.lure-bait-icon svg {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}

/* Inline fish SVG icon (Mine fisker, popup, stats) */
.fish-svg-icon {
  display: inline-block;
  width: 26px;
  height: 26px;
  vertical-align: middle;
  margin-right: 4px;
}
.fish-svg-icon svg { width: 26px; height: 26px; }

/* Fish SVG icon in encyclopedia card */
.enc-icon svg {
  width: 44px;
  height: 44px;
  transition: transform 0.3s;
}
.enc-card:hover .enc-icon svg {
  transform: scale(1.1) rotate(-4deg);
}

/* Fish filter chip strip */
.fish-filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}
.fish-filter-scroll::-webkit-scrollbar { display: none; }

.fish-filter-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
.fish-filter-chip:hover { border-color: #38bdf8; color: #0ea5e9; }
.fish-filter-chip.active {
  background: #0ea5e9;
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 10px rgba(14,165,233,0.3);
}
.fish-chip-icon {
  display: inline-flex;
  align-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.fish-chip-icon svg { width: 20px; height: 20px; }

/* Legal disclaimer box */
.disclaimer-box {
  margin: 12px 16px 4px;
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  font-size: 12px;
  color: #78350f;
  line-height: 1.5;
}
.disclaimer-box p { margin: 0 0 6px 0; }
.disclaimer-box p:last-child { margin-bottom: 0; }

/* RESPONSIVE */
@media (max-width: 640px) {
  header { flex-direction: column; align-items: flex-start; }
  nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .nav-btn { white-space: nowrap; font-size: 12px; padding: 7px 12px; }
  #map { height: 60vh; }
  .enc-grid { grid-template-columns: 1fr; }
  .search-box { width: 100%; }
  .search-box input { width: 100% !important; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .leaflet-popup-content { width: min(240px, 75vw); max-height: 50vh; }
  .popup-form { max-height: 45vh; }
}
