/* Body and background */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: url("images/background.jpeg") no-repeat center center fixed;
  background-size: cover;
}

/* Overlay with blur + readable background */
.overlay {
  min-height: 100vh;
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

/* Headings */
h1 {
  text-align: center;
  margin: 8px 0 16px 0;
}

/* Pet details on pet page */
.details {
  text-align: center;
  margin-bottom: 16px;
}

/* Pet image on pet page */
.pet-image {
  width: 100%;
  max-width: 360px;
  display: block;
  margin: 0 auto 16px auto;
  border-radius: 18px;
  opacity: 0;
  transform: scale(0.96);
  animation: petFade 0.6s ease forwards;
}

/* Buttons */
.contact {
  text-align: center;
}

.button {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 10px;
  background: #007aff;
  color: white;
  text-decoration: none;
  margin: 6px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.secondary {
  background: #555;
}

/* Back button */
.back-button {
  background: none;
  border: none;
  font-size: 1rem;
  padding: 8px 12px;
  cursor: pointer;
  color: #007aff;
  margin-bottom: 12px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
}

.modal-content {
  background: rgba(255, 255, 255, 0.96);
  padding: 16px;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.modal-buttons button {
  margin: 6px 4px 0;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  background: #e5e7eb;
}

.modal-buttons button#startBtn,
.modal-buttons button#sendManualBtn {
  background: #007aff;
  color: white;
}

/* Fade/scale animation */
@keyframes petFade {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================
   INDEX PAGE GRID (bigger on PC)
========================= */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
  justify-items: center;
  margin-top: 16px;
}

.pet-card {
  text-decoration: none;
  display: flex;
  justify-content: center;
  width: 100%;
}

.pet-card img {
  width: 100%;
  max-width: 220px;
  /* bigger on PC */
  aspect-ratio: 1 / 1;
  /* keeps cards square-ish */
  object-fit: cover;
  border-radius: 16px;
  opacity: 0;
  transform: scale(0.96);
  animation: petFade 0.6s ease forwards;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .overlay {
    margin: 16px;
    padding: 12px;
  }

  .pet-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 14px;
  }

  .pet-card img {
    max-width: 140px;
  }

  .pet-image {
    max-width: 95%;
  }
}