/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-header h1 {
    font-size: 1.8rem;
  }

  .main-header p {
    font-size: 0.9rem;
  }

  .animals-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* 2 columns on tablets */
    gap: 1rem;
    padding: 1rem;
  }

  .animal-card img {
    height: 150px;
  }

  .card-content h2 {
    font-size: 1.2rem;
  }

  .status {
    font-size: 0.8rem;
  }

  .population-legend h2 {
    font-size: 1.2rem;
  }

  .legend-item p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .main-header h1 {
    font-size: 1.5rem;
  }

  .main-header p {
    font-size: 0.8rem;
  }

  .animals-grid {
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 1rem;
    padding: 1rem;
  }

  .animal-card img {
    height: 120px;
  }

  .card-content h2 {
    font-size: 1rem;
  }

  .status {
    font-size: 0.7rem;
  }

  .population-legend h2 {
    font-size: 1rem;
  }

  .legend-item p {
    font-size: 0.8rem;
  }
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: -250px;
  top: 0;
  width: 250px;
  height: 100%;
  background: #2c3e50;
  padding: 80px 20px;
  transition: 0.3s;
  z-index: 999;
}

.sidebar.open {
  left: 0;
}

.sidebar a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 15px;
  font-size: 1.1rem;
  border-radius: 5px;
  margin: 10px 0;
}

.sidebar a:hover {
  background: #34495e;
}

/* Hamburger Menu */
.hamburger-menu {
  position: absolute;
  left: 20px;
  top: 20px;
  cursor: pointer;
  z-index: 1000;
}

.hamburger-menu .bar {
  width: 30px;
  height: 3px;
  background: white;
  margin: 6px 0;
  transition: 0.4s;
}

.hamburger-menu.open .bar:nth-child(1) {
  transform: rotate(-45deg) translate(-6px, 6px);
}

.hamburger-menu.open .bar:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.open .bar:nth-child(3) {
  transform: rotate(45deg) translate(-6px, -6px);
}

/* Animals Grid */
.animals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.animal-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-decoration: none;
  color: #333;
  transition: transform 0.3s, box-shadow 0.3s;
}

.animal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.animal-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 3px solid #2c3e50;
}

.card-content {
  padding: 1.2rem;
}

.card-content h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.status {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.critical { background: #e74c3c; color: white; }
.endangered { background: #f1c40f; }
.vulnerable { background: #2ecc71; color: white; }

body {
  font-family: 'Open Sans', sans-serif;
  background: #f5f5f5;
  line-height: 1.6;
}

/* Header */
.main-header {
  text-align: center;
  padding: 2rem 1rem;
  background: #2c3e50;
  color: white;
  position: relative;
}

.main-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.main-header p {
  font-size: 1rem;
}

/* Hamburger Menu */
.hamburger-menu {
  position: absolute;
  left: 20px;
  top: 20px;
  cursor: pointer;
  z-index: 1000;
}

.hamburger-menu .bar {
  width: 30px;
  height: 3px;
  background: white;
  margin: 6px 0;
  transition: 0.4s;
}

.hamburger-menu.open .bar:nth-child(1) {
  transform: rotate(-45deg) translate(-6px, 6px);
}

.hamburger-menu.open .bar:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.open .bar:nth-child(3) {
  transform: rotate(45deg) translate(-6px, -6px);
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: -250px;
  top: 0;
  width: 250px;
  height: 100%;
  background: #2c3e50;
  padding: 80px 20px;
  transition: 0.3s;
  z-index: 999;
}

.sidebar.open {
  left: 0;
}

.sidebar a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 15px;
  font-size: 1.1rem;
  border-radius: 5px;
  margin: 10px 0;
}

.sidebar a:hover {
  background: #34495e;
}

/* Population Legend */
.population-legend {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.population-legend h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  text-align: center;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 1rem;
}

.legend-color.critical {
  background: #e74c3c; /* Red for Critically Endangered */
}

.legend-color.endangered {
  background: #f1c40f; /* Yellow for Endangered */
}

.legend-color.vulnerable {
  background: #2ecc71; /* Green for Vulnerable */
}

.legend-item p {
  font-size: 1rem;
  color: #555;
  margin: 0;
}

/* Animals Grid */
.animals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.animal-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-decoration: none;
  color: #333;
  transition: transform 0.3s, box-shadow 0.3s;
}

.animal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.animal-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 3px solid #2c3e50;
}

.card-content {
  padding: 1.2rem;
}

.card-content h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.status {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.critical { background: #e74c3c; color: white; }
.endangered { background: #f1c40f; }
.vulnerable { background: #2ecc71; color: white; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.pagination button {
  background: #2c3e50;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.pagination button:hover {
  background: #34495e;
}

/* Footer */
.main-footer {
  text-align: center;
  padding: 1.5rem;
  background: #2c3e50;
  color: white;
  margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-header h1 {
    font-size: 1.8rem;
  }

  .main-header p {
    font-size: 0.9rem;
  }

  .animals-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* 2 columns on tablets */
    gap: 1rem;
    padding: 1rem;
  }

  .animal-card img {
    height: 150px;
  }

  .card-content h2 {
    font-size: 1.2rem;
  }

  .status {
    font-size: 0.8rem;
  }

  .population-legend h2 {
    font-size: 1.2rem;
  }

  .legend-item p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .main-header h1 {
    font-size: 1.5rem;
  }

  .main-header p {
    font-size: 0.8rem;
  }

  .animals-grid {
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 1rem;
    padding: 1rem;
  }

  .animal-card img {
    height: 120px;
  }

  .card-content h2 {
    font-size: 1rem;
  }

  .status {
    font-size: 0.7rem;
  }

  .population-legend h2 {
    font-size: 1rem;
  }

  .legend-item p {
    font-size: 0.8rem;
  }
}