/* css/styles.css
   Ultimate premium portfolio styles — Lakeside Harmony Massage
   Bluegrass Digital Forge • Warm, trustworthy, serene Lake Cumberland aesthetic
   Mobile-first • Core Web Vitals optimized • buttery smooth
*/

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --lake-blue: #2A5F6E;
  --sage: #5C7C5D;
  --earth: #B87C5C;
  --cream: #F8F5F0;
  --deep: #1E3F47;
  --text: #2D3748;
  --min-touch: 48px;
}

/* Base + mobile-first */
html { scroll-behavior: smooth; }
.tail-container {
  font-family: 'Inter', system_ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.heading-serif {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Colors */
.lake-text { color: var(--lake-blue); }
.sage-text { color: var(--sage); }
.earth-accent { color: var(--earth); }

/* Premium backgrounds */
.premium-bg { background-color: var(--cream); }

.lake-gradient {
  background: linear-gradient(135deg, var(--lake-blue) 0%, var(--deep) 100%);
}

.masssage-bg, .massage-bg {
  background-image: linear-gradient(rgba(248, 245, 240, 0.90), rgba(248, 245, 240, 0.94)), url('../images/5.webp');
  background-size: cover;
  background-position: center;
}

/* Hero */
.hero-bg { background-size: cover; background-position: center 28%; }

/* Refined hero overlay for impact */
.hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(30, 63, 71, 0.55) 0%,
    rgba(30, 63, 71, 0.32) 38%,
    rgba(30, 63, 71, 0.68) 68%,
    rgba(30, 63, 71, 0.82) 100%
  );
}

/* Navigation */
.nav-link {
  position: relative;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover { color: var(--lake-blue); }

.nav-link:after {
  content: '';
  position: absolute;
  width: 0;
  height: 1.5px;
  bottom: -2px;
  left: 0;
  background-color: var(--lake-blue);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-scrolled {
  background-color: rgba(248, 245, 240, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 0 rgba(42, 95, 110, 0.06);
}

.nav-active {
  color: var(--lake-blue);
}

/* Service Cards — Premium hover + animations */
.service-card {
  transition: transform 0.45s cubic-bezier(0.23, 1.0, 0.32, 1),
              box-shadow 0.45s cubic-bezier(0.23, 1.0, 0.32, 1),
              border-color 0.3s ease;
  border: 1px solid #EDE7DB;
  will-change: transform;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.12), 
              0 10px 10px -6px rgb(0 0 0 / 0.08);
  border-color: #D9D0BE;
}

.service-card .service-icon {
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), color 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.08) rotate(2deg);
}

.service-card .service-meta {
  transition: color 0.3s ease;
}

.service-card:hover .service-meta {
  color: var(--lake-blue);
}

/* Subtle premium lift micro-interaction on card content */
.service-card:hover h3 {
  color: var(--deep);
}

.service-card .cta-hint {
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.3s ease;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.service-card:hover .cta-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Gallery */
.gallery-img {
  transition: transform 0.55s cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 0.4s ease,
              filter 0.3s ease;
  will-change: transform;
}

.gallery-img:hover {
  transform: scale(1.035);
  box-shadow: 0 30px 60px -15px rgb(0 0 0 / 0.45);
  filter: contrast(1.02) saturate(1.03);
}

.gallery-item {
  overflow: hidden;
  border-radius: 1.5rem;
  position: relative;
}

.gallery-item:after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.08));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover:after {
  opacity: 1;
}

/* Benefits & testimonial cards */
.benefit-card {
  transition: transform 0.35s cubic-bezier(0.23,1,0.32,1), box-shadow 0.3s ease, border-color 0.3s;
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgb(42 95 110 / 0.08);
  border-color: #D9D0BE;
}

.benefit-icon {
  transition: transform 0.4s cubic-bezier(0.23,1.0,0.32,1);
}

.benefit-card:hover .benefit-icon {
  transform: scale(1.1);
}

.testimonial-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -4px rgb(0 0 0 / 0.07);
}

/* Modals */
.modal {
  animation: premiumModalEnter 0.28s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes premiumModalEnter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Mobile Menu Premium */
#mobile-menu {
  transition: all 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
}

#mobile-menu:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-link {
  transition: all 0.2s ease;
  position: relative;
}

.mobile-nav-link:hover {
  padding-left: 1.25rem;
  color: var(--lake-blue);
}

/* Scroll reveals */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.23,1,0.32,1),
              transform 0.7s cubic-bezier(0.23,1,0.32,1);
}

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

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: all 0.55s cubic-bezier(0.23,1,0.32,1);
}

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.visible > *:nth-child(2) { transition-delay: 60ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 110ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 155ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 200ms; }

/* Stat / trust polish */
.stat {
  transition: all 0.4s ease;
}

/* Buttons */
.premium-btn {
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.premium-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgb(42 95 110 / 0.25);
}

.premium-btn:active {
  transform: scale(0.985);
}

/* Footer polish */
.footer-strong {
  font-size: 0.75rem;
  letter-spacing: 0.25px;
  color: #A89F8B;
}

/* Light glass + subtle grid */
.light-glass {
  background: rgba(255,255,255, 0.92);
  backdrop-filter: blur(20px);
}

