/* =========================================================
   Novaspa Thai Spa - Custom styles (Bootstrap 5 base)
   Responsive: mobile-first, works on phone / tablet / desktop
   ========================================================= */

:root {
  --site-text-color: #222222;
  --site-primary-color: #b8860b;
}

body {
  color: var(--site-text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", Arial, sans-serif;
}

.site-text-primary { color: var(--site-primary-color) !important; }

.site-btn-primary {
  background-color: var(--site-primary-color);
  border-color: var(--site-primary-color);
  color: #fff;
}
.site-btn-primary:hover, .site-btn-primary:focus {
  background-color: color-mix(in srgb, var(--site-primary-color) 85%, black);
  border-color: color-mix(in srgb, var(--site-primary-color) 85%, black);
  color: #fff;
}

.section-title {
  font-weight: 700;
  margin-bottom: .5rem;
}
.section-intro {
  max-width: 720px;
  color: #666;
  margin-bottom: 2rem;
}

/* Hero */
/* V4 (Novaspa): bo lop phu toi (overlay) tren anh nen Hero - truoc day dung de chu
   tieu de/nut "Dat lich" de doc hon, nay khong con tieu de/nut nen bo di de anh nen
   hien thi ro, dung mau that. */
.hero-section {
  min-height: 60vh;
  background: url('../img/hero-placeholder.jpg') center/cover no-repeat;
  background-color: #333;
}

/* Services */
/* V9 (Novaspa): dinh dang anh Dich vu co the doi (doc 3:4 / ngang 16:9) qua Admin, giong KTV -
   dung aspect-ratio thay vi height co dinh 220px truoc day (mac dinh 16:9 de gan giong giao dien cu). */
.service-img, .service-img-placeholder {
  width: 100%;
  aspect-ratio: var(--service-aspect-ratio, 16/9);
  height: auto;
  object-fit: cover;
  background: #eee;
}
.how-to-book-box {
  background: #fff8ec;
  border: 1px solid #f0e0bf;
  border-radius: .5rem;
  padding: 1.25rem 1.5rem;
}

/* V9: Promo video ("Quang cao moi nhat") - hien thi ngang hoac doc tuy chinh trong Admin */
.promo-video-wrap {
  width: 100%;
  max-width: 900px;
}
.promo-video-wrap.orientation-vertical {
  max-width: 380px;
}
.promo-video-wrap video {
  width: 100%;
  aspect-ratio: var(--promo-aspect-ratio, 16/9);
  height: auto;
  object-fit: cover;
  background: #000;
  border-radius: .5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}

/* Technicians */
.technician-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: var(--tech-aspect-ratio, 3/4);
  height: auto;
  overflow: hidden;
  background: #eee;
}
.technician-photo, .technician-photo-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s ease-in-out;
}
.technician-photo.active { opacity: 1; }

