/* =========================================
   RESET
========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #031318;
  --panel: #071f28;
  --panel-light: #0a2932;

  --text: #edf9f7;
  --muted: #759397;

  --cyan: #75ead9;
  --blue: #55c8ff;

  --border: rgba(255, 255, 255, 0.09);

  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  font-family: var(--sans);

  color: var(--text);
  background: var(--bg);

  overflow-x: hidden;
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* =========================================
   APP
========================================= */

.aquarium-app {
  min-height: 100vh;

  background:
    radial-gradient(
      circle at 70% 35%,
      rgba(23, 107, 121, 0.13),
      transparent 30%
    ),
    linear-gradient(135deg, #021015, #041a22 60%, #031218);
}

/* =========================================
   TOPBAR
========================================= */

.topbar {
  height: 82px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 5vw;

  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;

  color: var(--text);

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand span {
  color: var(--cyan);
}

.brand-icon {
  width: 28px;
  height: 28px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(117, 234, 217, 0.3);
  border-radius: 50%;

  color: var(--cyan) !important;

  font-size: 12px;
}

.tank-status {
  display: flex;
  align-items: center;
  gap: 9px;

  color: var(--muted);

  font-size: 9px;
  letter-spacing: 0.15em;
}

.status-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: #65e5a1;

  box-shadow: 0 0 10px #65e5a1;

  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  50% {
    opacity: 0.35;
  }
}

.mode-button {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 9px 13px;

  color: var(--muted);
  background: transparent;

  border: 1px solid var(--border);
  border-radius: 50px;

  font-size: 9px;
  letter-spacing: 0.12em;

  transition: 0.3s ease;
}

.mode-button:hover {
  color: var(--text);
  border-color: rgba(117, 234, 217, 0.35);
}

/* =========================================
   DASHBOARD
========================================= */

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;

  min-height: calc(100vh - 120px);

  padding: 6vh 5vw;

  gap: 4vw;
}

/* =========================================
   TANK HEADING
========================================= */

.tank-section {
  min-width: 0;
}

.tank-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  margin-bottom: 35px;
}

.eyebrow {
  margin-bottom: 12px;

  color: var(--cyan);

  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.tank-heading h1 {
  font-family: var(--serif);

  font-size: clamp(2.8rem, 4vw, 4.8rem);
  font-weight: 500;

  line-height: 0.95;
  letter-spacing: -0.04em;
}

.tank-heading h1 em {
  color: var(--cyan);
  font-weight: 500;
}

.water-quality {
  display: flex;
  flex-direction: column;
  gap: 8px;

  text-align: right;
}

.water-quality span {
  color: var(--muted);

  font-size: 8px;
  letter-spacing: 0.15em;
}

.water-quality strong {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;

  color: #70e8a2;

  font-size: 10px;
  font-weight: 600;
}

.water-quality i {
  width: 5px;
  height: 5px;

  border-radius: 50%;

  background: #70e8a2;
}

/* =========================================
   AQUARIUM TANK
========================================= */

.tank {
  position: relative;

  height: min(58vh, 570px);

  min-height: 430px;

  overflow: hidden;

  border: 1px solid rgba(135, 231, 225, 0.18);

  border-radius: 8px;

  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(87, 217, 211, 0.22),
      transparent 45%
    ),
    linear-gradient(to bottom, #073b48, #052e3a 48%, #041d28);

  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.35),
    0 25px 80px rgba(0, 0, 0, 0.25);
}

/* water movement */

.tank::before {
  content: "";

  position: absolute;
  inset: 0;

  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(3, 17, 23, 0.7),
    transparent 50%
  );

  pointer-events: none;

  z-index: 5;
}

/* =========================================
   WATER SURFACE
========================================= */

.water-surface {
  position: absolute;

  top: -5px;
  left: -2%;

  width: 104%;
  height: 15px;

  background: repeating-radial-gradient(
    ellipse at 50% 0,
    rgba(174, 255, 246, 0.18) 0,
    rgba(174, 255, 246, 0.18) 2px,
    transparent 3px,
    transparent 15px
  );

  opacity: 0.7;

  animation: waterMove 5s ease-in-out infinite alternate;

  z-index: 10;
}

@keyframes waterMove {
  from {
    transform: translateX(-10px);
  }

  to {
    transform: translateX(10px);
  }
}

/* =========================================
   LIGHT RAYS
========================================= */

.light-rays {
  position: absolute;
  inset: 0;

  pointer-events: none;
}

