:root {
  --green-dark: #14532D;
  --green-light: #7ED957;
  --blue-dark: #075985;
  --blue-light: #22B8E6;
  --brown-dark: #422006;
  --brown-light: #A16207;

  color-scheme: light dark;
  --bg: var(--blue-dark);
  --panel: rgba(255,255,255,0.2);
  --panel-active: rgba(255,255,255,0.5);
  --panel-border: rgba(255, 255, 255, 0.3);;
  --text: #ffffff;
  --text-dim: #eeeeee;
  --accent: #38bdf8;
  --accent-text: #04121e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-image:
    radial-gradient(circle 26px at 83% 16%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 29px at 96% 37%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 27px at 30% 19%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 34px at 88% 96%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 32px at 13% 77%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 27px at 6% 5%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 34px at 29% 31%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 34px at 79% 5%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 34px at 27% 93%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 33px at 55% 30%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 26px at 77% 37%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 32px at 22% 91%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 28px at 45% 37%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    radial-gradient(circle 27px at 29% 45%, rgba(255, 255, 255, 0.3) 99%, transparent 100%),
    linear-gradient(180deg, var(--green-dark), var(--blue-dark));
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: 100% 100%;
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, "Segoe UI", sans-serif;
}

.site-header {
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.site-header p {
  margin: 0;
  color: var(--text-dim);
}

.fish-page-header {
  text-align: left;
  padding: 1.5rem;
}

.back-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--accent);
}

.fish-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 1rem 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .fish-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .fish-grid {
    grid-template-columns: 1fr;
  }
}

.fish-card {
  transition: all 0.5s ease-in-out;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  
}

.fish-card:hover {
  background: var(--panel-active);
}

.fish-photo,
.fish-hero-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #0b1220;
}

.fish-photo.placeholder,
.fish-hero-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-dim);
}

.fish-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fish-info h2 {
  margin: 0;
  font-size: 1.15rem;
}

.fish-owner,
.fish-date,
.fish-photos-count {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.fish-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.fish-hero {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
}

.fish-hero-photo {
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.fish-hero-info {
  padding: 1.25rem;
}

.fish-hero-info h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.fish-hero-info p {
  margin: 0;
  color: var(--text-dim);
}

.photo-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.upload-form {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-form label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.upload-form input[type="file"],
.upload-form input[type="text"] {
  font-size: 0.85rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #fff;
  background: transparent;
  color: var(--text);
}

.upload-form input[type="text"]::placeholder,
.admin-login input::placeholder,
.admin-fields input::placeholder {
  color: #fff;
  opacity: 0.7;
}

.upload-form button {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 6px;
  padding: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

.upload-status {
  margin: 0;
  font-size: 0.8rem;
  min-height: 1.1em;
  color: var(--text-dim);
}

.upload-status.error {
  color: #f87171;
}

.upload-status.success {
  color: #4ade80;
}

.gallery-section h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.gallery-item {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.recent-photos-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.recent-photos-section h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.recent-photos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .recent-photos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .recent-photos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.recent-photo-item {
  display: block;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.recent-photo-item:hover {
  border-color: var(--accent);
}

.recent-photo-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.recent-photo-caption {
  display: block;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.gallery-empty {
  color: var(--text-dim);
}

.error {
  padding: 2rem;
  text-align: center;
  color: var(--text-dim);
}

.admin-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.admin-login {
  max-width: 320px;
  margin: 3rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.5rem;
}

.admin-login h1 {
  margin: 0;
  font-size: 1.25rem;
  text-align: center;
}

.admin-login input {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #fff;
  background: transparent;
  color: var(--text);
}

.admin-login button {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 6px;
  padding: 0.6rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.admin-toolbar h1 {
  margin: 0;
  font-size: 1.4rem;
}

.admin-toolbar button {
  background: none;
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.admin-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #0b1220;
}

.admin-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-dim);
}

.admin-fields {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--panel-border);
}

.admin-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-fields input {
  font-size: 0.9rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #fff;
  background: transparent;
  color: var(--text);
  text-transform: none;
}

.admin-fields button {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 6px;
  padding: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-gallery {
  padding: 1rem;
  border-top: 1px solid var(--panel-border);
}

.admin-gallery h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
}

.admin-gallery-item {
  margin: 0;
  position: relative;
}

.admin-gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.admin-gallery-item .delete-photo-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(15, 23, 42, 0.85);
  color: #f87171;
  border: 1px solid #f87171;
  border-radius: 4px;
  font-size: 0.65rem;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 20;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
