/* ===== Custom Styles for J & J Barber and Beauty ===== */

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

/* Body base */
body {
  overflow-x: hidden;
}

/* ===== Navbar ===== */
#navbar {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
  background: rgba(10, 22, 40, 0.97);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

#navbar.scrolled .font-serif,
#navbar.scrolled .text-navy-900 {
  color: #faf6ef !important;
}

#navbar.scrolled .text-navy-600 {
  color: #d4c9ba !important;
}

#navbar.scrolled .menu-line {
  background: #faf6ef !important;
}

/* ===== Mobile Menu ===== */
.mobile-link {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#mobileMenu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* Menu button animation */
#menuBtn.active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

#menuBtn.active .menu-line:nth-child(2) {
  opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
  width: 1.5rem;
}

/* ===== Service Cards ===== */
.service-card {
  transform: translateY(0);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.service-card:hover {
  transform: translateY(-6px);
}

/* ===== Gallery ===== */
.gallery-item {
  cursor: pointer;
  position: relative;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0);
  transition: background 0.4s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  background: rgba(10, 22, 40, 0.2);
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ===== Prefers reduced motion ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(40px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
  .gallery-item img,
  .service-card img {
    transition: none;
  }
  .service-card:hover img {
    transform: none;
  }
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #c9a84c;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== Selection ===== */
::selection {
  background: #c9a84c;
  color: #0a1628;
}

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

::-webkit-scrollbar-track {
  background: #0a1628;
}

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

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

/* ===== Input autofill ===== */
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px #faf6ef inset !important;
  -webkit-text-fill-color: #0a1628 !important;
}
