/* ============================================
   Dr. V Reddy — Primary Care, Watseka, IL
   Custom Styles
   ============================================ */

/* ---------- Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  overflow-x: hidden;
}

::selection {
  background: #F47262;
  color: white;
}

/* ---------- Navbar ---------- */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 20px rgba(0, 0, 0, 0.04);
}

.nav-logo-text {
  transition: color 0.4s ease;
}

.nav-logo-sub {
  transition: color 0.4s ease;
}

#navbar:not(.scrolled) .nav-logo-text {
  color: #ffffff;
}

#navbar:not(.scrolled) .nav-logo-sub {
  color: #F47262;
}

#navbar.scrolled .nav-logo-text {
  color: #1F1F23;
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #F47262;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

#navbar:not(.scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

#navbar:not(.scrolled) .nav-link:hover {
  color: #F47262;
}

/* ---------- Mobile Menu ---------- */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

#mobile-menu.open #menu-line-1 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 24px;
}

#mobile-menu.open #menu-line-2 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  width: 24px;
}

/* ---------- Service Cards ---------- */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #F47262, #E85544);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

.service-card:hover::before {
  transform: scaleX(1);
}

/* ---------- Reveal Animations ---------- */
/* Default state: all elements visible (no JS required) */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* When JS adds .revealed, trigger the animation */
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Progressive enhancement: hide initially for animated reveal */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
  }

  .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* ---------- Button focus ---------- */
button:focus-visible,
a:focus-visible {
  outline: 2px solid #F47262;
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

::-webkit-scrollbar-thumb {
  background: #c7c7cd;
  border-radius: 4px;
}

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

/* ---------- Input autofill ---------- */
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
}

/* ---------- Print ---------- */
@media print {
  #navbar, #mobile-menu, button {
    display: none !important;
  }

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

  .service-card {
    break-inside: avoid;
  }
}
