@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* GLOBAL RESETS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* outline: 1px solid red;  remove after debugging */
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #fdfdfd;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* HEADER */
header {
  background-color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 20px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: padding 0.3s ease;
}

header img {
  max-width: 220px;;
  height: auto;
  transition: height 0.3s ease;
}

header.shrink {
  padding: 18px 60px;
}

header.shrink img {
  height: 70px;
  max-width: 160px;
}

/* NAVIGATION (DESKTOP DEFAULT) */
nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 30px;
  align-items: center;
  white-space: nowrap;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: clamp(1rem, 2vw, 1.5rem);
  transition: color 0.3s;
}

nav a:hover {
  color: #e74c3c;
}

/* HAMBURGER MENU (HIDDEN BY DEFAULT) */
.menu-toggle {
  display: none;
}

/* HERO */
.hero {
  height: 80vh;
  background: url('dog.png') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  padding: 20px;
}

.hero h1 {
  font-size: 2rem;
  max-width: 600px;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

.hero button {
  margin-top: 20px;
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 15px 25px;
  font-size: 1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.hero button:hover {
  background-color: #c0392b;
}

/* SERVICES */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 40px;
}

.services-header {
  text-align: center;       
  padding: 40px 20px 0px; 
}

.services-heading {
  font-size: 2rem;        
  font-weight: 600;
  color: #333;
  margin: 0;                
}

/* CARDS */
.card {
  perspective: 1000px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  padding-top: 66%;
  transform-style: preserve-3d;
  transition: transform 0.8s;
  border-radius: 10px;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover .card-inner {
    transform: rotateY(180deg);
  }
}

.card.flip .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 10px;
  backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

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

.card-back {
  background-color: white;
  padding: 20px;
  transform: rotateY(180deg);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* TESTIMONIALS */
.testimonials {
  padding: 50px;
  background-color: #fafafa;
  text-align: center;
}

.testimonials h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.testimonial-carousel {
  display: flex;
  overflow-x: auto;
  gap: 50px;
  scroll-behavior: smooth;
  padding: 0 20px 20px;
}

.testimonial-card {
  flex: 0 0 300px;
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: left;
  font-style: italic;
}

.testimonial-carousel::-webkit-scrollbar {
  display: none;
}

/* ABOUT */
.about {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 40px;
}

.about img {
  max-width: 300px;
  border-radius: 10px;
}

form {
  padding: 40px;
  max-width: 600px;
  margin: auto;
}

form input, form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

form button {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 5px;
}

form button:hover {
  background-color: #c0392b;
}

.about-header {
  text-align: center;
  padding: 60px 20px 20px;
}

.about-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

/* TEAM CARDS */
.about-team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  padding: 40px;
  justify-items: center;
}

.team-card {
  perspective: 1000px;
  width: 400px;       
  height: 500px;     
  cursor: pointer;
}

.team-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s;
  border-radius: 10px;
}

@media (hover: hover) and (pointer: fine) {
  .team-card:hover .team-card-inner {
    transform: rotateY(180deg);
  }
}

.team-card.flip .team-card-inner {
  transform: rotateY(180deg);
}

.team-card-front,
.team-card-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.team-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card-back {
  background-color: white;
  padding: 15px;
  transform: rotateY(180deg);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* FOOTER */
footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 70px; 
  font-size: 1.5rem;
  margin-top: auto;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;

}

/* MOBILE */
@media (max-width: 768px) {

  /* GLOBAL MOBILE FIX */
  body {
    width: 100%;
    overflow-x: hidden;
    max-width: 100%;
  }

  footer {
    padding: 40px 20px;
    font-size: 1.2rem;
    width: 100%;
    max-width: 100%;
  }

  html, body {
  overflow-x: hidden;
  }

   header {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 10px 15px;
  }

  header * {
    max-width: 100%;
  }

  header img {
    max-width: 70%;
    height: auto;
  }

  /* Hamburger visible on mobile */
  .menu-toggle {
    display: block;
    right: 10px; /* prevent pushing beyond edge */
    position: absolute;
  }

  /* Hide nav until active */
  nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 0;
    margin: 0 10px;
    width: auto;
    max-width: calc(100% - 20px);
    background: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px 20px;
    gap: 15px;
    z-index: 1001;
  }

  nav.active {
    display: flex;
  }

  /* Hero scaling */
  .hero {
    padding: 20px 10px;
  }

  .hero h1 {
    font-size: 1.4rem;
    max-width: 90%;
    margin: 0 auto;
  }

  .services {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  /* Team card overflow fix */
  .team-card {
    width: 90%;
    max-width: 350px;
    height: auto; /* let it grow if necessary, but controlled via inner padding */
    margin: auto;
  }
  
  .team-card-inner {
    width: 100%;
    min-height: 500px; /* adjust based on your back text */
    transform-style: preserve-3d;
    transition: transform 0.8s;
  }

  .team-card-front,
  .team-card-back {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%; /* important: front/back fill the inner card */
    border-radius: 10px;
    backface-visibility: hidden;
    overflow: auto;       /* scroll if text is too long */
    padding: 20px;
  }

  .team-card-front img {
    height: 100%;
    object-fit: cover;
  }

  .about-team {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .about {
    flex-direction: column;
    align-items: center;
    padding: 20px;
  }

  form {
    padding: 20px;
  }

  /* Testimonial carousel scroll fix */
  .testimonial-carousel {
    padding: 0 10px 20px;
    gap: 20px;
  }

  .testimonial-card {
    flex: 0 0 80%;
    max-width: 260px;
  }
}

