/* ==============================
   CHLC Therapy Center - Styles
   Inspired by Happy Child Education Center
   ============================== */

/* ---------- Smooth Scroll ---------- */
html {
  scroll-behavior: smooth;
}

/* ---------- Selection ---------- */
::selection {
  background-color: #E63946;
  color: #fff;
}

/* ---------- Inline Skeleton Loaders ---------- */
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #e5e7eb 0%, #f8fafc 50%, #e5e7eb 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.25s ease-in-out infinite;
}

.skeleton-card {
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: #e5e7eb;
  }
}

/* ---------- Scrollbar (Webkit) ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f5f5f5;
}
::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #E63946;
}

/* ---------- Floating Animation ---------- */
@keyframes blobFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-12px) rotate(2deg); }
  66% { transform: translateY(6px) rotate(-2deg); }
}

.blob-float {
  animation: blobFloat 5s ease-in-out infinite;
}

.blob-float-delay {
  animation: blobFloat 6s ease-in-out 1s infinite;
}

.blob-float-slow {
  animation: blobFloat 8s ease-in-out 0.5s infinite;
}

/* ---------- Sparkle Pulse ---------- */
@keyframes sparklePulse {
  0%, 100% { opacity: 0.6; transform: scale(1) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(15deg); }
}

.sparkle-pulse {
  animation: sparklePulse 3s ease-in-out infinite;
}

.sparkle-pulse-delay {
  animation: sparklePulse 3.5s ease-in-out 1s infinite;
}

/* ---------- Car Animation ---------- */
@keyframes carDrive {
  0% { transform: translateX(-150px); }
  100% { transform: translateX(110vw); }
}

.car-drift {
  animation: carDrive 18s linear infinite;
}

/* ---------- Star Twinkle Animations ---------- */
@keyframes starTwinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

.star-twinkle {
  animation: starTwinkle 2s ease-in-out infinite;
}

.star-twinkle-delay {
  animation: starTwinkle 2.5s ease-in-out 0.5s infinite;
}

/* ---------- Fade-in on Scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Stat Bar Animation ---------- */
.stat-bar {
  width: 0;
  transition: width 1.5s ease-out;
}

.stat-bar.animate {
  /* width set via JS */
}

