@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: #0049c6;
  border-radius: 8px;
}

label span:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: -2px;
  background: linear-gradient(
    90deg,
    #3060aa 0%,
    #287dbd 28%,
    #2194cc 37.15%,
    #1aacdb 47.42%,
    #13c5eb 100%
  );
  border-radius: inherit;
}

.gradient-border-wrapper {
  position: relative;
  display: inline-block;
  border-radius: 8px;
  padding: 2px;
  background: linear-gradient(
    90deg,
    #3060aa 0%,
    #287dbd 28%,
    #2194cc 37.15%,
    #1aacdb 47.42%,
    #13c5eb 100%
  );
}

.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;
}

.image-choosen {
  width: 151px;
  height: 151px;
  position: absolute;
  left: 76px;
  top: 141px;
  z-index: -1;
}

.name {
  position: absolute;
  left: 60px;
  bottom: 88px;
  width: 186px;
  height: 35px;
  text-align: center;
  vertical-align: middle;
  padding: 6px 2px;
  font-family: "SVN-Anastasia";
  font-size: 18px;
  color: #fff;
}

.title {
  position: absolute;
  text-align: center;
  left: 55px;
  bottom: 52px;
  width: 192px;
  height: 34px;
  vertical-align: middle;
  padding: 2px 10px;
  color: #0049c6;
  font-size: 10px;
  font-family: "SVN Product Sans";
}

.unit {
  position: absolute;
  left: 49px;
  bottom: 13px;
  width: 210px;
  height: 35px;
  text-align: center;
  vertical-align: middle;
  padding: 6px 2px;
  font-family: "SVN-Anastasia";
  font-size: 10.5px;
  color: #ffffff;
}

.message {
  position: absolute;
  left: 305px;
  bottom: 80px;
  width: 457px;
  height: 164px;
  font-family: "SVN Product Sans";
  font-size: 16px;
  line-height: 1.3;
  color: #0049c6;
  text-align: justify;
}

.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: #2b3990;
  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,
      #3060aa 0%,
      #287dbd 28%,
      #2194cc 37.15%,
      #1aacdb 47.42%,
      #13c5eb 100%
    );
    min-height: auto;
    background-size: contain;
    background-position: top -10px left 0;
    background-repeat: repeat-y;
  }

  .image-choosen {
    width: 66px;
    height: 66px;
    left: 33px;
    top: 62px;
  }

  .name {
    left: 27px;
    bottom: 38px;
    width: 80px;
    height: 16px;
    font-size: 8px;
    padding: 3px 2px;
  }

  .title {
    left: 23px;
    bottom: 22px;
    width: 85px;
    height: 15px;
    font-size: 4px;
    padding: 1px 2px;
  }

  .unit {
    left: 18px;
    bottom: 4.5px;
    width: 100px;
    height: 16px;
    font-size: 4.5px;
    padding: 3px 2px;
  }

  .message {
    left: 133px;
    bottom: 26px;
    width: 200px;
    height: 80px;
    font-size: 7px;
  }
}

.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: #2b3990;
}

.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: #0049c6; /* 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: #0049c699; /* Đậ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: #0049c6;
  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);
}
