/* ============================================================
   STYLES: colors, fonts, and layout for the pet match app.
   Built "mobile first": it's designed for a phone, then
   given a little more room on bigger screens at the bottom.
   ============================================================ */

/* ---------- Colors and fonts (change them here and they change everywhere) ---------- */
:root {
  --green: #E8FFB7;
  --blue: #C4F5FC;
  --pink: #FFEAEC;
  --navy: #22385d;
  --white: #ffffff;
  --heading-font: "Chewy", "Comic Sans MS", cursive;
  --body-font: "Fredoka", "Trebuchet MS", sans-serif;
  --round: 24px;
}

/* ---------- Basics ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--pink);
  color: var(--navy);
  font-family: var(--body-font);
  font-size: 1.15rem;   /* large, easy-to-read text */
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--heading-font);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }

/* Headings get focus when a screen changes; hide the outline since it isn't clickable */
h1:focus, h2:focus { outline: none; }

/* Text only screen readers can hear */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* A clear outline so keyboard users always see where they are */
:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

/* ---------- Header ---------- */
.site-header {
  background: var(--blue);
  padding: 0.6rem 1rem;
  text-align: center;
}

.site-name {
  margin: 0;
  font-family: var(--heading-font);
  font-size: 1.3rem;
}

/* ---------- Main area: one centered column ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--body-font);
  font-size: 1.15rem;
  font-weight: 600;
  min-height: 52px;          /* big enough for a thumb */
  padding: 0.7rem 1.4rem;
  border: 3px solid var(--navy);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--navy);
  color: var(--green);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
}

.btn-small {
  min-height: 44px;
  padding: 0.4rem 1rem;
  font-size: 1rem;
}

/* ---------- Welcome screen ---------- */
.hero {
  align-items: center;
  text-align: center;
  background: var(--green);
  border-radius: var(--round);
  padding: 2rem 1.25rem;
}

.hero-icon { border-radius: 20px; }

.hero-text {
  font-size: 1.3rem;
  margin: 0;
}

.hero .btn { width: 100%; }

.small-print {
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Quiz ---------- */
.quiz-card {
  background: var(--white);
  border-radius: var(--round);
  padding: 1.5rem 1.25rem;
}

.quiz-progress-text {
  font-size: 1.4rem;
  margin: 0;
}

.progress-bar {
  height: 12px;
  background: var(--pink);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 10%;
  background: var(--navy);
  transition: width 0.3s;
}

.quiz-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.question-text {
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  padding: 0;
}

/* Each answer is a big rounded box you can tap anywhere on */
.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0.6rem 1rem;
  background: var(--blue);
  border: 3px solid transparent;
  border-radius: 16px;
  cursor: pointer;
}

.choice input {
  width: 1.4rem;
  height: 1.4rem;
  accent-color: var(--navy);
  flex-shrink: 0;
}

/* The chosen answer gets a navy border */
.choice:has(input:checked) {
  border-color: var(--navy);
  background: var(--green);
}

.quiz-error, .form-error {
  color: #9b1c1c;
  font-weight: 600;
  margin: 0;
  min-height: 1.5em;
}

.quiz-hint {
  font-size: 0.95rem;
  margin: 0;
}

.quiz-buttons, .form-buttons, .favorites-buttons {
  display: flex;
  gap: 0.75rem;
}

.quiz-buttons .btn, .form-buttons .btn { flex: 1; }

/* ---------- Swipe cards ---------- */
.results-hint, .card-counter { margin: 0; }
.card-counter { font-weight: 600; }

.card-area {
  min-height: 300px;
}

.pet-card {
  background: var(--white);
  border-radius: var(--round);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(34, 56, 93, 0.15);
  touch-action: pan-y;      /* lets us catch sideways swipes while still allowing page scroll */
  user-select: none;
  cursor: grab;
  transition: transform 0.3s, opacity 0.3s;
  animation: pop-in 0.3s;
}

/* While dragging, the card follows the finger instantly (no slow animation) */
.pet-card.dragging {
  transition: none;
  cursor: grabbing;
}

.pet-card.fly-right { transform: translateX(150%) rotate(20deg); opacity: 0; }
.pet-card.fly-left { transform: translateX(-150%) rotate(-20deg); opacity: 0; }

@keyframes pop-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.pet-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--blue);
  pointer-events: none;
}

.pet-info { padding: 1rem 1.25rem 1.25rem; }

.pet-name {
  font-size: 2.2rem;
  margin: 0;
}

.pet-details {
  margin: 0 0 0.5rem;
  font-weight: 600;
  text-transform: capitalize;
}

.pet-personality { margin: 0 0 0.75rem; }

.match-heading {
  margin: 0;
  font-weight: 600;
}

.match-list {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

/* The two big buttons under the card, easy to reach with a thumb */
.swipe-buttons {
  display: flex;
  gap: 0.75rem;
  position: sticky;          /* stays stuck to the bottom of the screen, right under your thumb */
  bottom: 0;
  padding: 0.75rem 0;
  background: var(--pink);
}

.btn-round {
  flex: 1;
  min-height: 60px;
}

.btn-pass { background: var(--white); color: var(--navy); }
.btn-like { background: var(--navy); color: var(--green); }

/* ---------- Favorites ---------- */
.favorites-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.favorite-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--white);
  border-radius: 16px;
  padding: 0.6rem;
}

.favorite-photo {
  border-radius: 12px;
  object-fit: cover;
}

.favorite-name {
  flex: 1;
  font-weight: 600;
}

.favorites-empty { margin: 0; }

.favorites-buttons { flex-direction: column; }

/* ---------- Adoption form ---------- */
.adopt-note {
  background: var(--green);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  margin: 0;
}

.adopt-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 600;
}

.field input, .field select, .field textarea {
  font-family: var(--body-font);
  font-size: 1.1rem;
  color: var(--navy);
  padding: 0.7rem;
  min-height: 48px;
  border: 2px solid var(--navy);
  border-radius: 12px;
  background: var(--white);
}

/* ---------- Thank-you screen ---------- */
.confirm {
  background: var(--blue);
  border-radius: var(--round);
  padding: 1.5rem 1.25rem;
}

.confirm-text { margin: 0; }

/* ---------- Bigger screens: a bit more breathing room ---------- */
@media (min-width: 600px) {
  .app { padding: 2rem 1rem; }
  h1 { font-size: 3.2rem; }
}

/* ---------- People who prefer less motion get no sliding or popping ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