/* ---------- Colored Dot Separator ---------- */
.dot-separator {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.dot-separator.centered {
  justify-content: center;
}

.dot-separator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-separator span:nth-child(1) { background: #E63946; }
.dot-separator span:nth-child(2) { background: #3B82F6; }
.dot-separator span:nth-child(3) { background: #F59E0B; }
.dot-separator span:nth-child(4) { background: #EC4899; }

/* ---------- Wavy Section Divider ---------- */
.wave-divider {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.wave-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
}

.wave-divider-top {
  margin-bottom: -1px;
}

.wave-divider-bottom {
  margin-top: -1px;
}

@media (min-width: 768px) {
  .wave-divider svg {
    height: 80px;
  }
}

/* ---------- Circle Backdrop for Images ---------- */
.circle-backdrop {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.circle-backdrop::before {
  content: '';
  position: absolute;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  z-index: 0;
}

.circle-backdrop.pink::before { background: #FFE0E6; }
.circle-backdrop.orange::before { background: #FFF0DB; }
.circle-backdrop.blue::before { background: #DBEAFE; }
.circle-backdrop.green::before { background: #D1FAE5; }
.circle-backdrop.purple::before { background: #EDE9FE; }

.circle-backdrop::after {
  content: '';
  position: absolute;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.05);
  z-index: 0;
}

.circle-backdrop img {
  position: relative;
  z-index: 1;
}

/* ---------- Benefit Cards ---------- */
.benefit-card {
  padding: 24px 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.benefit-card .icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

/* ---------- Program Cards ---------- */
.program-card {
  text-align: center;
  padding: 32px 24px;
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: white;
}

.program-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.program-card .program-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 4px solid;
}

.program-card .title-underline {
  width: 40px;
  height: 3px;
  border-radius: 2px;
  margin: 8px auto 12px;
}

/* ---------- Step Process Cards ---------- */
.step-card {
  text-align: center;
  transition: transform 0.3s ease;
}

.step-card:hover {
  transform: translateY(-4px);
}

.step-card .step-image {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  aspect-ratio: 4/3;
}

.step-card .step-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.step-card:hover .step-image img {
  transform: scale(1.05);
}

.step-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #F97316;
  margin-bottom: 4px;
}

/* ---------- Colored Checkbox Items ---------- */
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.check-item .check-box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-item .check-box svg {
  width: 12px;
  height: 12px;
  color: white;
}

.check-item.green .check-box { background: #4CAF50; }
.check-item.yellow .check-box { background: #F59E0B; }
.check-item.red .check-box { background: #E63946; }
.check-item.blue .check-box { background: #3B82F6; }

/* ---------- FAQ Accordion ---------- */
.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-item.open .faq-content {
  display: block;
}

.faq-item.open {
  border-color: #E63946;
}

.faq-item.open .faq-btn span {
  color: #E63946;
}

/* ---------- Dropdown Nav ---------- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  min-width: 200px;
  padding: 16px 0 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transform: translateX(-50%) translateY(-6px);
  z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Bridge gap so mouse moving to dropdown doesn't lose hover */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 20px;
  background: transparent;
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 0.875rem;
  color: #374151;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu a:hover {
  background: #FFF8F0;
  color: #E63946;
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #fff;
  filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.06));
}

/* Mobile dropdown */
.mobile-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.mobile-dropdown-toggle svg {
  transition: transform 0.2s ease;
}

.mobile-dropdown-toggle.open svg {
  transform: rotate(180deg);
}

.mobile-sub-menu {
  display: none;
  padding-left: 16px;
  margin-top: 4px;
  border-left: 2px solid #E6394620;
}

.mobile-sub-menu.open {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-sub-menu a {
  padding: 8px 4px;
  font-size: 0.875rem;
  color: #6B7280;
}

.mobile-sub-menu a:hover {
  color: #E63946;
}

/* ---------- Nav link active state ---------- */
.nav-link.active,
nav .text-primary.nav-link,
.nav-dropdown > a.text-primary {
  color: #E63946;
  position: relative;
}

.nav-link.active::after,
nav .text-primary.nav-link::after,
.nav-dropdown > a.text-primary::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #E63946;
  border-radius: 1px;
}

/* ---------- Mobile menu animation ---------- */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

#mobile-menu.open {
  display: block;
  max-height: 700px;
}

/* ---------- Hamburger animation ---------- */
.menu-open #bar1 {
  transform: translateY(8px) rotate(45deg);
}

.menu-open #bar2 {
  opacity: 0;
}

.menu-open #bar3 {
  width: 1.5rem;
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Testimonial cards ---------- */
.testimonial-dot.active {
  width: 2rem;
  background-color: #E63946;
}

/* ---------- Header Scroll Shadow ---------- */
#header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ---------- Line Clamp ---------- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Counter pulse ---------- */
@keyframes pulse-gentle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.counter.counting {
  animation: pulse-gentle 0.3s ease-in-out;
}

/* ---------- Infinite Scroll Rows ---------- */
@keyframes scrollLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes scrollRight {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.scroll-row-left {
  animation: scrollLeft 48s linear infinite;
}

.scroll-row-right {
  animation: scrollRight 48s linear infinite;
}

.scroll-row-left-slow {
  animation: scrollLeft 64s linear infinite;
}

.scroll-row-left:hover,
.scroll-row-right:hover,
.scroll-row-left-slow:hover {
  animation-play-state: paused;
}

/* ---------- Floating Icon Decoration ---------- */
.floating-icon {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

.floating-icon svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* ---------- Lavender gradient background ---------- */
.bg-lavender-gradient {
  background: linear-gradient(180deg, #F5F0FF 0%, #EDE9FE 50%, #F5F0FF 100%);
}

.bg-lavender-soft {
  background: #F8F5FF;
}

/* ---------- Responsive helpers ---------- */
@media (max-width: 640px) {
  .hero-title {
    font-size: 1.75rem;
    line-height: 1.2;
  }
}

/* ---------- Focus styles (Accessibility) ---------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #E63946;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Smooth transitions for interactive elements ---------- */
a, button {
  transition: all 0.2s ease;
}

/* ---------- Spin animation (map loading) ---------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Interactive Map Section ---------- */
#map-container {
  width: 100%;
  height: 100%;
  min-height: 380px;
  background: #f3f4f6;
}

/* ---------- Multi-Select Dropdown (map filters) ---------- */
.map-multi-select-wrapper {
  position: relative;
}

.map-multi-select-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s;
}
.map-multi-select-display:hover,
.map-multi-select-wrapper.open .map-multi-select-display {
  border-color: #E63946;
}
.map-multi-select-display span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-multi-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px 0;
}
.map-multi-select-dropdown.open {
  display: block;
}

.map-multi-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
}
.map-multi-select-option:hover {
  background: #fef2f2;
}
.map-multi-select-option input[type="checkbox"] {
  accent-color: #E63946;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}
.map-multi-select-option label {
  cursor: pointer;
  flex: 1;
}
