/* ==========================================================================
   NISHA DENTAL CLINIC — PREMIUM ANIMATED & INTERACTIVE MOTION SYSTEM
   Agency-Grade Micro-Interactions, Smooth Scroll, Cursor & Marquee
   ========================================================================== */

/* 1. Custom Interactive Magnetic Cursor (Desktop only) */
.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--primary-600);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--primary-500);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.25s ease,
              border-color 0.25s ease,
              opacity 0.2s ease;
  backdrop-filter: blur(1px);
}

.custom-cursor-ring.cursor-hover {
  width: 58px;
  height: 58px;
  background-color: rgba(13, 148, 136, 0.12);
  border-color: var(--accent-500);
}

.custom-cursor-ring.cursor-active {
  width: 30px;
  height: 30px;
  background-color: rgba(234, 88, 12, 0.2);
}

@media (pointer: coarse), (max-width: 992px) {
  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none !important;
  }
}

/* 2. Scroll-Triggered Storytelling Reveals */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.reveal-left {
  transform: translateX(-40px);
}

.reveal-on-scroll.reveal-right {
  transform: translateX(40px);
}

.reveal-on-scroll.reveal-scale {
  transform: scale(0.92);
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Stagger Delays */
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }
.delay-5 { transition-delay: 0.40s; }

/* 3. Hero Interactive Dental Motif & Parallax Background */
.hero-motif-bg {
  position: absolute;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  width: 550px;
  height: 550px;
  pointer-events: none;
  opacity: 0.7;
  z-index: 0;
  transition: transform 0.25s ease-out;
}

.hero-motif-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 35px rgba(20, 184, 166, 0.2));
}

.hero-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-300) 0%, rgba(20, 184, 166, 0) 70%);
  opacity: 0.6;
  pointer-events: none;
  animation: floatParticle 8s ease-in-out infinite alternate;
}

@keyframes floatParticle {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-25px) scale(1.15); }
  100% { transform: translateY(15px) scale(0.9); }
}

/* Animated Word Split Entrance */
.reveal-words-wrap {
  display: inline;
}

.word-span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.word-span.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 4. Trust Stats Count-Up Glow */
.trust-num {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  transition: color 0.3s ease;
}

.counter-value {
  font-variant-numeric: tabular-nums;
}

/* 5. 14 Services Grid — Staggered Entrance, 3D Hover & Inline Accordion */
.service-card {
  position: relative;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 20px 30px -10px rgba(13, 148, 136, 0.18),
              0 10px 15px -3px rgba(15, 23, 42, 0.08);
  border-color: var(--primary-400);
}

.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid transparent;
  pointer-events: none;
  transition: border-color 0.3s ease;
}

.service-card:hover::after {
  border-color: var(--primary-400);
}

/* Service Inline Accordion Details */
.service-inline-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease,
              margin-top 0.35s ease;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  margin-top: 0;
}

.service-inline-details.is-open {
  max-height: 500px;
  opacity: 1;
  margin-top: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--primary-100);
}

.service-toggle-btn {
  background: transparent;
  border: none;
  color: var(--primary-600);
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: gap 0.2s ease, color 0.2s ease;
}

.service-toggle-btn:hover {
  color: var(--primary-800);
  gap: 0.6rem;
}

.service-toggle-btn svg {
  transition: transform 0.3s ease;
}

.service-toggle-btn.is-active svg {
  transform: rotate(90deg);
}

/* 6. Doctor Cards Micro-Interactions & Hover Lift */
.doctor-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
}

.doctor-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.12);
  border-color: var(--primary-400);
}

.doctor-avatar-circle {
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.doctor-card:hover .doctor-avatar-circle {
  transform: scale(1.08);
  border-color: var(--accent-400);
}

/* 7. Facilities Staggered Bounce Pop-In */
.facility-card {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.facility-card:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-400);
}

.facility-card:hover .facility-icon-circle {
  transform: scale(1.15) rotate(4deg);
  background: var(--primary-600);
  color: #ffffff;
}

/* 8. Infinite Auto-Scrolling Testimonial Marquee */
.marquee-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 1.5rem 0;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
  display: flex;
  gap: 1.75rem;
  width: max-content;
  animation: scrollMarquee 38s linear infinite;
  will-change: transform;
}

.marquee-track:hover {
  animation-play-state: paused;
}

.marquee-card {
  width: 380px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.marquee-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
}

@keyframes scrollMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 0.875rem)); }
}

/* 9. Emergency Hotline Ripple Pulse */
.emergency-pulse-ring {
  position: relative;
  display: inline-flex;
}