/* Reviews */
.review-card { border: 1px solid #eee; }

/* V10: "Binh luan moi nhat" - dai cuon ngang tu dong (marquee), tu trai sang phai, moi nhat -> cu */
/* V12: sua loi hien 2 ban sao cung luc khi it binh luan - bo ky thuat "double-track", gio day
   moi binh luan chi render 1 lan, chay 1 luot het man hinh (tu ngoai trai vao, ra ngoai phai) roi
   lap lai tu dau, khong con canh nao co the thay trung 1 binh luan 2 lan cung luc. */
.reviews-marquee-wrap {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
}
.reviews-marquee-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: reviews-marquee-scroll var(--marquee-duration, 30s) linear infinite;
}
.reviews-marquee-wrap:hover .reviews-marquee-track { animation-play-state: paused; }
@keyframes reviews-marquee-scroll {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.review-mini-card {
  flex: 0 0 auto;
  width: 280px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: .75rem;
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.review-mini-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .reviews-marquee-track { animation: none; }
}

/* Recruit / contact */
.contact-method-card {
  border: 1px solid #eee;
  border-radius: .75rem;
  background: #fff;
  transition: box-shadow .2s;
}
.contact-method-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.qr-thumb { width: 110px; height: 110px; object-fit: contain; }
.qr-thumb-sm { width: 60px; height: 60px; object-fit: contain; }

/* Footer */
.site-footer { background: #f7f5f2; }
.footer-contact-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; border: 1px solid #eee; color: var(--site-primary-color);
  font-size: 1.1rem;
}
.footer-links a { color: #555; text-decoration: none; }
.footer-links a:hover { color: var(--site-primary-color); }

/* Floating mobile book button */
.floating-book-btn {
  position: fixed;
  bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--site-primary-color);
  color: #fff; padding: .65rem 1.5rem; border-radius: 50px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  z-index: 1030; text-decoration: none; font-weight: 600;
}

/* Maintenance screen */
.maintenance-screen { min-height: 100vh; padding: 2rem; }

/* ============ Admin ============ */
.admin-topbar { background: #1f2937; }
.admin-layout { display: flex; min-height: calc(100vh - 56px); }
.admin-sidebar {
  width: 240px; flex-shrink: 0; background: #fff; border-right: 1px solid #eee;
  padding: 1rem 0;
}
.admin-sidebar .nav-link { color: #333; padding: .6rem 1.25rem; }
.admin-sidebar .nav-link.active, .admin-sidebar .nav-link:hover { background: #fff8ec; color: var(--site-primary-color); font-weight: 600; }
.admin-content { flex-grow: 1; padding: 1.5rem; background: #f5f6f8; }
.admin-body { margin: 0; }

.stat-card {
  background: #fff; border-radius: .75rem; padding: 1.25rem; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--site-primary-color); }
.stat-label { color: #777; font-size: .9rem; }
.chart-card { background: #fff; border-radius: .75rem; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); }

.form-section { background: #fff; border-radius: .75rem; padding: 1.5rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 1.5rem; }
.preview-thumb { max-width: 120px; max-height: 120px; object-fit: cover; border-radius: .4rem; }
.preview-thumb-sm { width: 50px; height: 50px; object-fit: cover; border-radius: .3rem; }
.album-item { width: 130px; }

.login-card { width: 100%; max-width: 380px; }
.admin-login-body { min-height: 100vh; background: #f5f6f8; }

/* Responsive tweaks */
@media (max-width: 991px) {
  .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #eee; }
  .admin-layout { flex-direction: column; }
}
@media (max-width: 767px) {
  .hero-section { min-height: 50vh; }
}

/* ============ V2 additions ============ */

/* Page-level background wrapper (per-page custom bg from admin) */
#page-wrapper {
  min-height: 40vh;
}

/* Technician card V2: album badge + book-now button */
.album-count-badge {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .75rem;
  padding: .15rem .5rem;
  border-radius: 50px;
}
.technician-slideshow { position: relative; }
.technician-name-link { color: var(--site-text-color); }
.technician-name-link:hover { color: var(--site-primary-color); }
.technician-card .card-body { display: flex; flex-direction: column; }

/* Technician detail page */
.technician-detail-photo {
  width: 100%; max-width: 260px; border-radius: .75rem; object-fit: cover;
  aspect-ratio: var(--tech-aspect-ratio, 3/4);
}
.album-thumb, .album-thumb.video-thumb {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: .5rem;
  background: #222; cursor: pointer; display: block;
}
.album-thumb.video-thumb { background: #111; }
.album-thumb-link { display: block; }
#albumCarousel .carousel-item img,
#albumCarousel .carousel-item video {
  max-height: 75vh; object-fit: contain; background: #000;
}
.review-form-box {
  background: #fff; border: 1px solid #eee; border-radius: .75rem; padding: 1.5rem;
}

/* Booking-by-contact section reuses .contact-method-card (already styled) */


/* ============ V7 additions ============ */

/* Hero banner album slideshow (multi image/video, unrestricted file types) */
.hero-slideshow {
  position: relative;
  width: 100%;
  min-height: 60vh;
  overflow: hidden;
  background: #333;
}
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.hero-slide.active { opacity: 1; z-index: 1; }
/* V4 (Novaspa): da bo .hero-slide-overlay va .hero-content (khong con tieu de/nut
   tren Hero) de anh/video nen hien thi ro rang, khong bi lop toi mau che len. */
.hero-slide-file {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #222; color: #fff; opacity: 0; transition: opacity 1.2s ease-in-out;
  text-decoration: none;
}
.hero-slide-file.active { opacity: 1; z-index: 1; }

/* Service card album slideshow (multi image/video, unrestricted file types) */
/* V9 (Novaspa): dung chung aspect-ratio co the doi qua Admin voi anh dai dien o tren */
.service-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: var(--service-aspect-ratio, 16/9);
  height: auto;
  overflow: hidden;
  background: #eee;
}
.service-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .8s ease-in-out;
}
.service-slide.active { opacity: 1; z-index: 1; }
.service-slide-file {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #333; color: #fff; opacity: 0; transition: opacity .8s ease-in-out;
  text-decoration: none; font-size: .85rem; text-align: center; padding: .5rem;
}
.service-slide-file.active { opacity: 1; z-index: 1; }

/* Admin: album preview supports generic file icon (V7 unrestricted upload) */
.album-item .preview-thumb-file {
  width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;
  background: #f1f1f1; border-radius: .4rem; color: #777; font-size: 2rem;
}
