/* ==========================================================================
   Potter Familycare Specialist Clinic - Main Stylesheet
   ========================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
  --primary-blue: #0077CC;
  --dark-blue: #005A9E;
  --light-blue-bg: #E8F4FD;
  --white: #FFFFFF;
  --dark-text: #1A1A2E;
  --subtle-gray-bg: #F7F9FB;
  --font-main: 'Poppins', sans-serif;
  --card-radius: 12px;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --header-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  left: 0;
  width: auto;
  height: auto;
  padding: 12px 16px;
  background: var(--primary-blue);
  color: var(--white);
  border-radius: 6px;
  z-index: 2000;
}

/* Ensure hero action buttons wrap on small screens */
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-actions .btn {
  min-width: 140px;
}

/* --- Reset & Base Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Improved focus styles for keyboard users */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 3px solid rgba(2, 119, 189, 0.9);
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--dark-text);
  background-color: var(--subtle-gray-bg);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Mobile overrides to avoid min-width forcing overflow */
@media screen and (max-width: 480px) {
  .doctor-grid {
    grid-template-columns: 1fr;
  }
  .service-card {
    padding: 1rem;
  }
  .hero-actions .btn {
    width: 100%;
  }
  /* make inline-styled flex children stack nicely on narrow screens */
  .container > div[style], .container > section > div[style] {
    flex-basis: 100% !important;
    min-width: 0 !important;
  }
}

@media screen and (max-width: 360px) {
  /* relax min-widths from inline styles on very small devices */
  .hero .container > div[style], .inner-hero .container > div[style] {
    min-width: 0 !important;
  }
}

/* --- Layout Sections --- */
section {
  padding: 5rem 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

p {
  font-weight: 400;
  margin-bottom: 1rem;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--primary-blue);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--dark-blue);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.btn-secondary:hover {
  background-color: var(--primary-blue);
  color: var(--white);
}

/* --- Sticky Navbar --- */
header {
  position: sticky;
  top: 0;
  background-color: var(--white);
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

header.scrolled {
  box-shadow: var(--header-shadow);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-link {
  display: inline-block;
}

.logo-link:hover .logo h2 {
  color: var(--primary-blue);
}

.logo h2 {
  color: var(--dark-blue);
  margin-bottom: 0;
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  color: var(--dark-text);
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-blue);
}

.nav-actions {
  display: flex;
  align-items: center;
}

.hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  margin-left: 1rem;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--dark-text);
  border-radius: 2px;
  transition: 0.3s;
}

