/* Google Fonts Imported in HTML (Poppins) */
:root {
  /* Yellow Palette */
  --primary: #ffb703;
  --primary-hover: #fb8500;
  --bg-light: #fffdf5;
  --bg-white: #ffffff;
  --text-dark: #2b2b2b;
  --text-muted: #6c757d;
  
  /* Dark Mode Palette */
  --dark-bg: #121212;
  --dark-card: #1e1e1e;
  --dark-text: #e4e6eb;
  --dark-text-muted: #b0b3b8;
  --dark-input: #2a2a2a;
  
  /* Shadows & Radius */
  --radius-sm: 10px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 20px rgba(255, 183, 3, 0.15);
  --shadow-hover: 0 15px 30px rgba(255, 183, 3, 0.3);
  --shadow-dark: 0 10px 20px rgba(0,0,0,0.3);
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

/* 🌙 Theme Toggle */
.theme-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-white);
  border: 2px solid var(--primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 100;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  transform: rotate(15deg) scale(1.1);
  background: var(--primary);
  color: white;
}

/* 🐾 Hero Section */
.hero {
  background: linear-gradient(135deg, #FFE156 0%, #FFB703 100%);
  text-align: center;
  padding: 6rem 1rem 4rem;
  border-bottom-left-radius: 50px;
  border-bottom-right-radius: 50px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero::before {
  content: '🐾';
  position: absolute;
  font-size: 8rem;
  opacity: 0.15;
  top: -20px;
  left: 5%;
  transform: rotate(-20deg);
}
.hero::after {
  content: '🦴';
  position: absolute;
  font-size: 6rem;
  opacity: 0.15;
  bottom: -10px;
  right: 8%;
  transform: rotate(15deg);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.15);
  margin-bottom: 0.5rem;
  animation: fadeInDown 0.8s ease-out;
}

.hero p {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
  opacity: 1;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.1);
  animation: fadeInUp 1s ease-out;
}

/* 🔍 Controls */
.controls {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin: -1.8rem auto 2rem;
  flex-wrap: wrap;
  max-width: 900px;
  width: 100%;
  padding: 0 1rem;
  position: relative;
  z-index: 10;
}

.controls input,
.controls select {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  outline: none;
  background: var(--bg-white);
  box-shadow: 0 8px 15px rgba(0,0,0,0.05);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-dark);
  transition: var(--transition);
  flex: 1;
  min-width: 220px;
}

.controls input:focus,
.controls select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 183, 3, 0.2);
}

/* ⏳ Loading & Message */
.loading,
.message {
  text-align: center;
  margin: 2rem auto;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-muted);
  animation: pulse 1.5s infinite;
}

.hidden {
  display: none !important;
}

/* 🐶 Pets Grid */
.pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  padding: 2rem;
  gap: 2.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Card */
.pet-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.6s ease-out backwards;
}

.pet-card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-hover);
}

/* Make cards animate sequentially */
.pet-card:nth-child(1) { animation-delay: 0.1s; }
.pet-card:nth-child(2) { animation-delay: 0.2s; }
.pet-card:nth-child(3) { animation-delay: 0.3s; }
.pet-card:nth-child(4) { animation-delay: 0.4s; }
.pet-card:nth-child(5) { animation-delay: 0.5s; }
.pet-card:nth-child(6) { animation-delay: 0.1s; }
.pet-card:nth-child(7) { animation-delay: 0.2s; }
.pet-card:nth-child(8) { animation-delay: 0.3s; }
.pet-card:nth-child(9) { animation-delay: 0.4s; }
.pet-card:nth-child(10) { animation-delay: 0.5s; }

/* Image */
.pet-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.5s ease;
  border-bottom: 4px solid var(--primary);
}

.pet-card:hover img {
  transform: scale(1.05);
}

/* Info */
.pet-info {
  padding: 1.5rem;
  background: var(--bg-white);
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s ease;
}

.pet-info h3 {
  font-size: 1.4rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.pet-info p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Add some emojis to paragraphs */
.pet-info p:nth-child(2)::before { content: '🐕'; }
.pet-info p:nth-child(3)::before { content: '📍'; }
.pet-info p:nth-child(4)::before { content: '🏠'; }

/* Favorite Button */
.fav-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  border: none;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: var(--transition);
  z-index: 10;
}

.fav-btn:hover {
  transform: scale(1.15) rotate(5deg);
  background: #fff;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.fav-btn:active {
  transform: scale(0.9);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  background: #2b2b2b;
  color: #fff;
  font-size: 0.9rem;
  margin-top: auto;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  width: 100%;
}

/* 🌙 Dark Mode */
body.dark-mode {
  background-color: var(--dark-bg);
  color: var(--dark-text);
}

body.dark-mode .theme-btn {
  background: var(--dark-card);
  border-color: var(--dark-input);
  box-shadow: var(--shadow-dark);
}

body.dark-mode .theme-btn:hover {
  background: var(--dark-input);
}

body.dark-mode .hero {
  background: linear-gradient(135deg, #1f1c0d 0%, #302604 100%);
  box-shadow: var(--shadow-dark);
}

body.dark-mode .hero h1 {
  color: var(--primary);
  text-shadow: none;
}

body.dark-mode .hero p {
  color: #ccc;
  text-shadow: none;
}

body.dark-mode .controls input,
body.dark-mode .controls select {
  background: var(--dark-card);
  color: var(--dark-text);
  border: 2px solid transparent;
  box-shadow: var(--shadow-dark);
}

body.dark-mode .controls input:focus,
body.dark-mode .controls select:focus {
  border-color: var(--primary);
}

body.dark-mode .pet-card {
  background: var(--dark-card);
  border-color: var(--dark-input);
  box-shadow: var(--shadow-dark);
}

body.dark-mode .pet-card:hover {
  box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

body.dark-mode .pet-info {
  background: var(--dark-card);
}

body.dark-mode .pet-info h3 {
  color: var(--dark-text);
}

body.dark-mode .pet-info p {
  color: var(--dark-text-muted);
}

body.dark-mode .footer {
  background: #000;
  color: var(--dark-text-muted);
}

body.dark-mode .fav-btn {
  background: rgba(0, 0, 0, 0.6);
}

body.dark-mode .fav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

/* Media Queries for full responsiveness */
@media (max-width: 600px) {
  .hero {
    padding: 4rem 1rem 3rem;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .controls {
    flex-direction: column;
    margin: -1rem auto 1rem;
    gap: 0.8rem;
    width: 100%;
  }
  
  .controls input,
  .controls select {
    width: 100%;
    min-width: unset;
  }
  
  .pets-grid {
    padding: 1rem;
    gap: 1.5rem;
    grid-template-columns: 1fr;
  }
}