/* ========================================================
   FACEMAP AI – MÔ PHỎNG HIỆU QUẢ ĐIỀU TRỊ
   Plugin Face AI Retouch Public Stylesheet
   Chuẩn 100% cấu trúc HTML & CSS từ tệp đã tải lên
   Thanh cuộn trình duyệt mượt mà, tối ưu trên mọi kích thước màn hình
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600&display=swap');

:root {
  --blue: #1E6FE0;
  --blue-2: #1E7FE8;
  --pink: #FF2E7E;
  --pink-2: #FF5C9A;
  --pink-soft: #FDE6F1;
  --bg-top: #CFE9FF;
  --bg-mid: #EAF5FF;
  --bg-bot: #DCEEFF;
  --ink: #1E6FE0;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-top: #CFE9FF;
    --bg-mid: #EAF5FF;
    --bg-bot: #DCEEFF;
  }
}

:root[data-theme="dark"] {
  --bg-top: #CFE9FF;
  --bg-mid: #EAF5FF;
  --bg-bot: #DCEEFF;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* Đảm bảo thanh cuộn trình duyệt luôn hiển thị chuẩn mực và mượt mà */
html {
  overflow-y: scroll !important;
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-y: auto !important;
  background: #DCEEFF;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* 1. Tuyệt đối bảo vệ thanh WordPress Admin Bar khi đã đăng nhập */
#wpadminbar {
  display: block !important;
  visibility: visible !important;
  z-index: 99999 !important;
}
html.wp-toolbar {
  padding-top: 32px !important;
  box-sizing: border-box !important;
}
@media screen and (max-width: 782px) {
  html.wp-toolbar {
    padding-top: 46px !important;
  }
}

/* 2. Bảo vệ 100% tất cả các thành phần bên trong khung FACEMAP AI không bao giờ bị ẩn */
#facemap-app,
#facemap-app * {
  box-sizing: border-box !important;
}
#facemap-app .hero,
#facemap-app header.hero,
#facemap-app .hero__kicker,
#facemap-app .hero__title,
#facemap-app .hero__desc,
#facemap-app .features,
#facemap-app .upload,
#facemap-app .upload__zone,
#facemap-app .options,
#facemap-app .opt,
#facemap-app .opt__card,
#facemap-app .opt__face,
#facemap-app .opt__text,
#facemap-app .tag,
#facemap-app #resultBtn,
#facemap-app .compare,
#facemap-app .compare__box,
#facemap-app .note,
#facemap-app footer.note {
  visibility: visible !important;
  opacity: 1 !important;
}
#facemap-app .hero,
#facemap-app header.hero {
  display: block !important;
}
#facemap-app .features {
  display: flex !important;
}
#facemap-app .upload {
  display: flex !important;
}
#facemap-app .options {
  display: flex !important;
}
#facemap-app .tag {
  display: flex !important;
}
#facemap-app .compare {
  display: block !important;
}
#facemap-app .note,
#facemap-app footer.note {
  display: flex !important;
}

/* 3. Chỉ ẩn các khối ngoài của theme WordPress (Twenty Twenty-Five, FSE, Elementor, v.v.) */
.wp-block-template-part,
.wp-block-site-title,
.wp-block-navigation,
.wp-block-post-title,
.wp-block-post-date,
.wp-block-post-author,
.site-header,
.site-footer,
#masthead,
#colophon,
nav.wp-block-navigation,
nav.main-navigation,
header.entry-header,
.entry-title,
.page-title,
.post-title,
h1.entry-title,
h1.page-title,
h1.wp-block-post-title,
.elementor-heading-title,
.elementor-location-header,
.elementor-location-footer,
body > header,
body > footer,
body > nav,
.wp-site-blocks > header,
.wp-site-blocks > footer {
  display: none !important;
}

/* Đặt toàn bộ background thành màu xanh chuẩn #DCEEFF không bị khoảng trắng */
html,
body {
  background: #DCEEFF !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wp-site-blocks,
.wp-site-blocks > .is-layout-constrained,
.entry-content,
.post-content,
article {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  max-width: 100% !important;
}

/* Khung trang trung tâm chuẩn 630px với hình nền đồ họa y hệt tệp tải lên */
.page,
#facemap-app.page {
  max-width: 630px !important;
  margin: 0 auto !important;
  min-height: 100vh;
  padding: 2% 14px 44px;
  position: relative;
  background: url('/wp-content/uploads/2026/10/landing-page-bg.jpg') no-repeat center top / 100% auto, #CFE9FF;
  box-shadow: 0 0 40px rgba(30, 111, 224, 0.12);
  float: none !important;
  box-sizing: border-box !important;
}

