@font-face {
  font-family: 'Amstrad';
  src: url('fonts/Ac437_Amstrad_PC-2y.ttf') format('truetype');
}

/* ── back button ── */
#backbutton {
  position: fixed;
  top: 16px;
  left: 20px;
  font-family: 'Amstrad', monospace;
  font-size: 1rem;
  color: #000;
  text-decoration: none;
  z-index: 999;
  background: rgba(255,255,255,0.6);
  padding: 4px 10px;
  border: 1.5px solid #333;
}

#backbutton:hover {
  background: rgba(255,255,255,0.9);
}

#aquarium-page {
  display: flex;
  width: 100%;
  min-height: 100vh;
  padding-top: 60px;
  overflow-y: visible;
}

html, body {
  overflow: visible !important;
  height: auto !important;
}


/* ── sidebar ── */
#sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 240px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 20px 16px;
  background: rgba(255,255,255,0.55);
  border-right: 1.5px solid #333;
  font-family: 'Amstrad', monospace;
  font-size: 0.9rem;
}

#sidebar h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

.filter-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.filter-actions button {
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  padding: 3px 8px;
  border: 1.5px solid #333;
  background: rgba(255,255,255,0.7);
  cursor: pointer;
}

.filter-actions button:hover {
  background: rgba(255,255,255,1);
}

/* ── top level: Fish / Invertebrates ── */
.filter-group {
  margin-bottom: 16px;
}

.filter-group > h3 {
  font-size: 1rem;
  border-bottom: 1px solid #555;
  padding-bottom: 3px;
  margin-bottom: 8px;
  text-transform: lowercase;
  padding-left: 0px;
}

.filter-group > h3 .group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ── second level: Cichlids / Plecos / Crustaceans ── */
.filter-subgroup {
  margin-bottom: 10px;
  padding-left: 16px;
}

.filter-subgroup > h4 {
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: #444;
  text-transform: lowercase;
}

.filter-subgroup > h4 .group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ── third level: Crayfish / Shrimp ── */
.filter-subsubgroup {
  margin-bottom: 6px;
  padding-left: 16px;
}

.filter-subsubgroup > h5 {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 3px;
  text-transform: lowercase;
}

.filter-subsubgroup > h5 .group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ── individual fish labels ── */
/* direct children of filter-subgroup (Cichlids, Plecos level) */
.filter-subgroup > label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  cursor: pointer;
  padding-left: 32px;
}

.filter-subgroup > label:hover {
  background: rgba(255,255,255,0.5);
}

/* direct children of filter-subsubgroup (Crayfish, Shrimp level) */
.filter-subsubgroup > label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  cursor: pointer;
  padding-left: 32px;
}

.filter-subsubgroup > label:hover {
  background: rgba(255,255,255,0.5);
}

/* ── main grid area ── */
#grid-area {
  margin-left: 240px;
  padding: 30px 30px 60px 30px;
  flex: 1;
}

#grid-area h1 {
  font-family: 'Amstrad', monospace;
  font-size: 1.4rem;
  margin-bottom: 24px;
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

#photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.photo-card {
  cursor: pointer;
  border: 1.5px solid #333;
  overflow: hidden;
  background: rgba(255,255,255,0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photo-card:hover {
  transform: rotate(2deg);
  box-shadow: 3px 3px 0px #333;
}

.photo-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

#no-results {
  display: none;
  font-family: 'Amstrad', monospace;
  font-size: 0.9rem;
  margin-top: 40px;
  color: #555;
}

/* ── modal ── */
#modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
}
#modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  background: rgba(255,255,255,0.97);
  border: 2px solid #333;
  padding: 16px;
  width: 85vw;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: 'Amstrad', monospace;
}
#modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#modal-name {
  font-size: 1rem;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  font-weight: normal;
}
#modal-close {
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  border: 1.5px solid #333;
  background: transparent;
  padding: 2px 8px;
  cursor: pointer;
}
#modal-close:hover {
  background: #000;
  color: #fff;
}
#modal-img-wrap {
  width: 100%;
  height: 60vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  border: 1px solid #ccc;
  background: #f5f5f0;
}
#modal-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}
#modal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
#zoom-label {
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  color: #444;
  min-width: 40px;
}
#zoom-slider {
  flex: 1;
  cursor: pointer;
}
#zoom-reset {
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  border: 1.5px solid #333;
  background: transparent;
  padding: 2px 10px;
  cursor: pointer;
}
#zoom-reset:hover {
  background: #000;
  color: #fff;
}
#modal-taxonomy {
  font-size: 0.75rem;
  color: #666;
  letter-spacing: 0.05em;
}
#modal-date {
  font-size: 0.75rem;
  color: #888;
}
#modal-context, #modal-notes {
  font-size: 0.85rem;
  color: #444;
  line-height: 1.6;
  min-height: 1em;
}
.hidden {
  display: none !important;
}

/* ── group label checkboxes ── */
.group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ── grid header with sort dropdown ── */
#grid-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

#grid-header h1 {
  margin-bottom: 0;
}

#sort-select {
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  border: 1.5px solid #333;
  background: rgba(255,255,255,0.7);
  padding: 4px 8px;
  cursor: pointer;
}

/* ── section labels (No Date Included / Dated) ── */
.section-label {
  font-family: 'Amstrad', monospace;
  font-size: 0.85rem;
  color: #666;
  border-bottom: 1px solid #aaa;
  padding-bottom: 4px;
  margin: 20px 0 12px 0;
  grid-column: 1 / -1;
}

/* ── zoom controls ── */
#modal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
#zoom-label {
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  color: #444;
  min-width: 40px;
}
#zoom-slider {
  flex: 1;
  accent-color: #333;
  cursor: pointer;
}
#zoom-reset {
  font-family: 'Amstrad', monospace;
  font-size: 0.8rem;
  border: 1.5px solid #333;
  background: transparent;
  padding: 2px 10px;
  cursor: pointer;
}
#zoom-reset:hover {
  background: #000;
  color: #fff;
}
#modal-img-wrap {
  overflow: hidden;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  max-height: 400px;
  cursor: grab;
}
#modal-img-wrap.dragging {
  cursor: grabbing;
}
#modal-img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
#modal-img-wrap {
  overflow: hidden;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}
#modal-img-wrap.dragging {
  cursor: grabbing;
}