/* ==========================================
   Lung Diagnostics Sleep Clinic — Custom Styles
   ========================================== */

/* Base */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

/* Selection */
::selection {
  background: #FFD5D8;
  color: #1E232C;
}

/* ==========================================
   Navbar Scroll State
   ========================================== */
#navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(30, 35, 44, 0.06);
}

#navbar.scrolled .font-serif {
  color: #1E232C;
}

/* ==========================================
   Mobile Menu
   ========================================== */
#mobileMenu {
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-link {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid #E4E7ED;
}

.mobile-link:last-of-type {
  border-bottom: none;
}

/* ==========================================
   Scroll Reveal Animations
   (Progressive Enhancement — content is
   visible by default, JS adds the animation)
   ========================================== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }

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

  /* Staggered delays for grid items */
  .reveal:nth-child(1) { transition-delay: 0.05s; }
  .reveal:nth-child(2) { transition-delay: 0.12s; }
  .reveal:nth-child(3) { transition-delay: 0.19s; }
  .reveal:nth-child(4) { transition-delay: 0.26s; }
  .reveal:nth-child(5) { transition-delay: 0.33s; }
  .reveal:nth-child(6) { transition-delay: 0.40s; }
}

/* ==========================================
   Back to Top Button
   ========================================== */
#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#backToTop:not(.visible) {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

/* ==========================================
   Form Styles
   ========================================== */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378859B' stroke-width='2.5' 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;
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
}

/* ==========================================
   Focus Visible (Accessibility)
   ========================================== */
:focus-visible {
  outline: 2px solid #F97583;
  outline-offset: 2px;
}

/* ==========================================
   Smooth Image Loading
   ========================================== */
img {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* ==========================================
   Custom Scrollbar
   ========================================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #F6F7F9;
}

::-webkit-scrollbar-thumb {
  background: #C8CED9;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #A3ADBF;
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
  header, footer, #backToTop, .reveal {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