.light-rays span {
  position: absolute;

  top: -80px;

  width: 100px;
  height: 650px;

  background: linear-gradient(
    to bottom,
    rgba(182, 255, 247, 0.07),
    transparent
  );

  transform: rotate(18deg);

  filter: blur(3px);

  animation: rayMove 8s ease-in-out infinite alternate;
}

.light-rays span:nth-child(1) {
  left: 8%;
}

.light-rays span:nth-child(2) {
  left: 33%;
  animation-delay: -3s;
}

.light-rays span:nth-child(3) {
  left: 62%;
  animation-delay: -5s;
}

.light-rays span:nth-child(4) {
  left: 82%;
  animation-delay: -1s;
}

@keyframes rayMove {
  from {
    opacity: 0.2;
    transform: rotate(18deg) translateX(-20px);
  }

  to {
    opacity: 0.7;
    transform: rotate(23deg) translateX(30px);
  }
}

/* =========================================
   BUBBLES
========================================= */

.tank-bubbles {
  position: absolute;
  inset: 0;

  pointer-events: none;

  z-index: 4;
}

.tank-bubbles span {
  position: absolute;

  bottom: -20px;

  width: 7px;
  height: 7px;

  border: 1px solid rgba(190, 255, 249, 0.35);
  border-radius: 50%;

  animation: bubbleRise linear infinite;
}

.tank-bubbles span:nth-child(1) {
  left: 12%;
  animation-duration: 8s;
}

.tank-bubbles span:nth-child(2) {
  left: 24%;
  width: 4px;
  height: 4px;
  animation-duration: 11s;
  animation-delay: 2s;
}

.tank-bubbles span:nth-child(3) {
  left: 38%;
  width: 10px;
  height: 10px;
  animation-duration: 9s;
  animation-delay: 4s;
}

.tank-bubbles span:nth-child(4) {
  left: 49%;
  animation-duration: 12s;
}

.tank-bubbles span:nth-child(5) {
  left: 61%;
  width: 5px;
  height: 5px;
  animation-duration: 7s;
}

.tank-bubbles span:nth-child(6) {
  left: 72%;
  width: 11px;
  height: 11px;
  animation-duration: 13s;
  animation-delay: 3s;
}

.tank-bubbles span:nth-child(7) {
  left: 84%;
  animation-duration: 9s;
  animation-delay: 1s;
}

.tank-bubbles span:nth-child(8) {
  left: 91%;
  width: 4px;
  height: 4px;
  animation-duration: 7s;
}

.tank-bubbles span:nth-child(9) {
  left: 44%;
  width: 5px;
  height: 5px;
  animation-duration: 10s;
  animation-delay: 5s;
}

.tank-bubbles span:nth-child(10) {
  left: 17%;
  width: 4px;
  height: 4px;
  animation-duration: 14s;
  animation-delay: 5s;
}

@keyframes bubbleRise {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }

  15% {
    opacity: 0.65;
  }

  50% {
    transform: translateY(-240px) translateX(15px);
  }

  100% {
    transform: translateY(-600px) translateX(-12px);
    opacity: 0;
  }
}

/* =========================================
   FISH LAYER
========================================= */

.fish-layer {
  position: absolute;
  inset: 0;

  z-index: 3;
}

/* =========================================
   FISH
========================================= */

.fish {
  position: absolute;

  width: 90px;
  height: 48px;

  cursor: pointer;

  transition:
    filter 0.3s ease,
    transform 0.3s ease;

  animation: fishBob 2.5s ease-in-out infinite;
}

.fish:hover {
  filter: brightness(1.25);
}

.fish.selected {
  filter: brightness(1.25) drop-shadow(0 0 15px rgba(117, 234, 217, 0.5));
}

.fish-body {
  position: absolute;

  left: 12px;
  top: 8px;

  width: 58px;
  height: 34px;

  border-radius: 55% 48% 48% 55%;

  background: var(--fish-color);

  box-shadow:
    inset -10px -5px 10px rgba(0, 0, 0, 0.15),
    inset 8px 5px 10px rgba(255, 255, 255, 0.15);
}

