/* ============================================================
   Raj Speech & Hearing Care – Custom Styles
   Tailwind CDN handles utilities; this file adds extras
   ============================================================ */

/* ----- Smooth Scrolling ----- */
html {
  scroll-behavior: smooth;
}

/* ----- Scroll Reveal Animation ----- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children of a reveal container */
.reveal-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}
.reveal-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-children.visible > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-children.visible > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-children.visible > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-children.visible > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-children.visible > *:nth-child(6) { transition-delay: 0.40s; }
.reveal-children.visible > *:nth-child(7) { transition-delay: 0.47s; }
.reveal-children.visible > *:nth-child(8) { transition-delay: 0.54s; }

/* ----- Navbar Shadow on Scroll ----- */
#navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ----- Service Card Hover ----- */
.service-card {
  cursor: default;
}

/* ----- Hero Gradient Text ----- */
.gradient-text {
  background: linear-gradient(135deg, #b91c1c, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ----- Pulse animation for status dot ----- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ----- WhatsApp button pulse ring ----- */
.whatsapp-float::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.5);
  animation: ring-pulse 2s ease infinite;
}
@keyframes ring-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  70% { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* ----- Focus styles for accessibility ----- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #b91c1c;
  outline-offset: 2px;
}

/* ----- Form input placeholder ----- */
::placeholder {
  color: #9ca3af;
}

/* ----- Hide scrollbar on mobile award strip ----- */
.sm\:hidden .overflow-x-auto::-webkit-scrollbar {
  display: none;
}

/* ----- Custom scrollbar (webkit) ----- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #fca5a5;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #b91c1c;
}

/* ----- Progressive image fade-in on load ----- */
img.img-fade {
  opacity: 0;
  transition: opacity 0.4s ease;
}
img.img-fade.img-loaded {
  opacity: 1;
}

/* ----- Image skeleton shimmer (while loading) ----- */
.img-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----- Print styles ----- */
@media print {
  nav, footer, .fixed { display: none !important; }
  body { padding: 0; }
}

/* ===================================================
   GLOBAL IMAGE LIGHTBOX
=================================================== */
#global-lb {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: zoom-out;
  animation: lb-fade-in 0.2s ease forwards;
}
#global-lb.active { display: flex; }

@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#global-lb-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  cursor: default;
  transition: opacity 0.25s ease;
  animation: lb-img-in 0.25s ease forwards;
}

@keyframes lb-img-in {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

#global-lb-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  backdrop-filter: blur(6px);
}
#global-lb-close:hover {
  background: rgba(255, 255, 255, 0.30);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
}

#global-lb-caption {
  position: absolute;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 0 3rem;
  pointer-events: none;
}

/* Tap/click hint bottom of image card */
#global-lb-hint {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.65);
  background: rgba(0,0,0,0.4);
  padding: 2px 10px;
  border-radius: 99px;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

/* --- Zoomable image styles --- */
img.lb-enabled {
  cursor: zoom-in;
  transition: filter 0.25s ease, transform 0.35s ease;
}

/* Inside overflow:hidden parents → zoom on hover */
.lb-zoom-wrap {
  position: relative;
  overflow: hidden;
}
.lb-zoom-wrap img.lb-enabled {
  transition: transform 0.45s ease, filter 0.25s ease;
}
.lb-zoom-wrap:hover img.lb-enabled {
  transform: scale(1.06);
  filter: brightness(0.88);
}

/* "Tap to view" hint inside zoom-wrap */
.lb-zoom-wrap .lb-hint {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.45);
  padding: 2px 10px;
  border-radius: 99px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(4px);
}
.lb-zoom-wrap:hover .lb-hint {
  opacity: 1;
}

/* For standalone images (no overflow-hidden parent) */
img.lb-enabled:not(.lb-zoom-wrap img) {
  transition: filter 0.25s ease;
}
img.lb-enabled:hover {
  filter: brightness(0.88);
}