/* 1. Header */
.hero,
#facemap-app .hero {
  text-align: center;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.hero__kicker {
  margin: 0;
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 300;
  color: var(--blue);
  line-height: 2;
  display: block !important;
}
.hero__title {
  margin: 0;
  font-size: clamp(42px, 11.5vw, 70px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
  white-space: nowrap;
  background: linear-gradient(180deg, #FF8DB8 0%, #F0306F 55%, #C30F4F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(150, 0, 50, 0.35));
  display: block !important;
}
.hero__desc {
  position: relative;
  margin: clamp(6px, 2vw, 14px) 0 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid #fff;
  border-radius: 6px;
  font-size: clamp(13px, 3.7vw, 23px);
  font-weight: 300;
  line-height: 1.2;
  color: var(--blue);
  display: block !important;
}
.hero__desc i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 3px rgba(30, 111, 224, 0.4);
}
.hero__desc i:nth-child(1) { left: -4px; top: -4px; }
.hero__desc i:nth-child(2) { right: -4px; top: -4px; }
.hero__desc i:nth-child(3) { left: -4px; bottom: -4px; }
.hero__desc i:nth-child(4) { right: -4px; bottom: -4px; }
.hero__desc p {
  margin: 0;
}

/* 2. Features: Upload + 3 Liệu trình */
.features,
#facemap-app .features {
  align-items: center !important;
  display: grid !important;
  grid-template-columns: 46fr 50fr;
  gap: 3.5%;
  margin-top: 24px;
}

.upload,
#facemap-app .upload {
  border-radius: 24px;
  border: 2px solid #CFE3F7;
  background: rgba(255, 255, 255, 0.6);
  padding: 6px;
  display: flex !important;
  min-height: 320px;
}
.upload__zone {
  flex: 1;
  border: 2px dashed #CFE3F7;
  border-radius: 20px;
  background: #F7FBFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  position: relative;
  overflow: hidden;
}
.upload__zone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.upload__zone.has-img img {
  display: block;
}
.upload__zone.has-img .upload__icon {
  display: none;
}
.upload__icon {
  width: 62%;
  max-width: 280px;
  height: auto;
  margin-top: -18%;
}
.upload__btn {
  margin-top: 6%;
  position: relative;
  z-index: 1;
  display: block;
  width: 84%;
  text-align: center;
  cursor: pointer;
  color: #fff;
  font-weight: 300;
  line-height: 1.3;
  padding: 0 8px 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #FF3B85, #FF2E7E);
  box-shadow: 0 3px 8px rgba(255, 46, 126, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.upload__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(255, 46, 126, 0.4);
}
.upload__zone.has-img {
  justify-content: flex-end;
}
.upload__zone.has-img .upload__btn {
  margin: 0 0 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.upload__btn:focus-within {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.upload input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* 3 Liệu trình: Làm đầy lõm hóp / Nâng cơ xoá nhăn / Trẻ hoá nguyên bào toàn diện */
.options,
#facemap-app .options {
  display: flex !important;
  flex-direction: column;
  gap: 3%;
  justify-content: space-between;
}
.opt {
  margin-bottom: 6px;
  flex: 1;
  display: block;
  position: relative;
  cursor: pointer;
}
.opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.opt__card {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4%;
  padding: 6% 5% 9% 4%;
  border-radius: 18px;
  border: 2px solid #fff;
  background: linear-gradient(135deg, #FFF0F7, #FDE1EE);
  box-shadow: 0 2px 6px rgba(255, 46, 126, 0.12);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.opt:hover .opt__card {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(255, 46, 126, 0.22);
}
.opt input:checked + .opt__card {
  border-color: var(--pink);
}
.opt input:focus-visible + .opt__card {
  outline: 3px solid var(--blue);
}
.opt__face {
  flex: 0 0 36%;
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: none;
}
.opt__face::before, .opt__face::after {
  display: none;
}
.opt__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.opt__text {
  font-size: clamp(14px, 3.4vw, 18px);
  font-weight: 300;
  line-height: 1.15;
  color: var(--pink-2);
}
.opt__dot {
  position: absolute;
  left: 8%;
  bottom: 7%;
  width: clamp(12px, 2.6vw, 20px);
  aspect-ratio: 1;
  border: 1.5px solid var(--pink-2);
  border-radius: 50%;
  background: #fff;
}
.opt input:checked + .opt__card .opt__dot {
  background: var(--pink);
  box-shadow: inset 0 0 0 3px #fff;
}

/* 3. Nút bấm Kết quả */
.tag,
#facemap-app .tag {
  display: flex !important;
  justify-content: center;
  margin: 24px auto;
}
.tag button {
  all: unset;
  cursor: pointer;
}
.tag button > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 18px 4px 12px;
  border-radius: 8px;
  border: 2px solid #fff;
  color: #fff;
  background: var(--pink);
  font-size: clamp(18px, 4.6vw, 29px);
  font-weight: 300;
  box-shadow: 0 3px 8px rgba(255, 46, 126, 0.3);
  transition: transform 0.15s ease, background 0.2s ease;
}
#resultBtnLabel,
.tag #resultBtnLabel,
#facemap-app #resultBtnLabel {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  display: inline !important;
  color: inherit !important;
}
.tag button:hover > span {
  background: #e0236e;
}
.tag button:focus-visible > span {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.tag button:active > span {
  transform: translateY(1px);
}
.tag svg {
  width: 0.9em;
  height: 0.9em;
}
.tag button.is-loading > span {
  opacity: 0.85;
}

/* 4. Khối So Sánh Trước / Sau */
.compare,
#facemap-app .compare {
  position: relative;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 1170/715;
  border-radius: 24px;
  border: 3px solid #fff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(30, 111, 224, 0.18);
  background: #ccc;
}
.pane {
  position: relative;
  overflow: hidden;
}
.pane--before {
  background: linear-gradient(180deg, #EEE9F3, #E4E0EA);
}
.pane--after {
  background: linear-gradient(180deg, #B9C3CC, #9FB2C4);
}
.pane img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.badge {
  position: absolute;
  top: 2.5%;
  z-index: 3;
  padding: 1px 14px 3px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 300;
  border: 1.5px solid #fff;
}
.badge--before {
  left: 2.5%;
  background: var(--blue-2);
}
.badge--after {
  right: 2.5%;
  background: var(--pink);
}
.arrow {
  width: 30px !important;
  height: 30px !important;
  position: absolute;
  left: 50%;
  top: 50%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--pink);
  border: 3px solid #fff;
  display: grid;
  place-items: center;
  z-index: 4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.arrow svg {
  width: 55%;
  height: 55%;
}

@media (prefers-reduced-motion: reduce) {
  .opt__card {
    transition: none;
  }
}

/* 5. Khối Lưu ý / Disclaimer */
.note,
#facemap-app .note {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 5px 14px 5px 8px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(90deg, #FF3B85, #FF2E7E);
  font-size: clamp(11px, 2.8vw, 17px);
  font-weight: 300;
  line-height: 1.25;
  visibility: visible !important;
  opacity: 1 !important;
}
.note__icon {
  flex: 0 0 clamp(30px, 7vw, 48px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pink);
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: clamp(18px, 4vw, 28px);
}
.note p {
  margin: 0;
}

/* ========================================================
   6. Tính năng Phóng To Ảnh Trước / Sau (Lightbox Modal)
   ======================================================== */
.pane,
#facemap-app .pane {
  cursor: zoom-in !important;
  transition: filter 0.2s ease !important;
}
.pane:hover,
#facemap-app .pane:hover {
  filter: brightness(1.04) !important;
}
.badge,
#facemap-app .badge,
.arrow,
#facemap-app .arrow {
  pointer-events: none !important;
}