.subtle-grid {
  background-image: 
    linear-gradient(rgba(42, 95, 110, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 95, 110, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* Form polish */
input, select, textarea {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* Fast performance helpers */
img {
  image-rendering: -webkit-optimize-contrast;
}

/* Accessibility + focus */
:focus-visible {
  outline: 2px solid var(--lake-blue);
  outline-offset: 2px;
}

/* Small screens hero tweaks */
@media (max-width: 768px) {
  .hero-bg {
    background-attachment: scroll;
  }
  .section-header {
    font-size: 2rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .service-card:hover,
  .gallery-img:hover {
    transform: none;
  }
}

/* =========================================
   ULTIMATE POLISH: Mobile-first + Premium
   ========================================= */

/* Perfect touch targets (WCAG 2.2) */
a, button, .service-card, .gallery-item, .benefit-card, 
#mobile-menu a, select, input, textarea {
  min-height: var(--min-touch);
}
button, .premium-btn, a[href^="tel"], .nav-link, .mobile-nav-link {
  min-height: 48px;
  min-width: 48px;
}

/* Buttery smooth base */
* {
  -webkit-tap-highlight-color: transparent;
}
button:active, .premium-btn:active {
  transform: scale(0.985);
  transition: transform 80ms ease;
}

/* Gallery lightbox polish */
#lightbox img { transition: opacity 0.2s ease; }

/* Testimonials carousel */
#testimonial-carousel { 
  background: #F8F5F0; 
}
#testimonial-track { will-change: transform; }
#testimonial-dots button { transition: all 0.25s ease; }
#testimonial-dots button:hover { transform: scale(1.15); }

/* Booking form ultra clean states */
form input:focus, form select:focus, form textarea:focus {
  box-shadow: 0 0 0 3px rgba(42,95,110,0.08);
  border-color: var(--lake-blue);
}

/* Fast image rendering + no layout shift helpers */
img { 
  image-rendering: -webkit-optimize-contrast; 
  height: auto;
}

/* Premium micro button + card lift refinement */
.premium-btn {
  position: relative;
  overflow: hidden;
}
.premium-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.18), transparent);
  opacity: 0;
  transition: opacity .2s;
}
.premium-btn:hover::after { opacity: 1; }

/* Extra serene hover states */
.service-card, .benefit-card, .gallery-item {
  backface-visibility: hidden;
}

/* Footer branding stronger */
.footer-strong { letter-spacing: 0.3px; }

/* Mobile menu butter */
#mobile-menu a { min-height: 52px; display: flex; align-items: center; }

/* Responsive typography polish */
@media (max-width: 640px) {
  .heading-serif { font-size: clamp(2.1rem, 9vw, 3.1rem); }
  h1.heading-serif { font-size: clamp(2.75rem, 11vw, 3.9rem); }
}

/* Desktop refinement */
@media (min-width: 1024px) {
  .service-card:hover { transform: translateY(-11px); }
}

/* PWA offline friendly hint */
.offline-notice {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  color: #fff;
}

/* Ensure no CLS on lazy images */
.gallery-img, .service-card img, picture img {
  display: block;
}

/* Extra trust polish */
.stat { transition: all .35s cubic-bezier(0.23,1,0.32,1); }

/* =========================================
   BOOKING MODAL — Mobile perfection
   Full-width comfortable sheet, large targets, no-zoom, scrollable, serene + dark friendly
   ========================================= */

/* Prevent iOS/Safari auto-zoom on form fields (critical for "zoomed" complaint) */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Booking modal sheet: premium bottom drawer on mobile + centered on desktop */
#booking-modal .modal {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Nicer slide-up animation for mobile sheet (avoids scale "zoom" perception) */
@media (max-width: 767px) {
  #booking-modal .modal {
    animation: bookingSheetEnter 0.32s cubic-bezier(0.23, 1, 0.32, 1);
  }
}

@keyframes bookingSheetEnter {
  from {
    opacity: 0;
    transform: translateY(44px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Comfortable mobile padding + safe area + generous touch targets */
@media (max-width: 767px) {
  #booking-modal .modal {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-top: 1.25rem;
    padding-bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
    max-height: 92dvh;
    max-height: 92vh; /* fallback */
  }

  /* Larger, easy tap inputs & selects inside the booking modal */
  #booking-modal input,
  #booking-modal select {
    min-height: 52px;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-radius: 1rem;
    /* already 16px from base rule; ensure no smaller */
  }

  #booking-modal button[type="submit"] {
    min-height: 54px;
    border-radius: 9999px;
    font-weight: 600;
  }

  /* Ensure stacked fields get breathing room */
  #booking-modal .space-y-4 > * + * {
    margin-top: 1rem;
  }
}

/* Desktop / tablet refinements for modal */
@media (min-width: 768px) {
  #booking-modal .modal {
    padding-bottom: 2.25rem;
  }
}

/* Dark mode friendly (system dark or forced) — keeps premium serene feel */
@media (prefers-color-scheme: dark) {
  #booking-modal .modal {
    background-color: #13252a;
    color: #e8e2d9;
  }
  #booking-modal .modal input,
  #booking-modal .modal select {
    background-color: #1f343b;
    color: #f0e9df;
    border-color: #2a4a52;
  }
  #booking-modal .modal input:focus,
  #booking-modal .modal select:focus {
    background-color: #243d44;
    border-color: #5f8a9a;
  }
  #booking-modal .modal p {
    color: #b8b0a3;
  }
  #booking-modal .modal button[type="submit"] {
    background-color: #3a7a8c;
  }
  #booking-modal .modal button[type="submit"]:hover {
    background-color: #2a5f6e;
  }
  /* text color overrides for the few hard-coded classes */
  #booking-modal .modal [class*="text-[#64748B]"],
  #booking-modal .modal [class*="text-[#475569]"],
  #booking-modal .modal .text-xs {
    color: #9ca5a8 !important;
  }
}

/* Improve global touch targets slightly for form controls & buttons in modal context */
#booking-modal button,
#booking-modal input,
#booking-modal select {
  touch-action: manipulation;
}

/* Make sure main booking form (non-modal) also benefits from no-zoom + decent touch on small screens */
@media (max-width: 640px) {
  #book input, #book select, #book textarea {
    font-size: 16px !important;
    min-height: 48px;
  }
}
