/* ============================================
   Hammam El Bahia — Custom Styles
   Complements Tailwind CDN utilities
   ============================================ */

html {
  scroll-behavior: smooth;
}

::selection {
  background: #c9a227;
  color: #0b0b0c;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f8f4ec;
}
::-webkit-scrollbar-thumb {
  background: #c9a227;
  border-radius: 999px;
}

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #c9a227;
  outline-offset: 2px;
}

/* ---------- Preloader ---------- */
#preloader {
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(201, 162, 39, 0.2);
  border-top-color: #c9a227;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Navbar ---------- */
#navbar {
  background: transparent;
}
#navbar.scrolled {
  background: rgba(11, 11, 12, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.5);
}

.nav-link {
  position: relative;
  padding-bottom: 2px;
  transition: color 0.25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: #d8b843;
  transition: width 0.25s ease;
}
.nav-link:hover,
.nav-link.active {
  color: #eddb95;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero-bg {
  background-image: url("https://images.unsplash.com/photo-1540555700478-4be289fbecef?auto=format&fit=crop&w=1920&q=80");
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
}

.hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(11, 11, 12, 0.55) 0%,
    rgba(11, 11, 12, 0.75) 55%,
    rgba(11, 11, 12, 0.95) 100%
  );
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Service cards ---------- */
.service-card {
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 2rem;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(201, 162, 39, 0.4);
  box-shadow: 0 20px 45px -20px rgba(201, 162, 39, 0.35);
}

/* ---------- Gallery ---------- */
.gallery-img {
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: saturate(0.95);
}
.gallery-img:hover {
  transform: scale(1.04);
  filter: saturate(1.1);
}

/* ---------- Pricing ---------- */
.pricing-card {
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s ease;
}
.pricing-card:hover {
  transform: translateY(-6px);
}
.pricing-card--featured {
  background: linear-gradient(160deg, #1c1c1f 0%, #23200f 100%);
  border: 1px solid rgba(201, 162, 39, 0.5);
  transform: scale(1.03);
}
.pricing-card--featured:hover {
  transform: scale(1.03) translateY(-6px);
}

/* ---------- FAQ ---------- */
.faq-question svg {
  transition: transform 0.3s ease;
}
.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding-bottom: 0;
}
.faq-item.open .faq-answer {
  padding-bottom: 1.25rem;
}

/* ---------- WhatsApp pulse ---------- */
.whatsapp-pulse {
  animation: whatsappPulse 2.4s infinite;
}
@keyframes whatsappPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ---------- Toast ---------- */
#toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) translateX(-50%);
}

/* ---------- Arabic mode ---------- */
html[dir="rtl"] body {
  font-family: "Tajawal", sans-serif;
}
html[dir="rtl"] .font-serif {
  font-family: "Tajawal", sans-serif;
}
html[dir="rtl"] .nav-link::after {
  left: auto;
  right: 0;
}

/* ---------- Misc ---------- */
img {
  max-width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
