/* Import the Inter font for a professional UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --brand-navy: #202c4d;  
  --brand-blue: #3086fc;  
  --brand-light: #98caf9; 
  --text-main: #334155;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  margin: 0;
}

/* Nav Container */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem; /* Slightly more horizontal padding */
  border-bottom: 1px solid var(--border-color);
  background: white;
}

/* Nav Links */
.nav-links {
  display: flex;
  gap: 2.5rem; /* Spread the links out a bit more */
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--brand-navy);
}

/* Specific Link Overrides */
.primary-link {
  color: var(--brand-navy) !important; /* Make Find a Tutor stand out slightly more */
}

/* De-emphasized Sign In Button */
.sign-in-btn {
  color: var(--brand-navy) !important;
  border: 1px solid var(--border-color);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  transition: all 0.2s ease !important;
}

.sign-in-btn:hover {
  border-color: var(--brand-navy);
  background-color: #f8fafc;
}

/* Hero Section Layout */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 4rem;
}

.hero-content {
  flex: 1;
  max-width: 550px;
}

/* Typography */
.hero-title {
  font-size: 3.5rem;
  color: var(--brand-navy);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero-title .highlight {
  color: var(--brand-blue);
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* Call to Action Group */
.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.btn-primary {
  background-color: var(--brand-blue);
  color: white;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
  background-color: #2563EB; /* Slightly darker blue on hover */
  transform: translateY(-1px);
}

.trust-badge {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
}

/* Image Container */
.hero-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.css-placeholder {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand-blue) 100%);
  border-radius: 24px;
  box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.15);
  opacity: 0.9;
}

/* How It Works Section */
.how-it-works-section {
  padding: 5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
  background-color: var(--bg-main); /* Helps separate it from the white hero section */
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.25rem;
  color: var(--brand-navy);
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Grid Layout */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

/* Card Styling */
.step-card {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.step-icon {
  width: 56px;
  height: 56px;
  background-color: #EFF6FF; /* Very light blue */
  color: var(--brand-blue);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.step-title {
  font-size: 1.25rem;
  color: var(--brand-navy);
  font-weight: 600;
  margin-bottom: 1rem;
}

.step-description {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Footer Base Styling */
.site-footer {
  background-color: #F8FAFC; /* Very light slate/grey */
  border-top: 1px solid var(--border-color);
  padding: 4rem 3rem 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

/* Brand Column */
.footer-logo {
  height: 48px;
  width: auto;
  margin-bottom: 1.25rem;
}

.footer-bio {
  line-height: 1.6;
  max-width: 300px;
}

/* Links Columns */
.footer-heading {
  color: var(--brand-navy);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--brand-blue);
}

/* Contact Column */
.contact-text {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.contact-text strong {
  color: var(--brand-navy);
}

/* Bottom Bar */
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.85rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Directory Layout */
.bg-main { background-color: var(--bg-main); }
.directory-container { max-width: 1200px; margin: 0 auto; padding: 4rem 3rem; }
.directory-header { text-align: center; margin-bottom: 3rem; }
.page-title { font-size: 2.5rem; color: var(--brand-navy); font-weight: 800; }
.page-subtitle { color: var(--text-muted); font-size: 1.1rem; margin-top: 0.5rem; }

/* Filter Bar */
.filter-bar { display: flex; gap: 1rem; margin-bottom: 3rem; justify-content: center; }
.filter-input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
}

.filter-select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  background-color: white;
  cursor: pointer;
  
  appearance: none; 
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
}
.filter-input { width: 100%; max-width: 400px; }

/* Tutor Grid */
.tutor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.loading-text { text-align: center; color: var(--text-muted); grid-column: 1 / -1; font-size: 1.1rem; }
.error-text { text-align: center; color: #DC2626; grid-column: 1 / -1; font-weight: 600; }

/* Tutor Cards */
.tutor-card { background: white; border-radius: 16px; border: 1px solid var(--border-color); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.2s, transform 0.2s; }
.tutor-card:hover { box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); transform: translateY(-3px); }
.tutor-image { width: 100%; height: 220px; object-fit: cover; background: #F1F5F9; }
.tutor-info { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.tutor-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.tutor-name { font-size: 1.25rem; font-weight: 700; color: var(--brand-navy); margin: 0; }
.tutor-price { font-size: 1.25rem; font-weight: 800; color: var(--brand-navy); text-align: right; }
.tutor-price span { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }

/* Badges */
.badge-group { margin-top: 1rem; }
.badge-label { font-size: 0.65rem; font-weight: 700; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 0.5rem; }
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; margin: 0 0.4rem 0.4rem 0; }
.badge-blue { background: #EFF6FF; color: #1D4ED8; border: 1px solid #DBEAFE; }
.badge-purple { background: #FAF5FF; color: #7E22CE; border: 1px solid #F3E8FF; }

/* Bio & Button */
.tutor-bio { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin-top: 1.5rem; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.btn-book { margin-top: 1.5rem; background: var(--brand-navy); color: white; text-align: center; padding: 0.75rem; border-radius: 8px; font-weight: 600; text-decoration: none; transition: background 0.2s; }
.btn-book:hover { background: var(--brand-blue); }

/* ----------------------------------------
   MOBILE LAYOUT FIXES (Max Width 768px)
   ---------------------------------------- */
@media (max-width: 768px) {
  /* 1. Prevent screen from stretching horizontally */
  html, body {
    overflow-x: hidden !important;
    width: 100vw !important;
  }

  /* 2. INDEX.HTML: Fix Hero Section Padding & Layout */
  .hero-section {
    display: flex !important;
    flex-direction: column !important;
    padding: 2rem 1.5rem !important;
    margin: 0 !important;
  }
  
  .hero-content {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .hero-cta-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
  
  /* Hide or shrink the hero image placeholder on mobile */
  .hero-image {
    width: 100% !important;
    margin-top: 2rem !important;
  }

  /* 3. INDEX.HTML: Stack the "How it Works" cards */
  .steps-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 0 1rem !important;
  }

  /* 4. DIRECTORY.HTML: Stack the Search & Filters */
  .filter-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .filter-input, .filter-select {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 5. DIRECTORY.HTML: Stack the Tutor Cards */
  .directory-container {
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .tutor-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  .tutor-card {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }
  
  .tutor-image {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    height: auto !important;
    object-fit: cover !important;
  }
}