@font-face {
  font-family: "UTM Swiss";
  src:
    local("UTM Swiss"),
    url("assets/fonts/UTM Swiss.ttf") format("truetype");
}

@font-face {
  font-family: "yellowtail";
  src:
    local("LNTH Yellowtail"),
    url(assets/fonts/lnth-yellowtail.TTF) format("truetype");
}

@font-face {
  font-family: "SVN-Anastasia";
  src:
    local("SVN Anastasia"),
    url(assets/fonts/SVN-ANASTASIA.TTF) format("truetype");
}

@font-face {
  font-family: "UTM American Sans";
  src:
    local("UTM American Sans"),
    url("assets/fonts/UTM American Sans.ttf") format("truetype");
}

@font-face {
  font-family: "SVN Product Sans";
  src:
    local("SVN Product Sans"),
    url("assets/fonts/SVN-Product Sans Regular.otf") format("opentype");
}

.main-wrapper {
  background-image: url(assets/bg.png);
  position: relative;
  z-index: 1;
  min-height: 894px;
  background-position: top center; /* căn giữa theo chiều ngang */
  background-size: cover;
  background-repeat: no-repeat;
  /* ThÃªm GPU acceleration */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.modal {
  display: none;
  position: fixed;
  z-index: 50;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: #000;
  background-color: rgb(0 0 0 / 0.4);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 600px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: 700;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

label {
  font-family: "UTM Swiss";
}

label span {
  border: 2px solid #fff0;
  position: relative;
  padding: 2px 10px;
  background-clip: padding-box;
  box-sizing: border-box;
  width: fit-content;
  background-color: #422edf;
  border-radius: 8px;
}

label span:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: -2px;
  background: linear-gradient(90deg, #422edf, #2872fb 60%);
  border-radius: inherit;
}

.gradient-border-wrapper {
  position: relative;
  display: inline-block;
  border-radius: 8px;
  padding: 2px;
  background: linear-gradient(90deg, #422edf, #2872fb 60%);
}

.gradient-border {
  position: relative;
  z-index: 1;
  border: none;
  padding: 10px;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

.gradient-border-wrapper textarea.gradient-border,
.gradient-border-wrapper input.gradient-border {
  display: block;
  width: 100%;
  margin: 0;
}

.frame-wrapper {
  position: relative;
  height: fit-content;
  position: relative;
  width: 100%;
  max-width: 3624px;
  margin: 0 auto;
}

.design-canvas {
  position: relative;
  width: 3624px;
  aspect-ratio: 3624 / 1910;
  transform-origin: top left;
}

@media (max-width: 600px) {
  .design-canvas {
    transform: scale(calc(100vw / 3624));
  }
}

.image-choosen {
  position: absolute;
  left: 9.46%;
  top: 33.18%;
  width: 19.05%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  z-index: -1;
}

.name {
  position: absolute;
  left: 4.22%;
  top: 70.48%;
  width: 29.68%;
  height: 10.23%;
  text-align: center;
  vertical-align: middle;
  padding: 6px 2px;
  font-family: "SVN-Anastasia";
  color: #fff;
}

.title {
  position: absolute;
  left: 5.79%;
  top: 79.55%;
  width: 26.57%;
  height: 8.21%;
  text-align: center;
  vertical-align: middle;
  padding: 2px 10px;
  color: #1e00ff;
  font-family: "SVN Product Sans";
}

.unit {
  position: absolute;
  left: 5.89%;
  top: 90.35%;
  width: 25.3%;
  height: 7.64%;
  text-align: center;
  vertical-align: middle;
  padding: 6px 2px;
  font-family: "SVN-Anastasia";
  color: #1e00ff;
}

.message {
  position: absolute;
  left: 37.5%;
  top: 41.26%;
  width: 59.16%;
  height: 40.75%;
  font-family: "SVN Product Sans";
  line-height: 1.3;
  color: #fff;
  text-align: justify;
}

:root {
  --scale: 1;
}

.name {
  font-size: 18px;
}
.title {
  font-size: 10px;
}
.unit {
  font-size: 10.5px;
}
.message {
  font-size: 16px;
}

body.mobile .name {
  font-size: calc(18px * var(--scale));
}
body.mobile .title {
  font-size: calc(10px * var(--scale));
}
body.mobile .unit {
  font-size: calc(10.5px * var(--scale));
}
body.mobile .message {
  font-size: calc(16px * var(--scale));
}

.no-resize {
  resize: none !important; /* !important để đảm bảo không bị ghi đè */
  overflow: auto; /* giữ cuộn nếu nội dung quá dài */
}

.textarea-wrapper {
  position: relative; /* cần relative để counter absolute dựa vào */
  width: 100%;
}

.gradient-border-wrapper.textarea-wrapper {
  padding-bottom: 20px; /* để chừa chỗ cho counter bên trong */
}

.inside-counter {
  position: absolute;
  bottom: 1px;
  right: 8px;
  font-family: "SVN Product Sans";
  font-size: 12px;
  color: #ffffff; /* mặc định */
  pointer-events: none;
}

.inside-counter.near-limit {
  color: #ff0000;
  font-weight: bold;
}

.name,
.title,
.unit .message {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  text-overflow: ellipsis;
}

.message {
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  text-overflow: ellipsis;
}

.loader-wrapper {
  background: rgb(0 0 0 / 0.4);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader {
  font-size: 10px;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  position: relative;
  text-indent: -9999em;
  animation: mulShdSpin 1.1s infinite ease;
  transform: translateZ(0);
}

@keyframes mulShdSpin {
  0%,
  100% {
    box-shadow:
      0em -2.6em 0em 0em #ffffff,
      1.8em -1.8em 0 0em rgb(255 255 255 / 0.2),
      2.5em 0em 0 0em rgb(255 255 255 / 0.2),
      1.75em 1.75em 0 0em rgb(255 255 255 / 0.2),
      0em 2.5em 0 0em rgb(255 255 255 / 0.2),
      -1.8em 1.8em 0 0em rgb(255 255 255 / 0.2),
      -2.6em 0em 0 0em rgb(255 255 255 / 0.5),
      -1.8em -1.8em 0 0em rgb(255 255 255 / 0.7);
  }

  12.5% {
    box-shadow:
      0em -2.6em 0em 0em rgb(255 255 255 / 0.7),
      1.8em -1.8em 0 0em #ffffff,
      2.5em 0em 0 0em rgb(255 255 255 / 0.2),
      1.75em 1.75em 0 0em rgb(255 255 255 / 0.2),
      0em 2.5em 0 0em rgb(255 255 255 / 0.2),
      -1.8em 1.8em 0 0em rgb(255 255 255 / 0.2),
      -2.6em 0em 0 0em rgb(255 255 255 / 0.2),
      -1.8em -1.8em 0 0em rgb(255 255 255 / 0.5);
  }

  25% {
    box-shadow:
      0em -2.6em 0em 0em rgb(255 255 255 / 0.5),
      1.8em -1.8em 0 0em rgb(255 255 255 / 0.7),
      2.5em 0em 0 0em #ffffff,
      1.75em 1.75em 0 0em rgb(255 255 255 / 0.2),
      0em 2.5em 0 0em rgb(255 255 255 / 0.2),
      -1.8em 1.8em 0 0em rgb(255 255 255 / 0.2),
      -2.6em 0em 0 0em rgb(255 255 255 / 0.2),
      -1.8em -1.8em 0 0em rgb(255 255 255 / 0.2);
  }

  37.5% {
    box-shadow:
      0em -2.6em 0em 0em rgb(255 255 255 / 0.2),
      1.8em -1.8em 0 0em rgb(255 255 255 / 0.5),
      2.5em 0em 0 0em rgb(255 255 255 / 0.7),
      1.75em 1.75em 0 0em #ffffff,
      0em 2.5em 0 0em rgb(255 255 255 / 0.2),
      -1.8em 1.8em 0 0em rgb(255 255 255 / 0.2),
      -2.6em 0em 0 0em rgb(255 255 255 / 0.2),
      -1.8em -1.8em 0 0em rgb(255 255 255 / 0.2);
  }

  50% {
    box-shadow:
      0em -2.6em 0em 0em rgb(255 255 255 / 0.2),
      1.8em -1.8em 0 0em rgb(255 255 255 / 0.2),
      2.5em 0em 0 0em rgb(255 255 255 / 0.5),
      1.75em 1.75em 0 0em rgb(255 255 255 / 0.7),
      0em 2.5em 0 0em #ffffff,
      -1.8em 1.8em 0 0em rgb(255 255 255 / 0.2),
      -2.6em 0em 0 0em rgb(255 255 255 / 0.2),
      -1.8em -1.8em 0 0em rgb(255 255 255 / 0.2);
  }

  62.5% {
    box-shadow:
      0em -2.6em 0em 0em rgb(255 255 255 / 0.2),
      1.8em -1.8em 0 0em rgb(255 255 255 / 0.2),
      2.5em 0em 0 0em rgb(255 255 255 / 0.2),
      1.75em 1.75em 0 0em rgb(255 255 255 / 0.5),
      0em 2.5em 0 0em rgb(255 255 255 / 0.7),
      -1.8em 1.8em 0 0em #ffffff,
      -2.6em 0em 0 0em rgb(255 255 255 / 0.2),
      -1.8em -1.8em 0 0em rgb(255 255 255 / 0.2);
  }

  75% {
    box-shadow:
      0em -2.6em 0em 0em rgb(255 255 255 / 0.2),
      1.8em -1.8em 0 0em rgb(255 255 255 / 0.2),
      2.5em 0em 0 0em rgb(255 255 255 / 0.2),
      1.75em 1.75em 0 0em rgb(255 255 255 / 0.2),
      0em 2.5em 0 0em rgb(255 255 255 / 0.5),
      -1.8em 1.8em 0 0em rgb(255 255 255 / 0.7),
      -2.6em 0em 0 0em #ffffff,
      -1.8em -1.8em 0 0em rgb(255 255 255 / 0.2);
  }

  87.5% {
    box-shadow:
      0em -2.6em 0em 0em rgb(255 255 255 / 0.2),
      1.8em -1.8em 0 0em rgb(255 255 255 / 0.2),
      2.5em 0em 0 0em rgb(255 255 255 / 0.2),
      1.75em 1.75em 0 0em rgb(255 255 255 / 0.2),
      0em 2.5em 0 0em rgb(255 255 255 / 0.2),
      -1.8em 1.8em 0 0em rgb(255 255 255 / 0.5),
      -2.6em 0em 0 0em rgb(255 255 255 / 0.7),
      -1.8em -1.8em 0 0em #fff;
  }
}

@media only screen and (max-width: 600px) {
  .main-wrapper {
    background: linear-gradient(
      60deg,
      #1e00ff 0%,
      #006aff 28%,
      #006aff 37.15%,
      #2b00ff 47.42%,
      #120194 100%
    );
    min-height: auto;
    background-size: contain;
    background-position: top -10px left 0;
    background-repeat: repeat-y;
  }
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: rgba(255, 255, 255, 0);
  padding: 5px;
  border-radius: 8px;
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
}

.popup-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==== SUCCESS POPUP ==== */
.success-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.success-popup-content {
  background: #fff;
  padding: 25px 35px;
  border-radius: 12px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  font-family: "SVN Product Sans";
}

.success-title {
  font-size: 20px;
  font-weight: bold;
  color: #422edf;
}

.success-subtitle {
  margin-top: 10px;
  font-size: 13px;
  color: #555;
}

.success-code-box {
  margin: 15px auto;
  padding: 12px;
  border: 2px solid #ff0000;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  position: relative;
  padding-right: 48px; /* tạo khoảng cho nút copy nằm bên trong */
}

/* Nếu dùng icon từ assets/icons */
.copy-btn img {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

#success-code {
  font-size: 26px;
  font-weight: 700;
  color: #ff0000;
  font-family: "SVN Product Sans";
  max-width: 200px;
  display: inline-block;
  transition: font-size 0.2s;
}

.copy-btn {
  background: #ff0000;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-note {
  font-size: 12px;
  margin-top: 10px;
  color: #666;
  text-align: center;
}

.success-btn-wrapper {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.btn-view,
.btn-reload {
  flex: 1; /* mỗi nút chiếm 50% */
  text-align: center;
  padding: 12px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.btn-view {
  background: #4c6ef5;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
}

.btn-reload {
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Font auto scale khi mã dài */
.shrink-font {
  font-size: 18px !important;
}

/* ==== Modern, Minimal & Subtle Scrollbar ==== */

/* Toàn bộ scrollbar */
::-webkit-scrollbar {
  width: 8px; /* Chiều rộng scrollbar dọc */
  height: 8px; /* Chiều cao scrollbar ngang */
  background: transparent; /* Nền trong suốt */
}

/* Track (nền của scrollbar) */
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05); /* Mờ nhẹ, nhìn subtle */
  border-radius: 8px;
}

/* Thumb (phần kéo được) */
::-webkit-scrollbar-thumb {
  background-color: #4c6ef5; /* Màu xanh mờ, dịu mắt */
  border-radius: 8px;
  transition:
    background-color 0.3s ease,
    opacity 0.3s ease;
}

/* Thumb hover */
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 105, 146, 0.6); /* Đậm hơn khi hover */
}

/* Ẩn mũi tên trên scrollbar */
::-webkit-scrollbar-button {
  display: none;
}

/* Tooltip căn bên phải nút, ẩn mặc định */
.button-contact .tooltip {
  position: absolute;
  top: 50%;
  right: 100%; /* ngay sát cạnh trái nút */
  transform: translateY(-50%) translateX(20%); /* trượt vào trong */
  background-color: rgb(44, 159, 216);
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  white-space: nowrap;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  user-select: none;
}

/* Hiện tooltip khi hover nút */
.button-contact:hover .tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* Tooltip màu đỏ cho nút admin */
#admin-vr .tooltip {
  background-color: rgb(216, 44, 44);
  box-shadow: 0 2px 6px rgba(216, 44, 44, 0.6);
}

#admin-vr .tooltip::before {
  border-color: transparent transparent transparent rgb(216, 44, 44);
}

@media (max-width: 768px) {
  #admin-vr,
  #frame-vr {
    display: none !important;
  }
}

.name,
.title,
.unit,
.message {
  box-sizing: border-box;
  overflow: hidden;
}
