/* Tank Logic — fish-database.css  NATURE THEME */

.db-hero { padding-top: calc(var(--nav-h) + 52px); padding-bottom: 52px; border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.db-hero::before { content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(45,122,58,0.06) 0%, transparent 70%); top: -150px; right: -100px; pointer-events: none; }
.db-hero__inner { max-width: 700px; position: relative; z-index: 1; }
.db-hero h1 { font-family: var(--font-head); margin-bottom: 14px; }

.db-filter-bar { display: flex; flex-direction: column; gap: 14px; margin-top: 32px; }
.db-search-wrap { position: relative; max-width: 480px; }
.db-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 1rem; pointer-events: none; color: var(--tx-lo); }
.db-search { width: 100%; background: var(--bg-1); border: 1px solid var(--border-mid); border-radius: var(--r-md); padding: 13px 18px 13px 40px; font-size: var(--sz-15); font-family: var(--font); color: var(--tx-hi); outline: none; box-shadow: var(--shadow-sm); transition: border-color 0.2s, box-shadow 0.2s; }
.db-search::placeholder { color: var(--tx-xlo); }
.db-search:focus { border-color: var(--accent-mid); box-shadow: 0 0 0 3px rgba(45,122,58,0.1); }
.db-filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.db-filter-btn { padding: 7px 16px; border-radius: 100px; border: 1px solid var(--border-mid); background: var(--bg-1); color: var(--tx-lo); font-size: var(--sz-13); font-weight: 600; font-family: var(--font); cursor: pointer; transition: all 0.18s; white-space: nowrap; }
.db-filter-btn:hover  { border-color: var(--accent-mid); color: var(--tx-hi); }
.db-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.db-section { padding-block: 48px; }
.db-results-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.db-results-header h2 { font-family: var(--font-head); font-size: 1.3rem; color: var(--tx-hi); }
.db-count { font-size: var(--sz-13); color: var(--tx); font-family: var(--font); }

.fish-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.fish-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.fish-card:hover { transform: translateY(-3px); border-color: var(--border-mid); box-shadow: var(--shadow-lg); }
.fish-card.hidden { display: none; }
.fish-card__inner { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.fish-card__emoji { font-size: 2rem; flex-shrink: 0; width: 52px; height: 52px; background: var(--bg-2); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; }
.fish-card__info  { flex: 1; min-width: 0; }
.fish-card__name  { font-family: var(--font-head); font-size: var(--sz-15); font-weight: 700; color: var(--tx-hi); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fish-card__sci   { font-size: var(--sz-13); color: var(--tx-lo); font-style: italic; margin-bottom: 8px; }
.fish-card__tags  { display: flex; flex-wrap: wrap; gap: 5px; }
.fish-tag         { font-size: var(--sz-12); font-weight: 700; font-family: var(--font-head); padding: 2px 8px; border-radius: 100px; border: 1px solid transparent; }
.fish-tag-cat     { background: var(--water-lo);  color: var(--water); border-color: var(--water-mid); }
.fish-tag-size    { background: var(--bg-2);       color: var(--tx-lo); border-color: var(--border); }
.fish-tag-easy    { background: var(--accent-lo);  color: var(--accent); border-color: var(--accent-mid); }
.fish-tag-medium  { background: var(--gold-lo);    color: var(--gold);   border-color: rgba(200,134,10,0.2); }
.fish-tag-hard    { background: rgba(201,64,64,0.08); color: var(--red); border-color: rgba(201,64,64,0.2); }
.fish-card__arrow { font-size: 1rem; color: var(--border-mid); flex-shrink: 0; transition: color 0.2s, transform 0.2s; }
.fish-card:hover .fish-card__arrow { color: var(--accent); transform: translateX(3px); }

.fish-modal-overlay { position: fixed; inset: 0; background: rgba(26,46,28,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.2s ease; }
.fish-modal-overlay[hidden] { display: none !important; }
.fish-modal-overlay.closing { animation: fadeOut 0.2s ease forwards; }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.fish-modal { background: var(--bg-1); border: 1px solid var(--border-mid); border-radius: var(--r-xl); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: var(--shadow-lg); }
.fish-modal-overlay.closing .fish-modal { animation: slideDown 0.2s ease forwards; }
@keyframes slideUp   { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { transform: translateY(0); opacity: 1; }    to { transform: translateY(24px); opacity: 0; } }
.fish-modal__header { display: flex; align-items: center; gap: 16px; padding: 24px 24px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-1); z-index: 1; }
.fish-modal__emoji  { font-size: 2.8rem; flex-shrink: 0; width: 64px; height: 64px; background: var(--bg-2); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; }
.fish-modal__name   { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; color: var(--tx-hi); margin-bottom: 4px; }
.fish-modal__sci    { font-size: var(--sz-14); color: var(--tx-lo); font-style: italic; }
.fish-modal__close  { margin-left: auto; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--tx-lo); font-size: 1.1rem; width: 34px; height: 34px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: color 0.2s, border-color 0.2s; }
.fish-modal__close:hover { color: var(--tx-hi); border-color: var(--accent-mid); }
.fish-modal__body   { padding: 24px; }

.modal-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 22px; }
.modal-stat  { background: var(--bg-2); border-radius: var(--r-sm); padding: 12px 14px; }
.modal-stat-label  { font-family: var(--font-head); font-size: var(--sz-12); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tx-lo); margin-bottom: 4px; }
.modal-stat-val    { font-family: var(--font-head); font-size: var(--sz-14); font-weight: 700; color: var(--tx-hi); }
.modal-section-title { font-family: var(--font-head); font-size: var(--sz-12); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--tx-lo); margin-bottom: 10px; margin-top: 20px; }
.modal-care-text { font-size: var(--sz-15); color: var(--tx); line-height: 1.78; margin-bottom: 14px; }
.modal-compat-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.modal-cta { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--border); }
.modal-cta .btn { flex: 1; justify-content: center; font-size: 0.85rem; }

