* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9f7f2;
  color: #333;
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 2rem 1rem;
  background-color: #4a6fa5;
  color: white;
  border-bottom: 5px solid #3a5a8c;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.search-section {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 10px;
  flex-wrap: wrap;
}

#search-input {
  padding: 12px;
  width: 70%;
  max-width: 400px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

#search-input:focus {
  border-color: #4a6fa5;
}

#search-btn {
  padding: 12px 20px;
  background-color: #4a6fa5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
  white-space: nowrap;
}

#search-btn:hover {
  background-color: #3a5a8c;
}

.breeds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.breed-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  contain: layout style; /* Performance optimization */
}

.breed-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.breed-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #f0f0f0; /* Placeholder background */
  contain: strict; /* Performance optimization */
}

.breed-info {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.breed-info h3 {
  margin-bottom: 8px;
  color: #4a6fa5;
  font-size: 1.2rem;
  flex-grow: 1;
}

.breed-info p {
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: #555;
}

footer {
  text-align: center;
  padding: 1.5rem;
  background-color: #f0f0f0;
  color: #666;
  font-size: 0.9rem;
  margin-top: 2rem;
}

footer a {
  color: #4a6fa5;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  header {
    padding: 1.5rem 1rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  main {
    padding: 1.5rem 0.5rem;
  }
  
  .search-section {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  #search-input {
    width: 100%;
    max-width: 100%;
    padding: 14px;
  }
  
  #search-btn {
    width: 100%;
    max-width: 100%;
    padding: 14px;
  }
  
  .breeds-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 1rem 0.5rem;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  main {
    padding: 1rem 0.5rem;
  }
  
  .breeds-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .breed-info {
    padding: 12px;
  }
  
  .breed-info h3 {
    font-size: 1.1rem;
  }
  
  footer {
    padding: 1rem 0.5rem;
    font-size: 0.8rem;
  }
}

@media (min-width: 1200px) {
  .breeds-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* Image loading optimization */
img {
  display: block;
  max-width: 100%;
}