/* --- PRODUCTION-READY & FLUID CSS --- */

:root {
  /* Color Palette */
  --primary-color: #6a1b9a;
  --accent-color: #ffc107;
  --bg-color: #f8f9fa;
  --text-dark: #333333;
  --text-light: #555555;
  --border-color: #e0e0e0;
  --tutor-feature-icon: var(--primary-color);

  /* Fonts */
  --font-heading: "Poppins", sans-serif;
  --font-body: "Lato", sans-serif;

  /* Header Height */
  --header-height: 80px;

  /* Fluid Spacing System */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-s: clamp(1rem, 2vw, 1.25rem);
  --space-m: clamp(1.5rem, 3vw, 2rem);
  --space-l: clamp(2.5rem, 5vw, 4rem);
  --space-xl: clamp(4rem, 8vw, 6rem);

  /* Fluid Typography System */
  --font-size-body: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  --font-size-h1: clamp(2.5rem, 1.5rem + 5vw, 4rem);
  --font-size-h2: clamp(2rem, 1.25rem + 3.75vw, 3rem);
  --font-size-h3: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  --font-size-h4: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
}

/* --- GLOBAL STYLES & RESETS --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem); /* Add buffer for sticky header */
}
body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--text-dark);
  line-height: 1.7;
  background-color: var(--bg-color);
  transition: background-color 0.3s ease; /* Smooth transition for potential dark mode */
}
body.preload * {
  transition: none !important; /* Disable all transitions during page load */
}
img {
  max-width: 100%;
  height: auto;
  display: block; /* Removes bottom space under image */
}

/* --- LAYOUT & HELPERS --- */
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-m);
}
section {
  padding-block: var(--space-xl);
}
main {
  padding-top: var(--header-height);
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--primary-color);
  font-weight: 700;
  line-height: 1.3;
}
h1 {
  font-size: var(--font-size-h1);
  margin-bottom: var(--space-s);
}
h2 {
  font-size: var(--font-size-h2);
  margin-bottom: var(--space-s);
}
h3 {
  font-size: var(--font-size-h3);
  margin-bottom: var(--space-xs);
}
h4 {
  font-size: var(--font-size-h4);
}
.section-title {
  text-align: center;
}
.section-subtitle {
  text-align: center;
  max-width: 65ch;
  margin-inline: auto;
  margin-bottom: var(--space-l);
  color: var(--text-light);
}

/* --- BUTTONS --- */
.btn,
.btn-nav {
  display: inline-block;
  background: var(--accent-color);
  color: var(--text-dark);
  padding: 0.8em 2.5em;
  border: 2px solid var(--accent-color);
  border-radius: 50px;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}
.btn:hover,
.btn-nav:hover {
  background: #ffca28;
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* --- HEADER --- */
header {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
}
header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
.logo {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
}
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-m);
}
.nav-links li a {
  position: relative;
  padding-block: var(--space-xs);
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 700;
  transition: color 0.3s;
  font-size: 1rem;
}
.nav-links li a:hover {
  color: var(--primary-color);
}
.nav-links li a::after {
  content: "";
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transform-origin: center;
  transition: transform 0.3s ease-out;
}
.nav-links li a:hover::after {
  transform: scaleX(1);
}
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
  padding: var(--space-xs);
  z-index: 1001;
}

/* --- HERO SECTION --- */
#hero {
  padding-top: var(--space-l);
}
.hero-container {
  display: flex;
  align-items: center;
  gap: var(--space-l);
}
.hero-content {
  flex: 1 1 55%;
}
.hero-image {
  flex: 1 1 45%;
}
.hero-image img {
  border-radius: 20px;
  box-shadow: 0 0 40px -10px var(--accent-color);
}
.hero-content p {
  margin-block: var(--space-m);
}
.google-review-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-s);
  background: #fff;
  padding: var(--space-xs) var(--space-s);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-top: var(--space-m);
}
.google-review-badge span {
  font-size: 1.2rem;
  color: #fbbc05;
}

/* --- WHY US SECTION --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-m);
}
.feature-card {
  background: #fff;
  padding: var(--space-m);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}
.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}
.feature-icon {
  height: 70px;
  margin-bottom: var(--space-m);
  margin-inline: auto;
}

/* --- PROCESS SECTION --- */
#process {
  background-color: #fff;
  border-block: 1px solid var(--border-color);
}
.process-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-m);
}
.process-step {
  text-align: center;
}
.step-number {
  width: 60px;
  height: 60px;
  line-height: 60px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  color: var(--primary-color);
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-inline: auto;
  margin-bottom: var(--space-m);
  transition: all 0.3s ease;
}
.process-step:hover .step-number {
  background-color: var(--primary-color);
  color: #fff;
  transform: scale(1.1);
}