.db-no-results { text-align: center; padding: 52px 20px; color: var(--tx); }
.db-no-results-icon { font-size: 3rem; margin-bottom: 14px; }
.db-no-results h3   { font-family: var(--font-head); margin-bottom: 10px; color: var(--tx-hi); }
.db-no-results p    { font-size: var(--sz-14); color: var(--tx); }

@media (min-width: 540px)  { .fish-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .fish-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .fish-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 540px)  { .modal-stats { grid-template-columns: repeat(3, 1fr); } }


/* ── Animated species icons ─────────────────────────────── */
.tl-fish { display:block; width:40px; height:26px; animation: tl-swim 2.6s ease-in-out infinite; }
.tl-fish--big { width:52px; height:34px; }
.tl-fish svg { width:100%; height:100%; overflow:visible; }
.tl-fish__body path:first-child, .tl-fish__tail path { fill: var(--fish-c, #6FBF8E); }
.tl-fish__fin { fill: var(--fish-c, #6FBF8E); opacity:.65; }
.tl-fish__eye { fill:#030402; stroke:#FCFCFC; stroke-width:1.4; }
.tl-fish__barbel { fill:none; stroke: var(--fish-c, #C9995B); stroke-width:1.6; stroke-linecap:round; }
.tl-fish__tail { animation: tl-tail 0.9s ease-in-out infinite; transform-origin: 78% 50%; }
.tl-fish--nano   { --fish-c:#5FB7CC; }
.tl-fish--mid    { --fish-c:#6FBF8E; }
.tl-fish--large  { --fish-c:#C9995B; }
.tl-fish--bottom { --fish-c:#6b4f2a; }
.tl-invert { font-size:1.7rem; line-height:1; }
@keyframes tl-swim {
  0%,100% { transform: translateX(0) translateY(0) rotate(0deg); }
  30%     { transform: translateX(-2px) translateY(-1px) rotate(-2deg); }
  65%     { transform: translateX(1px) translateY(1px) rotate(1.5deg); }
}
@keyframes tl-tail {
  0%,100% { transform: rotate(7deg); }
  50%     { transform: rotate(-9deg); }
}
@media (prefers-reduced-motion: reduce) {
  .tl-fish, .tl-fish__tail { animation: none; }
}

/* ── Grouped sections + shape variants ── */
.db-group-label{ grid-column:1/-1; font-family:var(--font-head); font-weight:600;
  font-size:1.25rem; color:var(--tx-hi); padding:18px 2px 2px; margin-top:6px;
  border-bottom:1px solid var(--border); display:flex; align-items:baseline; gap:10px; }
.db-group-label:first-child{ margin-top:0; padding-top:4px; }
.db-group-count{ font-family:var(--font,inherit); font-size:.78rem; font-weight:600;
  color:var(--accent); background:var(--accent-lo); border-radius:20px; padding:2px 10px; }
.tl-fish--betta, .tl-fish--angel{ width:46px; height:30px; }
.tl-fish--kuhli{ width:46px; height:24px; }
.tl-fish__thread{ fill:none; stroke:var(--fish-c,#6FBF8E); stroke-width:1.5; stroke-linecap:round; opacity:.8; }
.tl-invert{ display:inline-block; animation: tl-bob 3s ease-in-out infinite; }
@keyframes tl-bob{ 0%,100%{ transform:translateY(0) rotate(-2deg);} 50%{ transform:translateY(-3px) rotate(2deg);} }
@media (prefers-reduced-motion:reduce){ .tl-fish,.tl-fish__tail,.tl-invert{ animation:none!important; } }