.emergency-pulse-ring::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.4);
  animation: emergencyRipple 2.2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  z-index: 0;
}

@keyframes emergencyRipple {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.25);
    opacity: 0;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

.emergency-banner {
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 50%, #ea580c 100%);
  background-size: 200% 200%;
  animation: emergencyGradient 8s ease infinite alternate;
}

@keyframes emergencyGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* 10. Form Floating Labels & Focus Glow */
.floating-form-group {
  position: relative;
  margin-bottom: 0.5rem;
}

.floating-form-group .form-input,
.floating-form-group .form-select,
.floating-form-group .form-textarea {
  padding: 1.1rem 1rem 0.5rem;
  border: 1.5px solid var(--slate-300);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.floating-form-group .form-input:focus,
.floating-form-group .form-select:focus,
.floating-form-group .form-textarea:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
  background-color: #ffffff;
}

/* 11. Navigation Active Spy Indicator */
.nav-links a {
  transition: color 0.2s ease;
}

.nav-links a.active {
  color: var(--primary-600);
}

/* 12. Accessibility: PREFERS-REDUCED-MOTION Overrides */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }

  .word-span {
    opacity: 1 !important;
    transform: none !important;
  }

  .marquee-track {
    animation: none !important;
    transform: none !important;
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  .marquee-card {
    width: calc(50% - 1rem) !important;
  }

  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none !important;
  }

  .emergency-pulse-ring::before {
    display: none !important;
  }

  .hero-particle {
    display: none !important;
  }
}

/* ==========================================================================
   DARK LUXURY APPOINTMENT BOOKING POPUP MODAL (MATCHING REFERENCE DESIGN)
   ========================================================================== */

.appointment-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 24, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.appointment-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.appointment-popup-card {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: linear-gradient(180deg, #0b142b 0%, #070d1e 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 2.2rem 2.2rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7),
              0 0 40px -10px rgba(0, 210, 198, 0.25);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
}

.appointment-modal-backdrop.is-active .appointment-popup-card {
  transform: scale(1) translateY(0);
}

.appointment-popup-card.inline-dark-form {
  transform: none !important;
  max-width: 100%;
  margin: 0;
  box-shadow: 0 20px 40px -10px rgba(11, 20, 43, 0.5),
              0 0 35px -5px rgba(0, 210, 198, 0.25);
}

/* Close Button (top-right circular) */
.popup-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}

.popup-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: rotate(90deg);
}

/* Glowing Tooth Badge */
.popup-tooth-badge {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #00d2c6 0%, #0284c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  box-shadow: 0 0 35px 8px rgba(0, 210, 198, 0.45);
}

.popup-tooth-badge svg {
  width: 30px;
  height: 30px;
  color: #ffffff;
  fill: #ffffff;
}

/* Header Titles */
.popup-title {
  color: #ffffff;
  font-size: 1.65rem;
  font-weight: 800;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.popup-subtitle {
  color: #94a3b8;
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 1.75rem;
  line-height: 1.45;
}

/* Form Styles */
.popup-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.popup-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.popup-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.popup-label .required-star {
  color: #10b981;
  font-weight: 800;
}

.popup-input,
.popup-select,
.popup-textarea {
  width: 100%;
  background: #111c38;
  border: 1.5px solid #1e2e54;
  border-radius: 10px;
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-size: 0.925rem;
  font-family: inherit;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.popup-input::placeholder,
.popup-textarea::placeholder {
  color: #64748b;
}

.popup-input:focus,
.popup-select:focus,
.popup-textarea:focus {
  outline: none;
  background: #142142;
  border-color: #00d2c6;
  box-shadow: 0 0 0 3px rgba(0, 210, 198, 0.2);
}

.popup-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' 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: 14px;
  padding-right: 2.25rem;
  cursor: pointer;
}

.popup-select option {
  background: #0b142b;
  color: #ffffff;
}

.popup-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.popup-textarea {
  min-height: 75px;
  resize: vertical;
}

/* Submit WhatsApp Button */
.popup-submit-btn {
  background: linear-gradient(135deg, #00cba0 0%, #00b094 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.95rem 1.5rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.5rem;
  box-shadow: 0 6px 20px rgba(0, 203, 160, 0.35);
  transition: all 0.25s ease;
}

.popup-submit-btn:hover {
  background: linear-gradient(135deg, #00d8ab 0%, #00bc9e 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 203, 160, 0.45);
}

.popup-submit-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@media (max-width: 576px) {
  .appointment-popup-card {
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: 20px;
  }
  .popup-row-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .popup-title {
    font-size: 1.4rem;
  }
}