.fish-body::before {
  content: "";

  position: absolute;

  right: 8px;
  top: 8px;

  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: #06151a;

  box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

/* Tail */

.fish-tail {
  position: absolute;

  left: 0;
  top: 9px;

  width: 30px;
  height: 32px;

  background: var(--fish-color);

  clip-path: polygon(100% 50%, 0 0, 8% 50%, 0 100%);

  transform-origin: right center;

  animation: tailMove 0.45s ease-in-out infinite alternate;
}

@keyframes tailMove {
  from {
    transform: rotate(-8deg);
  }

  to {
    transform: rotate(8deg);
  }
}

/* Fin */

.fish-fin {
  position: absolute;

  left: 40px;
  top: 1px;

  width: 22px;
  height: 15px;

  background: var(--fish-color);

  border-radius: 80% 20% 70% 20%;

  transform: rotate(-20deg);
}

/* Clownfish stripes */

.fish.clownfish .fish-body {
  background:
    linear-gradient(
      90deg,
      transparent 22%,
      white 23%,
      white 34%,
      transparent 35%,
      transparent 61%,
      white 62%,
      white 73%,
      transparent 74%
    ),
    #ed7649;
}

/* Tang */

.fish.tang .fish-body {
  background:
    linear-gradient(
      100deg,
      transparent 0 60%,
      #ffdc55 61% 72%,
      transparent 73%
    ),
    #166bd1;
}

.fish.tang .fish-tail {
  background: #f2d348;
}

/* Angel */

.fish.angel .fish-body {
  background: repeating-linear-gradient(90deg, #f2c55a 0 8px, #253d76 8px 15px);
}

/* Butterfly */

.fish.butterfly .fish-body {
  background: linear-gradient(
    90deg,
    #f8d95c 0 50%,
    #1d344a 51% 65%,
    #f8d95c 66%
  );
}

/* Fish bob */

@keyframes fishBob {
  0%,
  100% {
    margin-top: 0;
  }

  50% {
    margin-top: -8px;
  }
}

/* Direction */

.fish.reverse {
  transform: scaleX(-1);
}

/* Selected ring */

.fish.selected::after {
  content: "";

  position: absolute;

  inset: -9px;

  border: 1px solid rgba(117, 234, 217, 0.5);

  border-radius: 50%;

  opacity: 0;

  animation: selectedPulse 2s ease-in-out infinite;
}

@keyframes selectedPulse {
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* =========================================
   SEAWEED
========================================= */

.seaweed {
  position: absolute;

  bottom: 30px;

  width: 140px;
  height: 150px;

  z-index: 6;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  gap: 12px;
}

.seaweed-left {
  left: 2%;
}

.seaweed-right {
  right: 2%;
}

.seaweed span {
  width: 12px;
  height: 130px;

  border-radius: 100% 0 100% 0;

  background: linear-gradient(90deg, #123f38, #20705a, #0d332d);

  transform-origin: bottom;

  animation: seaweedMove 3s ease-in-out infinite alternate;
}

.seaweed span:nth-child(2) {
  height: 100px;
  animation-delay: -1s;
}

.seaweed span:nth-child(3) {
  height: 145px;
  animation-delay: -2s;
}

.seaweed span:nth-child(4) {
  height: 110px;
  animation-delay: -0.5s;
}

.seaweed span:nth-child(5) {
  height: 90px;
  animation-delay: -1.5s;
}

@keyframes seaweedMove {
  from {
    transform: rotate(-7deg);
  }

  to {
    transform: rotate(8deg);
  }
}

/* =========================================
   GROUND
========================================= */

.ground {
  position: absolute;

  left: -5%;
  bottom: -25px;

  width: 110%;
  height: 90px;

  background:
    radial-gradient(ellipse at 20% 20%, #395c5b, transparent 8%),
    radial-gradient(ellipse at 60% 50%, #304e51, transparent 10%),
    linear-gradient(to top, #071a20, #102d31);

  border-radius: 50% 50% 0 0;

  z-index: 7;
}

.stone {
  position: absolute;

  bottom: 35px;

  background: #315055;

  border-radius: 50%;
}

.stone-1 {
  left: 10%;
  width: 45px;
  height: 25px;
}

.stone-2 {
  left: 26%;
  width: 30px;
  height: 18px;
}

.stone-3 {
  left: 48%;
  width: 50px;
  height: 28px;
}

.stone-4 {
  left: 68%;
  width: 35px;
  height: 22px;
}

.stone-5 {
  left: 82%;
  width: 55px;
  height: 25px;
}

.stone-6 {
  left: 92%;
  width: 28px;
  height: 18px;
}

/* =========================================
   GLASS
========================================= */

.glass-shine {
  position: absolute;
  inset: 0;

  z-index: 12;

  pointer-events: none;

  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.07),
    transparent 20%,
    transparent 80%,
    rgba(255, 255, 255, 0.025)
  );

  border: 1px solid rgba(255, 255, 255, 0.04);

  border-radius: inherit;
}

/* =========================================
   FOOD
========================================= */

.food-layer {
  position: absolute;
  inset: 0;

  pointer-events: none;

  z-index: 9;
}

.food {
  position: absolute;

  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #d4a24c;

  box-shadow: 0 0 5px rgba(255, 203, 91, 0.35);

  animation: foodFall 2.8s ease-in forwards;
}

@keyframes foodFall {
  0% {
    transform: translateY(-20px) scale(0.5);
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  100% {
    transform: translateY(450px) scale(1);
    opacity: 0;
  }
}

/* =========================================
   TANK CONTROLS
========================================= */

.tank-controls {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-top: 18px;
}

.control-button {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 12px 17px;

  color: var(--muted);
  background: transparent;

  border: 1px solid var(--border);
  border-radius: 4px;

  font-size: 9px;
  letter-spacing: 0.13em;

  transition: 0.3s ease;
}

.control-button:hover {
  color: var(--text);

  border-color: rgba(117, 234, 217, 0.3);
}

.control-button.primary {
  color: #031318;
  background: var(--cyan);
  border-color: var(--cyan);
}

.control-button.primary:hover {
  background: #a0fff2;
}

.population {
  margin-left: auto;

  display: flex;
  align-items: center;
  gap: 12px;
}

.population span {
  color: var(--muted);

  font-size: 8px;
  letter-spacing: 0.14em;
}

.population strong {
  color: var(--cyan);

  font-size: 13px;
}

/* =========================================
   SIDEBAR
========================================= */

.sidebar {
  padding: 25px;

  background: rgba(7, 31, 40, 0.65);

  border: 1px solid var(--border);
  border-radius: 7px;

  backdrop-filter: blur(15px);
}

.sidebar-header h2 {
  font-family: var(--serif);

  font-size: 2rem;
  font-weight: 500;
}

/* =========================================
   FISH LIST
========================================= */

.fish-list {
  display: flex;
  flex-direction: column;
  gap: 7px;

  margin-top: 28px;
}

.fish-card {
  position: relative;

  width: 100%;

  display: flex;
  align-items: center;
  gap: 15px;

  padding: 14px;

  color: var(--text);
  background: rgba(255, 255, 255, 0.025);

  border: 1px solid transparent;
  border-radius: 5px;

  text-align: left;

  transition: 0.3s ease;
}

.fish-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.fish-card.active {
  background: rgba(117, 234, 217, 0.06);

  border-color: rgba(117, 234, 217, 0.2);
}

.fish-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fish-card-info strong {
  font-size: 11px;
  font-weight: 500;
}

.fish-card-info small {
  color: var(--muted);

  font-size: 8px;
}

.card-arrow {
  margin-left: auto;

  color: var(--muted);

  transition: 0.3s ease;
}

.fish-card.active .card-arrow {
  color: var(--cyan);
  transform: translateX(3px);
}

/* =========================================
   MINI FISH
========================================= */

.mini-fish {
  position: relative;

  display: block;

  width: 42px;
  height: 25px;

  border-radius: 50%;
}

.mini-fish::before {
  content: "";

  position: absolute;

  left: -12px;
  top: 4px;

  width: 18px;
  height: 18px;

  background: inherit;

  clip-path: polygon(100% 50%, 0 0, 12% 50%, 0 100%);
}

.clownfish-mini {
  background:
    linear-gradient(
      90deg,
      transparent 23%,
      white 24% 35%,
      transparent 36% 61%,
      white 62% 73%,
      transparent 74%
    ),
    #e87548;
}

.tang-mini {
  background: #2877d9;
}

.angel-mini {
  background: repeating-linear-gradient(90deg, #e9bd53 0 6px, #253d76 6px 12px);
}

.butterfly-mini {
  background: linear-gradient(
    90deg,
    #f4d55d 0 50%,
    #20374d 51% 64%,
    #f4d55d 65%
  );
}

/* =========================================
   SELECTED SPECIES
========================================= */

.selected-fish {
  margin-top: 28px;
  padding-top: 24px;

  border-top: 1px solid var(--border);
}

.selected-top {
  display: flex;
  align-items: center;
  justify-content: space-between;

  color: var(--muted);

  font-size: 8px;
  letter-spacing: 0.15em;
}

.live-badge {
  color: #70e8a2;
}

.selected-fish h3 {
  margin-top: 15px;

  font-family: var(--serif);

  font-size: 2rem;
  font-weight: 500;
}

.scientific-name {
  margin-top: 4px;

  color: var(--cyan);

  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
}

.fish-description {
  margin-top: 17px;

  color: var(--muted);

  font-size: 10px;
  line-height: 1.7;
}

.fish-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  margin-top: 22px;
}

.fish-stats div {
  display: flex;
  flex-direction: column;
  gap: 6px;

  padding-right: 10px;
}

.fish-stats span {
  color: var(--muted);

  font-size: 7px;
  letter-spacing: 0.13em;
}

.fish-stats strong {
  font-size: 10px;
  font-weight: 500;
}

/* =========================================
   TANK STATS
========================================= */

.tank-stats {
  margin-top: 28px;
  padding-top: 23px;

  border-top: 1px solid var(--border);
}

.stat-header {
  display: flex;
  justify-content: space-between;

  color: var(--muted);

  font-size: 8px;
  letter-spacing: 0.12em;
}

.stat-header strong {
  color: var(--cyan);
}

.progress {
  height: 3px;

  margin-top: 10px;

  overflow: hidden;

  background: rgba(255, 255, 255, 0.07);

  border-radius: 10px;
}

.progress span {
  display: block;

  width: 96%;
  height: 100%;

  background: var(--cyan);
}

.health-items {
  display: flex;
  flex-direction: column;
  gap: 11px;

  margin-top: 18px;
}

.health-items div {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;

  color: var(--muted);

  font-size: 9px;
}

.health-items strong {
  color: var(--text);

  font-size: 9px;
  font-weight: 500;
}

.health-icon {
  color: var(--cyan);
}

/* =========================================
   NOTIFICATION
========================================= */

.notification {
  position: fixed;

  left: 50%;
  bottom: 40px;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 12px 18px;

  color: var(--text);
  background: rgba(4, 22, 28, 0.9);

  border: 1px solid rgba(117, 234, 217, 0.18);
  border-radius: 50px;

  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);

  transform: translate(-50%, 30px);

  opacity: 0;
  visibility: hidden;

  transition: 0.4s ease;

  z-index: 50;

  font-size: 9px;
}

.notification.show {
  transform: translate(-50%, 0);

  opacity: 1;
  visibility: visible;
}

.notification span {
  color: var(--cyan);
}

/* =========================================
   FOOTER
========================================= */

.footer {
  display: flex;
  justify-content: space-between;

  padding: 0 5vw 25px;

  color: rgba(255, 255, 255, 0.22);

  font-size: 7px;
  letter-spacing: 0.15em;
}

/* =========================================
   NIGHT MODE
========================================= */

.aquarium-app.night-mode {
  background:
    radial-gradient(
      circle at 70% 35%,
      rgba(58, 43, 126, 0.13),
      transparent 30%
    ),
    linear-gradient(135deg, #01090f, #071322 60%, #030b14);
}

.night-mode .tank {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(84, 86, 190, 0.2), transparent 45%),
    linear-gradient(to bottom, #101d43, #0a1b35 50%, #071522);
}

.night-mode .light-rays span {
  opacity: 0.25;
}

.night-mode .mode-button {
  color: var(--cyan);
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: 1fr;

    padding-bottom: 50px;
  }

  .sidebar {
    max-width: none;
  }

  .fish-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .selected-fish {
    max-width: 600px;
  }

  .tank-stats {
    max-width: 600px;
  }
}

@media (max-width: 650px) {
  .topbar {
    height: 70px;
    padding: 0 5vw;
  }

  .tank-status {
    display: none;
  }

  .dashboard {
    padding: 40px 5vw;
  }

  .tank-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .water-quality {
    text-align: left;
  }

  .water-quality strong {
    justify-content: flex-start;
  }

  .tank {
    height: 480px;
    min-height: 480px;
  }

  .fish {
    transform: scale(0.8);
  }

  .fish.reverse {
    transform: scaleX(-1) scale(0.8);
  }

  .tank-controls {
    flex-wrap: wrap;
  }

  .population {
    width: 100%;
    margin-left: 0;
    margin-top: 5px;
  }

  .fish-list {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 20px;
  }

  .footer {
    display: none;
  }

  .notification {
    bottom: 20px;
    width: max-content;
    max-width: 90%;
  }
}
