/* ========================================= */
/* PREVENT ACCIDENTAL TEXT SELECTION (GLOBAL) */
/* ========================================= */

body {
  -webkit-user-select: none; 
  -moz-user-select: none;    
  -ms-user-select: none;     
  user-select: none;         
  -webkit-touch-callout: none; 
}

/* Allow patients to copy the Address and Phone number */
.addr, .phone {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

:root {
  --bg: #f9f9f9;
  --card: #ffffff;
  --text: #161617;
  --muted: #555555;
  --btn-radius: 12px;
  --btn-w: 100%;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

  --call: #ab214d;
  --site: #0e5a95;
  --loc: #145369;
  --wa: #0a7833;
  --vcf: #9C27B0;
  --share: #036a60;
  --copy: #a15a25;

  --focus: 3px solid rgba(14, 90, 149, 0.15);
  --success-bg: #e8f5e9;
  --success-color: #2e7d32;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  padding: 16px 12px 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
  color: var(--text);
  text-align: center;
  min-height: 100vh;
}

/* CARD */
.card {
  background: var(--card);
  max-width: 440px;
  width: 100%;
  margin: 10px auto;
  padding: 14px 20px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* HEADER */
.logo { max-width: 100px; margin-bottom: 10px; }
h1 { font-size: 20px; font-weight: 800; margin: 6px 0 4px; color: #2f68ba; }
.name { font-size: 16px; font-weight: 700; }
.title { font-size: 14px; font-weight: 600; }
.addr, .phone {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

/* BUTTON BASE */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  padding: 14px;
  border-radius: var(--btn-radius);
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: 0.2s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.96); }

/* BUTTON COLORS */
.call { background: var(--call); }
.website { background: var(--site); }
.location { background: var(--loc); }
.whatsapp { background: var(--wa); }
.vcf { background: var(--vcf); }
.share { background: var(--share); }
.copy { background: var(--copy); }
.google-btn { background: #4285F4; }

/* GRID BUTTONS */
.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin: 10px auto;
}

.btn-grid .btn {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
}

/* SECONDARY BUTTONS */
.btn-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 360px;
  margin: 10px auto;
}

.btn.small {
  font-size: 14px;
  padding: 12px;
}

/* --- Services Box Container --- */
.services-box {
  background: #ffffff;
  border-left: 5px solid #0e5a95;
  padding: 15px;
  border-radius: 12px;
  margin: 15px auto;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* FIX: Dim Heading - Bright and Bold */
.main-services-heading {
  color: #0e5a95 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  margin-bottom: 12px !important;
  display: block;
}

.service-category {
  font-size: 14px;
  color: #0e5a95;
  margin: 15px 0 8px 0;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
  font-weight: 700;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 1. Reset ALL pills to default (Grey/White) */
/* This stops the random green pills from appearing */
.services-grid span {
  background: #f1f3f5 !important; 
  border: 1px solid #dee2e6 !important;
  color: #333 !important;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 12.5px;
  text-align: center;
  font-weight: 500;
}

/* 2. Style Neurological pills (Blue) */
.services-grid span.neuro {
  background: #eef7ff !important;
  border: 1px solid #adcffa !important;
  color: #0e5a95 !important;
  font-weight: 600;
}

/* 3. Style ONLY Home Visit pill (Green) */
.services-grid span.home-visit-pill {
  grid-column: 1 / -1; /* Full width */
  background: #e8f5e9 !important;
  border: 1px solid #2e7d32 !important;
  color: #2e7d32 !important;
  font-weight: 800;
  padding: 10px;
}

/* --- DARK MODE FIX FOR DIM HEADINGS --- */
@media (prefers-color-scheme: dark) {
  .services-box {
    background: #1a222c !important; /* Dark slate background */
    border-left-color: #64b5f6 !important;
  }

  /* Fix for the Main Heading "Physiotherapy Services" */
  .main-services-heading {
    color: #90caf9 !important; /* Much brighter light blue */
    text-shadow: 0 0 10px rgba(144, 202, 249, 0.3); /* Subtle glow to prevent dimming */
    opacity: 1 !important;
  }

  /* Fix for Sub-headings like "Orthopaedic Conditions", etc. */
  .service-category {
    color: #64b5f6 !important; /* Vibrant sky blue */
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    opacity: 1 !important;
    letter-spacing: 0.8px;
  }

  /* Ensuring Areas Served title is also bright */
  .services-box h4 {
    color: #90caf9 !important;
    opacity: 1 !important;
  }

  /* Pill adjustments for better dark mode visibility */
  .services-grid span {
    background: #2a3542 !important; 
    color: #ffffff !important; 
    border-color: #3d4b5c !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }

  .services-grid span.neuro {
    background: #111b27 !important;
    color: #90caf9 !important;
    border-color: #64b5f6 !important;
  }

  .services-grid span.home-visit-pill {
    background: #1b3320 !important;
    color: #81c784 !important; /* Brighter green for dark mode */
    border-color: #2e7d32 !important;
  }
}

/* ABOUT SECTION STYLES */
.about-section {
  width: 100%;
  max-width: 360px;
  margin: 15px auto;
  text-align: left;
  background: var(--card);
  /* Ultra-Prominent Blue Border */
  border: 3px solid #0e5a95; 
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.about-section summary {
  padding: 16px 20px;
  font-weight: 900; /* Max Bold */
  font-size: 17px;
  color: #0e5a95;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  text-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Makes text pop */
}

.about-section summary::after {
  content: '▼';
  font-size: 12px;
  transition: transform 0.4s;
}

.about-section[open] summary::after {
  transform: rotate(180deg);
}

/* Style for the doctor’s image – Imitating the screenshot’s squircle look */
.doctor-img {
  width: 100px;
  height: 115px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  margin: 0 auto 15px auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  border: 2px solid #adcffa;
}

/* THE FIX: Set default state to hidden and up */
.about-content {
  padding: 0 20px 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  opacity: 0; /* Hidden by default */
  transform: translateY(-40px); /* Positioned up by default */
  pointer-events: none; /* Prevents clicks while hidden */
}

/* Repeatable slow cinematic animation */
@keyframes slowSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-40px) scale(0.92);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Apply animation and force it to stay visible at the end */
.about-section[open] .about-content {
  opacity: 1; 
  transform: translateY(0);
  pointer-events: auto;
  animation: slowSlideIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.about-section[open] {
  border-color: #2f68ba;
  box-shadow: 0 12px 35px rgba(14, 90, 149, 0.45);
  transform: translateY(-4px) scale(1.01);
}

/* FEEDBACK */
.feedback {
  opacity: 0;
  transition: 0.3s;
  font-size: 13px;
  margin-top: 8px;
  border-radius: 7px;
  padding: 7px;
  background: var(--success-bg);
  color: var(--success-color);
}
.feedback.show { opacity: 1; }

/* QR */
.qr img {
  width: 120px;
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 20px;
}

/* DARK MODE - FINAL CLEAN VERSION */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --card: #1e1e1e;
    --text: #f0f0f0;
    --shadow: 0 4px 12px rgba(0,0,0,0.6);
    --success-bg: #193c1f;
    --success-color: #69ff99;
  }

  h1 { color: #4da3ff; }
  .title, .addr, .phone { color: #e0e0e0; }

  .services-box {
    background: linear-gradient(135deg, #1f2a36, #18222c);
    border-left: 5px solid #4da3ff;
  }

  /* About Section Dark Mode - Vibrant & Thick */
  .about-section { 
    border-color: #4da3ff !important; 
    border-width: 3px;
    background: #1e1e1e;
  }
  .about-section summary { color: #4da3ff; }
  .about-content { color: #ffffff; }
  .doctor-img {
    border-color: #0e5a95 !important; /* Matches the dark mode neuro tiles */
  }

  /* Ensure services grid spans stay visible */
  .services-grid span {
    background: #2a3542;
    color: #f0f0f0;
  }
   
    /* Neurological Services in Dark Mode - Exact Image Match */
  .services-grid span:nth-child(6), 
  .services-grid span:nth-child(7), 
  .services-grid span:nth-child(8), 
  .services-grid span:nth-child(9) {
    background: #1a222c !important; /* Deep charcoal-blue background */
    border: 1px solid #0e5a95 !important; /* Muted blue border */
    color: #4da3ff !important; /* Vibrant bluish text tone */
    font-weight: 600; /* Makes the blue text crisp and readable */
  }
  
  .services-grid span:last-child {
    background: #1b3320;
    border-color: #2e7d32;
    color: #69ff99;
  }
}

/* Reviews Section Styling */
.review-carousel {
  overflow: hidden;
  width: 100%;
  max-width: 400px; /* Matches your vCard width */
  margin: 15px auto;
  padding: 10px 0;
  cursor: grab;
}

.review-track {
  display: flex;
  width: max-content;
  animation: scrollReviews 40s linear infinite; /* Slowed down for readability */
}

.review-card {
  background: var(--card);
  width: 280px;
  margin: 0 10px;
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-align: left;
  flex-shrink: 0;
  border: 3px solid #adcffa;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.review-stars { color: #fbbc04; font-size: 14px; margin-bottom: 8px; }

.review-text { 
  font-size: 13px; 
  line-height: 1.5; 
  color: var(--text); 
  margin: 0; 
  font-style: italic;
  white-space: normal; /* Allows text to wrap */
}

.review-author { 
  margin-top: 12px; 
  font-size: 12px; 
  border-top: 1px solid rgba(0,0,0,0.05); 
  padding-top: 8px; 
}

.review-author strong { display: block; color: var(--text); }
.review-author span { color: var(--muted); font-size: 11px; }

/* Animation Logic */
@keyframes scrollReviews {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- FIXED INTERACTION LOGIC --- */

/* Only trigger hover pause on devices with a mouse (Desktop) */
@media (hover: hover) {
  .review-carousel:hover .review-track {
    animation-play-state: paused;
  }
}

/* This class is controlled by JavaScript for mobile touch */
.review-carousel.paused .review-track {
  animation-play-state: paused;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .review-card {
    /* Updated to match doctor-img dark mode border */
    border: 2px solid #0e5a95; 
    background: #1e1e1e;
  }
  .review-author { border-top: 1px solid rgba(255,255,255,0.1); }
}

/* Optional: smoother touch behavior */
.review-swiper {
  touch-action: pan-y;
}
