:root {
  --primary-color: #2e7d32;
  --secondary-color: #43a047;
  --text-color: #333;
  --bg-color: #f5f5f5;
}

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

body {
  font-family: "Open Sans", sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--bg-color);
}

header {
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 2rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: 600;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: #fff8e1;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: white;
  border-radius: 2px;
}

/* START HERO SECTION */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  text-align: center;
  color: #000; /* Dark text for contrast */
  background-color: #fff; /* Optional: White background for text */
  min-height: 100vh;
}

.hero-top {
  margin-bottom: 2rem; /* Gap before the image */
}

.hero-bottom {
  margin-top: 2rem; /* Gap after the image */
}

.hero-image img {
  max-width: 100%;
  height: auto;
  object-fit: contain; /* Ensures full visibility without distortion */
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.hero .btn {
  padding: 0.75rem 1.5rem;
  background-color: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.hero .btn:hover {
  background-color: #e8f5e9;
}

/* END HERO SECTION */

section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* START SERVICES SECTION */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.service {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.service:hover {
  transform: translateY(-5px);
}

.service i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* END SERVICES SECTION */

/* START ABOUT SECTION */
.about {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem;
  max-width: 1000px; /* Adjust based on your layout */
  margin: 0 auto; /* Centers the container */
}

.about img {
  max-width: 100%;
  max-height: 400px; /* Adjust this value based on your design */
  border-radius: 10px;
  object-fit: cover; /* Ensures the image fills the container without distortion */
}

/* END ABOUT SECTION */

/* START ANIMALS CARD SECTION */
.animals-section {
  padding: 40px 20px;
  text-align: center;
  min-width: 100%; /* Ensures the container doesn't shrink */
}

.animals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.animal-card {
  perspective: 1000px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.8s ease;
  width: 100%;
  min-width: 200px; /* Prevent cards from getting too small */
  padding: 1rem; /* Add padding for better spacing */
  box-sizing: border-box; /* Ensure padding doesn't affect width */
  margin: 1rem; /* Space between cards */
  /* height: 250px; Fixed height for consistent sizing */
  min-height: 200px; /* Adjust based on your content */
}

.animal-card.clicked {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  transition: transform 0.8s ease;
}

.card-front {
  padding: 1.5rem; /* Space between text and card edges */
  z-index: 2;
}

.card-back {
  z-index: 1;
}

.card-front img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 15px;
}

.card-front h3,
.card-back h3 {
  font-size: 1.5rem;
  margin: 0;
}

.card-back p {
  font-size: 1rem;
  color: #333;
  margin-top: 10px;
}

/*
 * .card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transition: transform 0.6s ease;
}
*/

.animal-card.flipped .card-front {
  display: none;
  transform: rotateY(180deg);
}

.animal-card.flipped .card-back {
  display: block;
  transform: rotateY(0deg);
}

/* END ANIMAL CARD SECTION */

/* START TESTIMONIALS SECTION */
.testimonials {
  background-color: var(--bg-color);
  padding: 2rem;
}

.testimonial {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.testimonial p {
  font-style: italic;
  margin-bottom: 1rem;
}

.testimonial .author {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.testimonial .position {
  color: var(--primary-color);
}

/* END TESTIMONIALS SECTION */

/* START CONTACT SECTION */
.contact {
  background-color: var(--secondary-color);
  color: white;
}

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

.contact input,
.contact textarea {
  padding: 0.75rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
}

.contact .btn {
  background-color: white;
  color: var(--primary-color);
  border: none;
  padding: 0.75rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.contact .btn:hover {
  background-color: #e8f5e9;
}

/* END CONTACT SECTION */

footer {
  text-align: center;
  padding: 2rem;
  background-color: var(--primary-color);
  color: white;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--primary-color);
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 999;
  }

  nav ul.active {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .hero {
    padding: 4rem 2rem;
  }
  .hero-top,
  .hero-bottom {
    margin-bottom: 2rem;
    margin-top: 2rem;
  }

  .about img {
    max-height: 200px; /* Adjust for mobile */
  }

  .animals-grid {
    grid-template-columns: 1fr; /* Stack cards vertically */
  }

  .footer-content p {
    font-size: 0.85rem;
  }
}