/* --- Main Hero Section --- */
.hero {
  height: 100vh;
  background: linear-gradient(rgba(26, 26, 46, 0.6), rgba(26, 26, 46, 0.6)), 
              url('hero-bg.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 0 2rem;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.2rem;
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* --- Inner Page Hero Banner --- */
.inner-hero {
  height: 40vh;
  background: linear-gradient(135deg, var(--dark-blue), var(--primary-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
}

.inner-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0;
}

/* --- Trust Bar --- */
.trust-bar {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 3rem 2rem;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.trust-item h3 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.trust-item p {
  font-weight: 300;
  font-size: 1.1rem;
}

/* --- Card Grid (Services/Doctors) --- */
.bg-light {
  background-color: var(--light-blue-bg);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.card {
  background-color: var(--white);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card h3 {
  color: var(--dark-blue);
}

/* --- Testimonial Slider Styles --- */
.testimonial-section {
  background-color: var(--white);
}

.swiper-container {
  width: 100%;
  padding: 2rem 1rem 4rem !important; /* Space for pagination */
}

.testimonial-card {
  background: var(--subtle-gray-bg);
  padding: 2rem;
  border-radius: var(--card-radius);
  text-align: center;
  border-left: 5px solid var(--primary-blue);
}

.swiper-pagination-bullet-active {
  background-color: var(--primary-blue) !important;
}

/* --- Footer --- */
footer {
  background-color: var(--dark-blue);
  color: var(--white);
  padding: 4rem 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 40px;
  height: 2px;
  background-color: var(--primary-blue);
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col a {
  color: #ccc;
  transition: color 0.3s ease;
}

.footer-col a:hover {
  color: var(--white);
}

.copyright {
  text-align: center;
  padding: 1.5rem;
  background-color: rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  color: #ccc;
}

/* --- Floating WhatsApp Button --- */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: var(--card-shadow);
  z-index: 1000;
  transition: transform 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

/* --- Custom Scroll Animations (Fallback/Standalone) --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s forwards;
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  animation: fadeHorizontal 0.8s forwards;
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  animation: fadeHorizontal 0.8s forwards;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeHorizontal {
  to { opacity: 1; transform: translateX(0); }
}

/* --- Mobile Responsiveness --- */
@media screen and (max-width: 992px) {
  .hero h1 { font-size: 2.8rem; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 768px) {
  section { padding: 3rem 1.5rem; }
  
  /* Navbar Mobile */
  .hamburger { display: flex; }
  
  .nav-links {
    position: absolute;
    top: 100%;
    left: -100%;
    width: 100%;
    background-color: var(--white);
    flex-direction: column;
    padding: 2rem 0;
    box-shadow: var(--header-shadow);
    transition: left 0.4s ease;
    gap: 1.5rem;
  }
  
  .nav-links.active {
    left: 0;
  }
  
  .nav-actions .btn {
    display: none; /* Hide standard book button on mobile nav bar */
  }

  /* Hamburger Animation */
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  /* Grids to 1 column */
  .card-grid, 
  .trust-grid, 
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .hero h1 { font-size: 2.2rem; }
}

/* ============================================================
   Additional components migrated from template
   (section headings, featured service, testimonials, doctor grid)
   ============================================================ */
.section-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-blue);
  background: var(--light-blue-bg);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--dark-text);
  line-height: 1.15;
  margin-bottom: 0.8rem;
}

.section-subtitle {
  font-size: 1.02rem;
  color: #516276;
  max-width: 680px;
  line-height: 1.8;
}

/* Hero actions: ensure buttons wrap on small screens */
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { white-space: normal; }

@media screen and (max-width: 480px) {
  .hero-actions .btn { width: 100%; }
}

.service-card { /* slightly refined for hover */
  background: var(--white);
  border-radius: var(--card-radius);
  padding: 1.8rem;
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: 0 10px 30px rgba(0,0,0,0.06); }

.testimonial-section { background: var(--white); }
.testimonial-card { background: var(--subtle-gray-bg); padding: 1.8rem; border-radius: var(--card-radius); }

.cta-banner { background: linear-gradient(135deg, var(--primary-blue), #00A9E0); color: var(--white); padding: 3.5rem 1.5rem; border-radius: 12px; }

.moh-badge { background: var(--white); border: 2px solid var(--primary-blue); border-radius: 18px; padding: 1.6rem 2rem; text-align: center; box-shadow: var(--card-shadow); }
.moh-badge .code { color: var(--primary-blue); font-weight: 700; }

.doctor-grid { display: grid; grid-template-columns: 380px 1fr; gap: 3.5rem; align-items: start; }
.doctor-photo { width: 100%; border-radius: 12px; box-shadow: var(--card-shadow); aspect-ratio: 3/4; object-fit: cover; }
.doctor-name { font-size: 1.75rem; color: var(--dark-blue); margin-bottom: 0.25rem; }
.doctor-creds { display: inline-block; background: var(--light-blue-bg); padding: 4px 10px; border-radius: 999px; font-weight: 600; color: var(--dark-text); }

@media screen and (max-width: 1024px) {
  .doctor-grid { grid-template-columns: 1fr; }
}

/* Accessibility: Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: var(--primary-blue);
  color: white;
  border-radius: 6px;
  z-index: 2000;
}