:root {
  --bg: #efd4a9;
  --text: #333;
  --accent: #3c2614;
  --card-bg: #fff;
  --border: #e0e0e0;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Segoe UI", sans-serif; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1.5rem;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.navbar .nav-links li a,
.navbar .nav-links li .linklike {
    transition: transform 0.2s ease, color 0.2s ease;
}

.navbar .nav-links li a:hover,
.navbar .nav-links li .linklike:hover {
    transform: scale(1.1); 
    color: #ff8c00;   
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}
.navbar .linklike[type="submit"] {
    border: none;
    color: #ff8c00;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s ease;
}

.logo {
  height: 64px;     
  width: 64px;
  vertical-align: middle;
  margin-right: 6px;
}

.btn.danger {
  background-color: #d9534f;
  color: white;
  border: none;
}

.btn.danger:hover {
  background-color: #c9302c;
}

main {
  flex: 1;
  padding: 2rem;
}

.content-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.pet-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 600px; 
  margin: 0 auto;   
}

.pet-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.pet-card:hover { transform: translateY(-3px); }

.pet-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.pet-info { padding: 1rem; }
.pet-info h2 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}
.species, .meta, .location { font-size: 0.9rem; color: #666; margin-bottom: 0.3rem; }
/* Base outline button */
.btn.outline {
    background: #ffffff;
    color: #444;
    border: 2px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* Hover */
.btn.outline:hover {
    border-color: #3c2614;      /* purple */
    color: #3c2614;             /* purple */
    box-shadow: 0 3px 6px rgba(124, 77, 255, 0.25);
    transform: translateY(-2px);
}

.btn.primary {
    background: #3c2614;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* Hover */
.btn.primary:hover {
    background: #6a3de6;
    box-shadow: 0 4px 10px rgba(124, 77, 255, 0.3);
    transform: translateY(-2px);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 480px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.empty-state h3 {
    font-size: 1.6rem;
    margin: 1rem 0 0.5rem;
    color: #444;
}

.empty-state p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.empty-illustration {
    width: 160px;
    opacity: 0.9;
    margin-bottom: 1rem;
}


.favorited {
    color: red !important;
    border-color: red !important;
    font-weight: 700;
}

.favorited:hover {
    color: #cc0000 !important;
    border-color: #cc0000 !important;
    box-shadow: 0 0 6px rgba(204, 0, 0, 0.45);
    transform: translateY(-2px);
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  margin: 0.5rem;
  font-size: 0.9rem;
}

footer {
  background: #f0f0f0;
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
  color: #777;
}
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  text-decoration: none;
  color: var(--accent);
}

.pet-detail {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .pet-detail { grid-template-columns: 1fr; }
}

.pet-photo {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.pet-photo img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.badge.adopted {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ff5252;
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pet-meta h1 {
  font-size: 2rem;
  margin-bottom: 0.3rem;
}

.pet-meta .species, .pet-meta .meta, .pet-meta .location {
  color: #666;
  margin-bottom: 0.3rem;
}

.pet-meta .desc {
  margin: 1rem 0;
  line-height: 1.6;
}

.contact-card {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
}

.contact-card h3 { margin-bottom: 0.5rem; }

.contact-actions { display: flex; gap: 0.5rem; margin: 0.5rem 0; }

.btn.secondary { background: #455a64; }

.contact-note, .contact-missing {
  font-size: 0.9rem;
  color: #666;
}

.actions-row { margin-top: 1rem; }

h2 { margin-bottom: 1rem; }

.form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  max-width: 840px;
}

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

.form label { display: grid; gap: 0.4rem; font-size: 0.95rem; }
.form input, .form select, .form textarea {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.details { margin: 0.6rem 0 1rem; }
.details summary { cursor: pointer; color: var(--accent); margin-bottom: 0.6rem; }
.checkbox { display: flex; align-items: center; gap: 0.5rem; }

.badge.adopted { background: #ff5252; }

.flash-wrap { margin-bottom: 1rem; }
.flash { padding: .6rem .8rem; border-radius: 8px; margin-bottom: .5rem; }
.flash.success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.flash.error { background: #ffebee; color: #b71c1c; border: 1px solid #ffcdd2; }

.linklike {
  background: transparent; border: none; color: #fff; cursor: pointer; font: inherit; padding: 0;
}
.linklike:hover { text-decoration: underline; }
.navbar { gap: 1rem; flex-wrap: wrap; }
.nav-search {
  display: flex; gap: .5rem; align-items: center;
}
.nav-search input {
  padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px;
}
.btn.small { padding: .35rem .7rem; font-size: .85rem; ; }
.nav-search .btn {
    margin-top: 1.5px;   /* adjust value until perfect */
}
.pet-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.pet-actions .btn {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
}

.yes-btn {
  background: #4caf50; 
  color: #fff;
}

.no-btn {
  background: #f44336; 
  color: #fff;
}


.swipe-interface {
  position: relative;
  max-width: 400px;
  height: 500px;
  margin: 2rem auto;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.swipe-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease;
  display: none;
}

.swipe-card.active {
  display: block;
}

.swipe-card:active {
  cursor: grabbing;
}

.swipe-card img {
  width: 100%;
  height: 65%;
  object-fit: cover;
}

.swipe-card-content {
  padding: 1.5rem;
  height: 35%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.swipe-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.swipe-card .species {
  color: #666;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.swipe-card .meta {
  color: #888;
  font-size: 0.9rem;
}

.swipe-actions {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1rem 0 2rem;
  padding: 0 1rem;
}

.swipe-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swipe-btn:active {
  transform: scale(0.95);
}

.swipe-no {
  background: #fff;
  color: #f44336;
  border: 3px solid #f44336;
}

.swipe-yes {
  background: #fff;
  color: #4caf50;
  border: 3px solid #4caf50;
}

.swipe-no:hover {
  background: #f44336;
  color: white;
}

.swipe-yes:hover {
  background: #4caf50;
  color: white;
}

.decision-overlay {
  position: absolute;
  top: 50px;
  left: 20px;
  right: 20px;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  padding: 1rem;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
}

.yes-overlay {
  color: #4caf50;
  border: 4px solid #4caf50;
  transform: rotate(15deg);
}

.no-overlay {
  color: #f44336;
  border: 4px solid #f44336;
  transform: rotate(-15deg);
}

.swipe-empty {
  text-align: center;
  padding: 3rem;
  background: var(--card-bg);
  border-radius: 16px;
  border: 2px dashed var(--border);
  margin: 2rem 0;
}

.swipe-empty h2 {
  margin-bottom: 1rem;
  color: #666;
}

.swipe-progress {
  text-align: center;
  margin: 1rem 0;
  color: #666;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0.6rem;
  }

  .nav-search {
    width: 100%;
  }

  .nav-search input {
    width: 100%;
  }

  .navbar a,
  .linklike {
    font-size: 0.95rem;
  }

  header {
    padding: 0.6rem 1rem;
  }
  .swipe-card img {
    height: 55%; /* was 65% */
  }

  .swipe-card-content {
    height: 45%; /* was 35% */
  }

  .swipe-card-content {
    padding: 1.2rem;
  }

  .btn.outline {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .swipe-interface {
    height: 450px;
    max-width: 100%;
    margin: 1rem;
  }
  
  .swipe-actions {
    gap: 1.5rem;
  }
  
  .swipe-btn {
    width: 60px;
    height: 60px;
    font-size: 1.3rem;
  }
  
  .swipe-card-content {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0.6rem;
  }

  .nav-search {
    width: 100%;
  }

  .nav-search input {
    width: 100%;
  }

  .navbar a,
  .linklike {
    font-size: 0.95rem;
  }

  header {
    padding: 0.6rem 1rem;
  }
  .swipe-card img {
    height: 55%; /* was 65% */
  }

  .swipe-card-content {
    height: 45%; /* was 35% */
  }

  .swipe-card-content {
    padding: 1.2rem;
  }

  .btn.outline {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .swipe-interface {
    height: 400px;
  }
  
  .swipe-card h2 {
    font-size: 1.3rem;
  }
  
  .swipe-actions {
    gap: 1rem;
  }
  
  .swipe-btn {
    width: 55px;
    height: 55px;
  }

  .flash {
    transition: opacity 0.6s ease;
}
}