/* --- TESTIMONIALS SECTION --- */
#testimonials {
  background-color: #e1bee7;
}
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-m);
}
.testimonial-card {
  background-color: #fff;
  padding: var(--space-m);
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}
.testimonial-icon {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: var(--space-s);
}
.testimonial-text {
  color: var(--text-light);
  font-style: italic;
  flex-grow: 1;
  margin-bottom: var(--space-m);
}
.testimonial-author {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-s);
}
.author-name {
  font-weight: 700;
  color: var(--primary-color);
}
.author-location {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* --- LOCATION SECTION --- */
.location-container {
  max-width: 700px;
  margin-inline: auto;
  text-align: center;
}
.location-info h2,
.location-info p,
.location-info .address {
  text-align: left;
}
.address {
  margin-block: var(--space-m);
  border-left: 4px solid var(--accent-color);
  padding-left: var(--space-m);
}

/* --- BECOME A TUTOR SECTION --- */
#join-us {
  position: relative;
  overflow: hidden;
  background-color: #fff;
}
.join-us-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  gap: var(--space-l);
  position: relative;
  z-index: 1;
}
.join-us-content h2 {
  font-size: var(--font-size-h1);
}
.join-us-subtitle {
  font-size: var(--font-size-h4);
  margin-bottom: var(--space-m);
  color: var(--text-light);
}
.join-us-features {
  list-style: none;
  margin-bottom: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}
.join-us-features li {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  font-weight: 700;
  font-size: 1.1rem;
}
.join-us-features .fa-check-circle {
  color: var(--tutor-feature-icon);
  font-size: 1.5rem;
}
.join-us-image img {
  border-radius: 20px;
  box-shadow: 0 0 40px -10px var(--accent-color);
}
/* Background Shapes */
#join-us::before,
#join-us::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  transition: all 0.4s ease;
}
#join-us::before {
  width: 600px;
  height: 600px;
  background-color: #f3e5f5;
  top: -20%;
  left: -20%;
}
#join-us::after {
  width: 500px;
  height: 500px;
  background-color: var(--accent-color);
  top: -10%;
  right: -25%;
  opacity: 0.8;
}

/* --- CONTACT SECTION --- */
#contact {
  background: linear-gradient(135deg, #4a148c 0%, #8e24aa 100%);
  color: #fff;
  text-align: center;
}
#contact h2,
#contact .section-subtitle {
  color: #fff;
}
#contact .section-subtitle {
  color: rgba(255, 255, 255, 0.85);
}
#whatsapp-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-s);
  margin-top: var(--space-m);
}
#whatsapp-form input {
  height: 55px;
  padding-inline: var(--space-m);
  border: 2px solid transparent;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1rem;
  width: 100%;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
  transition: border-color 0.3s;
}
#whatsapp-form input:focus {
  outline: none;
  border-color: var(--accent-color);
}
#whatsapp-form button {
  width: 100%;
  max-width: 500px;
}

/* --- FOOTER --- */
footer {
  text-align: center;
  padding: var(--space-m) var(--space-s);
  font-size: 0.9rem;
  background-color: #eaeaea;
  color: var(--text-light);
  border-top: 1px solid var(--border-color);
}
.footer-contact {
  margin-top: var(--space-s);
}
.footer-contact a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  margin-inline: var(--space-xs);
}

/* --- RESPONSIVE DESIGN --- */

/* Tablet & Large Mobile (<= 992px) */
@media (max-width: 992px) {
  .hero-container {
    flex-direction: column;
    text-align: center;
  }
  .hero-image {
    order: -1;
    margin-bottom: var(--space-l);
    max-width: 450px;
    margin-inline: auto;
  }
  .join-us-wrapper {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-xl);
  }
  .join-us-content {
    order: 1;
  }
  .join-us-image {
    order: 2;
    max-width: 450px;
    margin-inline: auto;
  }
  .join-us-features li {
    justify-content: center;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--primary-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-l);
    transition: right 0.4s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  }
  .nav-links.active {
    right: 0;
  }
  .nav-links li a {
    font-size: 1.2rem;
    color: #fff;
  }
  .nav-links li a:hover {
    color: var(--accent-color);
  }
  .nav-links li a::after {
    background-color: var(--accent-color);
  }
  .btn-nav {
    font-size: 1.1rem;
    padding: 0.7em 2em;
  }
  #join-us::before {
    width: 400px;
    height: 400px;
    left: -30%;
  }
  #join-us::after {
    width: 350px;
    height: 350px;
    right: -45%;
  }
  #whatsapp-form input,
  #whatsapp-form button {
    width: 95%;
  }

  /* --- NEW: HERO SECTION MOBILE-SPECIFIC CHANGES --- */
  .hero-container {
    text-align: center;
    gap: var(--space-m);
  }
  .hero-image {
    order: initial; /* Reverts to default HTML order (content first) */
    max-width: 350px; /* Makes the image a bit smaller on mobile */
    margin-bottom: 0; /* Remove bottom margin as it's no longer needed on top */
  }
  .hero-content {
    order: -1; /* Explicitly move the content block to the top */
  }
}