/* =============================================
   Tank Logic — Fish Database CSS
   ============================================= */

/* ==================== HERO ==================== */
.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(0,200,160,0.07) 0%, transparent 70%);
  top: -150px; right: -100px;
  pointer-events: none;
}
.db-hero__inner { max-width: 700px; position: relative; z-index: 1; }
.db-hero h1 { margin-bottom: 14px; }

/* ==================== FILTER BAR ==================== */
.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;
}
.db-search {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 18px 13px 40px;
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--tx-hi);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.db-search::placeholder { color: var(--tx-lo); }
.db-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,200,160,0.12);
}

.db-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.db-filter-btn {
  padding: 7px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--tx-lo);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.db-filter-btn:hover  { border-color: var(--accent); color: var(--tx-hi); }
.db-filter-btn.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* ==================== DB LAYOUT ==================== */
.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-size: 1.3rem; color: var(--tx-hi); }
.db-count {
  font-size: 0.82rem;
  color: var(--tx);
  font-family: var(--font);
}

/* ==================== FISH GRID ==================== */
.fish-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* ==================== FISH CARD ==================== */
.fish-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.fish-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,200,160,0.35);
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
}
.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);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tx-hi);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fish-card__sci {
  font-size: 0.75rem;
  color: var(--tx);
  font-style: italic;
  margin-bottom: 8px;
}

.fish-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.fish-tag {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid transparent;
}
.fish-tag-cat    { background: rgba(0,148,255,0.1);  color: var(--blue); border-color: rgba(0,148,255,0.2); }
.fish-tag-size   { background: rgba(255,255,255,0.05); color: var(--tx-lo);   border-color: var(--border); }
.fish-tag-easy   { background: rgba(0,200,160,0.1);  color: var(--accent);   border-color: rgba(0,200,160,0.2); }
.fish-tag-medium { background: rgba(245,200,66,0.1); color: var(--gold);     border-color: rgba(245,200,66,0.2); }
.fish-tag-hard   { background: rgba(255,92,92,0.1);  color: #ff7070;               border-color: rgba(255,92,92,0.2); }

.fish-card__arrow {
  font-size: 1rem;
  color: var(--border);
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}
.fish-card:hover .fish-card__arrow { color: var(--accent); transform: translateX(3px); }

/* ==================== FISH MODAL ==================== */
.fish-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  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.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);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.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-size: 1.3rem; margin-bottom: 4px; }
.fish-modal__sci  { font-size: 0.82rem; 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); }

.fish-modal__body { padding: 24px; }

/* Stats grid inside modal */
.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-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx);
  font-family: var(--font);
  margin-bottom: 4px;
}
.modal-stat-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tx-hi);
  font-family: var(--font);
}

.modal-section-title {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tx);
  margin-bottom: 10px;
  margin-top: 20px;
}

.modal-care-text {
  font-size: var(--sz-14);
  color: var(--tx);
  line-height: 1.78;
  margin-bottom: 14px;
  letter-spacing: -0.003em;
}

.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; }

/* ==================== NO RESULTS ==================== */
.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   { margin-bottom: 10px; color: var(--tx-hi); }

/* ==================== RESPONSIVE ==================== */
@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); } }


/* ════════════════════════════════════════════════
   PHASE 1 — FISH DATABASE READABILITY PATCH
   ════════════════════════════════════════════════ */

/* Modal stat label — raised from 0.68rem */
.modal-stat-label {
  font-size: var(--sz-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tx);
  margin-bottom: 5px;
}

/* Modal care text — raise from 0.9rem */
.modal-care-text {
  font-size: var(--sz-15);
  color: var(--tx);
  line-height: 1.78;
  margin-bottom: 14px;
}

/* Modal section title */
.modal-section-title {
  font-size: var(--sz-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx);
  margin-bottom: 10px;
  margin-top: 20px;
}

/* Fish card description */
.fish-card__desc p,
.gi-card__desc {
  font-size: var(--sz-13);
  color: var(--tx);
  line-height: 1.6;
}

/* Fish card name */
.fish-card__name {
  font-size: var(--sz-15);
  font-weight: 600;
  color: var(--tx-hi);
  margin-bottom: 3px;
}

/* Filter buttons */
.db-filter-btn {
  font-size: var(--sz-13);
  color: var(--tx);
}
.db-filter-btn.active {
  color: var(--bg);
}

/* Search input */
.db-search {
  font-size: var(--sz-15);
  color: var(--tx-hi);
  padding: 12px 18px 12px 40px;
}

/* Database count */
.db-count {
  font-size: var(--sz-13);
  color: var(--tx);
}

/* ════════════════════════════════════════════════
   PHASE 1 READABILITY — fish-database.css
   ════════════════════════════════════════════════ */

.fish-card__name   { font-size: var(--sz-14); color: var(--tx-hi); font-weight: 600; }
.fish-card__sci    { font-size: var(--sz-12); color: var(--tx-lo); font-style: italic; }

.modal-care-text   { font-size: var(--sz-14); color: var(--tx); line-height: 1.78; }
.modal-stat-label  { font-size: var(--sz-11); color: var(--tx); }
.modal-stat-val    { font-size: var(--sz-14); color: var(--tx-hi); font-weight: 600; }

.db-count          { font-size: var(--sz-13); color: var(--tx); }
.db-results-header h2 { color: var(--tx-hi); }
.db-no-results h3  { color: var(--tx-hi); }
.db-no-results p   { color: var(--tx); }

.fish-tag          { font-size: var(--sz-11); }

/* ════════════════════════════════════════════════
   PHASE 1 — READABILITY FIXES (fish-database.css)
   ════════════════════════════════════════════════ */

/* Card text */
.fish-card__name    { font-size: var(--sz-15); }
.fish-card__sci     { font-size: var(--sz-13); color: var(--tx-lo); }
.fish-tag           { font-size: var(--sz-12); }

/* Modal */
.fish-modal__name   { font-size: 1.4rem; }
.fish-modal__sci    { font-size: var(--sz-14); }
.modal-stat-label   { font-size: var(--sz-12); color: var(--tx); font-weight: 700; }
.modal-stat-val     { font-size: var(--sz-14); }
.modal-care-text    { font-size: var(--sz-15); color: var(--tx); line-height: 1.75; }
.modal-section-title { font-size: var(--sz-12); }

/* Search/filter */
.db-search          { font-size: var(--sz-15); }
.db-filter-btn      { font-size: var(--sz-13); }

/* No results */
.db-no-results h3   { font-size: var(--sz-18); }
.db-no-results p    { font-size: var(--sz-14); color: var(--tx); }