.pane__zoom-hint {
  position: absolute !important;
  bottom: 8px !important;
  right: 8px !important;
  background: rgba(10, 25, 47, 0.7) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  color: #fff !important;
  border-radius: 999px !important;
  padding: 3px 10px !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  opacity: 0 !important;
  transform: translateY(4px) !important;
  transition: opacity 0.2s ease, transform 0.2s ease !important;
  pointer-events: none !important;
  z-index: 5 !important;
}
.pane:hover .pane__zoom-hint {
  opacity: 1 !important;
  transform: translateY(0) !important;
}
.pane__zoom-hint svg {
  width: 12px !important;
  height: 12px !important;
}

#facemap-lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999999 !important;
  background: rgba(10, 25, 47, 0.88) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.22s ease;
  box-sizing: border-box;
}
#facemap-lightbox.is-open {
  display: flex !important;
  opacity: 1 !important;
}

.facemap-lightbox__card {
  position: relative;
  max-width: 94vw;
  max-height: 92vh;
  width: 780px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  animation: facemapLightboxPop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes facemapLightboxPop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.facemap-lightbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f8fbff;
  border-bottom: 1px solid #e3effa;
  gap: 12px;
}

.facemap-lightbox__tabs {
  display: flex;
  gap: 6px;
  background: #e5f1fc;
  padding: 4px;
  border-radius: 999px;
}
.facemap-lightbox__tab {
  all: unset;
  cursor: pointer;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  transition: all 0.2s ease;
}
.facemap-lightbox__tab:hover {
  color: #0b50b3;
}
.facemap-lightbox__tab.is-active-before {
  background: var(--blue-2) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(30, 127, 232, 0.35);
}
.facemap-lightbox__tab.is-active-after {
  background: var(--pink) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(255, 46, 126, 0.35);
}

.facemap-lightbox__close {
  all: unset;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef4fb;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  color: #4a6382;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.facemap-lightbox__close:hover {
  background: #ff2e7e;
  color: #fff;
  transform: rotate(90deg);
}

.facemap-lightbox__body {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0f172a;
  width: 100%;
  height: 68vh;
  max-height: 640px;
  overflow: hidden;
  user-select: none;
}
.facemap-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
