/* Reset mặc định */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
* {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Body */
body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  line-height: 1.6;
  min-width: 1024px;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* Menu chính */
.menu {
  background-color: #333;
  padding: 0px 0;
}

/* Danh sách menu chính */
.main-menu {
  list-style: none;
  display: flex;
  justify-content: center;
}

/* Mỗi mục menu chính */
.main-menu > li {
  position: relative;
  margin: 0 20px;
}

/* Liên kết trong menu */
.main-menu a {
  cursor: pointer;
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  display: block;
  transition: color 0.3s ease, text-shadow 0.3s ease; /* Cập nhật transition cho hiệu ứng mượt mà */
}

/* Hiệu ứng khi hover vào menu chính */
.main-menu a:hover,
.main-menu > li.has-submenu:has(> .submenu:hover) > a {
  color: #00FFAA;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.7); /* Hiệu ứng phát sáng */
}
/* Add to .submenu */
.submenu {
  /* ... existing styles ... */
  transition: all 0.3s ease-out; /* Add this line */
  visibility: hidden; /* Hide by default */
  opacity: 0; /* Start fully transparent */
  transform: translateY(10px); /* Start slightly below */
  position: absolute; /* Needed for positioning */
  top: 100%; /* Position below the parent */
  left: 0; /* Align left */
  min-width: 180px; /* Ensure a decent width */
  background-color: #333; /* Đồng bộ với menu chính */
  border-radius: 0px; /* Rounded corners at the bottom */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Subtle shadow */
  z-index: 1001; /* Tăng z-index cao hơn filter-menu */
  list-style: none;
}

/* Show submenu when parent has-submenu is hovered */
.has-submenu:hover > .submenu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* Styles for nested submenus (optional, if you have more levels) */
.submenu .has-submenu .submenu {
  left: 100%; /* Position next to the parent submenu item */
  top: 0; /* Align with the parent submenu item */
  border-radius: 0px; /* Adjust as needed */
}

/* Ngăn văn bản trong submenu xuống dòng */
.submenu a {
  white-space: nowrap;
}

/* Modify .main-menu a */
.main-menu a {
  /* ... existing styles ... */
  position: relative; /* Needed for pseudo-element positioning */
  overflow: hidden; /* Hide overflow of the pseudo-element */
}

.main-menu a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #00FFAA; /* Color of the underline */
  transform: scaleX(0); /* Start with no width */
  transform-origin: bottom right; /* Grow from right to left initially */
  transition: transform 0.3s ease-out; /* Animate the transform */
}

.main-menu a:hover::before {
  transform: scaleX(1); /* Expand to full width on hover */
  transform-origin: bottom left; /* Grow from left to right on hover */
}


/* Nội dung chính - full chiều rộng, nền đồng bộ với trang */
.content {
  width: 100%;
  padding: 40px 10px;
  flex: 1 0 auto;
}

/* Bảng */
.table-container {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  overflow-x: auto;
  /* background: #fff; */
  padding-left: 16px;
  padding-right: 16px;
}

/* Bảng - End */

/* Hiệu ứng preview ảnh*/
  @keyframes zoomIn {
    from {
      transform: scale(0.5);
      opacity: 0;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }

  #imageModal img {
    animation: zoomIn 0.5s ease;
  }
  
  .zoom-btn {
  background-color: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 6px 12px;
  font-size: 24px;
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background-color 0.2s ease;
}

.zoom-btn:hover {
  background-color: rgba(255,255,255,0.4);
}

.modal-close {
  font-size: 40px;
  color: white;
  cursor: pointer;
  padding: 0 10px;
  line-height: 1;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #ff8888;
}

.modal-control {
  font-size: 28px;
  font-weight: bold;
  background-color: transparent;
  color: white;
  border: 2px solid white;
  border-radius: 8px;
  padding: 2px 10px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.modal-control:hover {
  background-color: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

  /* Hiệu ứng preview ảnh - End*/
  
  /* Tôi ưu Mobile - End*/
@media (max-width: 768px) {
  .wrapper {
    min-height: 110dvh; /* dvh là viewport height thực tế, tốt hơn cho mobile */
  }
  #videoEnter {
    width: 100dvw;
    height: 100dvh;
    object-fit: cover;
  }
  .excel-style-table th,
  .excel-style-table td {
    width: auto !important;
    white-space: nowrap;
	font-size: 14px;
  }

  .excel-style-table th:nth-child(4),
  .excel-style-table td:nth-child(4),
  .excel-style-table th:nth-child(5),
  .excel-style-table td:nth-child(5) {
    white-space: normal;
    word-wrap: break-word;
  }
}

.excel-style-table td:nth-child(3),
.excel-style-table th:nth-child(3) {
  word-wrap: break-word;
  white-space: normal;
}
  /* Tôi ưu Mobile - End*/
  
  /*Footer*/
.site-footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 10px 0px;
  font-size: 16px;
  position: relative;
  bottom: 0;
  width: 100%;
}
  /*Footer - End*/
  
  /*Đinh Nghĩa Phông Chữ*/
@font-face {
  font-family: 'Fz002';
  src: url("../fonts/Fz002.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'FzCoTrang';
  src: url("../fonts/FzCoTrang.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'fzssksj_z';
  src: url("../fonts/fzssksj_z.woff2") format("woff2"),
       url("../fonts/fzssksj_z.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

.fz002 {
  font-family: 'Fz002', sans-serif;
}

.fzcotrang {
  font-family: 'FzCoTrang', sans-serif;
}

.chinese-font {
  font-family: 'fzssksj_z', sans-serif;
  font-size: 18px !important;
}

/* Video Trang Chủ*/
html, body {
  height: 100%;
  scroll-behavior: smooth;
}

#video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
  pointer-events: none; /* Tránh video che mất các phần tử tương tác */
}
  /*Video Trang Chủ - End*/
  
.image-container {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 auto;
}

.tooltip-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.tooltip-content {
  opacity: 1;
  position: absolute;
  background-color: #222;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  width: max-content;
  max-width: 700px;
  visibility: hidden;
  /* transition: none; */
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  pointer-events: none;
  text-align: left;
}

.important-point {
	background-color: rgba(255, 215, 0, 0.3);
    border: 2px solid gold;
}

/* Default position (top) */
.tooltip-content {
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
}

/* Position for tooltips below point */
.tooltip-point[data-position="bot"] .tooltip-content {
  bottom: auto;
  top: 130%;
  transform: translateX(-50%) translateY(10px);
}

/* Position for tooltips near left edge */
.tooltip-point[data-position="left"] .tooltip-content {
  left: auto;
  right: 130%;
  bottom: 50%;
  transform: translateY(50%) translateX(-10px);
}

/* Position for tooltips near right edge */
.tooltip-point[data-position="right"] .tooltip-content {
  left: 130%;
  bottom: 50%;
  transform: translateY(50%) translateX(10px);
}

/* Arrow positions */
.tooltip-content::before {
  content: '';
  position: absolute;
  border: 6px solid transparent;
}

/* Default arrow (top) */
.tooltip-content::before {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: rgba(51, 51, 51, 0.95);
}

/* Arrow for bottom position */
.tooltip-point[data-position="bot"] .tooltip-content::before {
  bottom: auto;
  top: -6px;
  border-top-color: transparent;
  border-bottom-color: rgba(51, 51, 51, 0.95);
}

/* Arrow for left position */
.tooltip-point[data-position="left"] .tooltip-content::before {
  bottom: auto;
  left: auto;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-left-color: rgba(51, 51, 51, 0.95);
}

/* Arrow for right position */
.tooltip-point[data-position="right"] .tooltip-content::before {
  bottom: auto;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: rgba(51, 51, 51, 0.95);
}

.tooltip-point:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Transform adjustments for different positions */
.tooltip-point[data-position="bot"]:hover .tooltip-content {
  transform: translateX(-50%) translateY(0);
}

.tooltip-point[data-position="left"]:hover .tooltip-content {
  transform: translateY(50%) translateX(0);
}

.tooltip-point[data-position="right"]:hover .tooltip-content {
  transform: translateY(50%) translateX(0);
}

.tooltip-content p {
  margin: 0 0 8px 0;
}

.tooltip-content p:last-child {
  margin-bottom: 0;
}

.tooltip-content b {
  color: #00FFAA;
  font-weight: 600;
}

.tooltip-content i {
  color: #FFD700;
  font-style: italic;
}

.tooltip-section {
  display: block;
  cursor: move;
  position: relative;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
}

.tooltip-section:not(.active) {
  display: none;
}

.tooltip-section.dragging {
  opacity: 0.5;
  border: 1px dashed #00FFAA;
  background-color: rgba(0, 255, 170, 0.1);
}

.tooltip-section .drag-handle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background-color: rgba(0, 255, 170, 0.2);
  border-radius: 4px;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tooltip-section:hover .drag-handle {
  opacity: 1;
}

.tooltip-section .drag-handle::before {
  content: '⋮';
  color: #00FFAA;
  font-size: 14px;
  line-height: 1;
}

/* Add section navigation buttons */
.section-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.section-nav button {
  background-color: rgba(0, 255, 170, 0.2);
  border: 1px solid #00FFAA;
  color: #00FFAA;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.section-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

table img {
  transition: transform 1s cubic-bezier(.25,.8,.25,1);
}

table img:hover {
  transform: scale(1.12);
}

/* Scrollbar cho vùng nhập section-content */
.section-content::-webkit-scrollbar {
  width: 10px;
  background: #e3f0ff;
  border-radius: 8px;
}
.section-content::-webkit-scrollbar-thumb {
  background: #1976d2;
  border-radius: 8px;
}
.section-content::-webkit-scrollbar-thumb:hover {
  background: #1251a3;
}
.section-content {
  scrollbar-width: thin;
  scrollbar-color: #1976d2 #e3f0ff;
}

/* Scrollbar cho vùng nhập marker-html-area */
.marker-html-area::-webkit-scrollbar {
  width: 10px;
  background: #e3f0ff;
  border-radius: 8px;
}
.marker-html-area::-webkit-scrollbar-thumb {
  background: #1976d2;
  border-radius: 8px;
}
.marker-html-area::-webkit-scrollbar-thumb:hover {
  background: #1251a3;
}
.marker-html-area {
  scrollbar-width: thin;
  scrollbar-color: #1976d2 #e3f0ff;
}

/* --- MODERN TOOLTIP EDITOR STYLE (DARKER, SOFT) --- */
#marker-toolbar button,
.section-toolbar button {
  background: #232f3e;
  color: #e3f0ff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.08em;
  padding: 0.45em 1.2em;
  margin-right: 0.2em;
  box-shadow: 0 2px 8px rgba(25,118,210,0.08);
  transition: background 0.22s, color 0.22s, transform 0.15s;
  outline: none;
}
#marker-toolbar button:hover,
.section-toolbar button:hover {
  background: #1976d2;
  color: #fff;
  transform: translateY(-2px) scale(1.09);
  box-shadow: 0 4px 16px rgba(25,118,210,0.18);
}
#marker-toolbar button:active,
.section-toolbar button:active {
  background: #1251a3;
  color: #fff;
  transform: scale(0.97);
}

#marker-toolbar label,
.section-toolbar label {
  font-size: 1em;
  color: #e3f0ff;
  margin-left: 0.7em;
  margin-right: 0.2em;
  display: flex;
  align-items: center;
  gap: 0.3em;
}
#marker-toolbar input[type="color"],
.section-toolbar input[type="color"] {
  width: 2em;
  height: 2em;
  border: 2px solid #1976d2;
  border-radius: 7px;
  background: #232f3e;
  cursor: pointer;
  margin-left: 0.2em;
  transition: border 0.2s;
}
#marker-toolbar input[type="color"]:hover,
.section-toolbar input[type="color"]:hover {
  border: 2px solid #00bfff;
}
#marker-toolbar select,
.section-toolbar select {
  font-size: 1em;
  border-radius: 7px;
  border: 1.5px solid #1976d2;
  background: #232f3e;
  color: #e3f0ff;
  padding: 0.4em 1.2em 0.4em 0.7em;
  margin-left: 0.5em;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
}
#marker-toolbar select:focus,
.section-toolbar select:focus {
  border: 1.5px solid #00bfff;
  box-shadow: 0 0 0 2px #1976d2;
}

#marker-toolbar button#marker-insert-img-btn,
.section-toolbar button.section-insert-img-btn {
  background: #232f3e;
  color: #e3f0ff;
  border: 1.5px solid #1976d2;
  border-radius: 10px;
  font-size: 1.08em;
  padding: 0.45em 1.2em;
  margin-left: 0.7em;
  transition: background 0.22s, color 0.22s, border 0.22s, transform 0.15s;
}
#marker-toolbar button#marker-insert-img-btn:hover,
.section-toolbar button.section-insert-img-btn:hover {
  background: #1976d2;
  color: #fff;
  border: 1.5px solid #00bfff;
  transform: translateY(-2px) scale(1.09);
}

#marker-html-area,
.section-content {
  border: 2.5px solid #1976d2;
  border-radius: 16px;
  background: #232f3e;
  color: #e3f0ff;
  font-size: 1.13vw;
  font-family: 'Segoe UI', Arial, sans-serif;
  padding: 1.2vw;
  min-height: 180px;
  max-height: 65vh;
  height: 45vh;
  outline: none;
  box-shadow: 0 4px 18px rgba(25,118,210,0.10);
  margin-bottom: 2vh;
  resize: both;
  transition: border 0.22s, box-shadow 0.22s, background 0.22s;
}
#marker-html-area:focus,
.section-content:focus {
  border: 2.5px solid #00bfff;
  box-shadow: 0 0 0 2px #1976d2;
  background: #1a2330;
}

#marker-html-popup,
#multi-section-editor-popup {
  background: #1a2330;
  border: 2.5px solid #1976d2;
  border-radius: 26px;
  box-shadow: 0 12px 48px 0 rgba(25,118,210,0.22),0 4px 24px rgba(0,0,0,0.18);
  /* animation: popupAppearDark 0.48s cubic-bezier(.33,1,.68,1); */
}

#copy-marker-html, #close-marker-html,
#generate-multi-html-btn, #close-multi-editor-btn {
  background: #1976d2;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.1em;
  padding: 0.8vw 2vw;
  margin-left: 0.7em;
  transition: background 0.22s, color 0.22s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(25,118,210,0.09);
}
#copy-marker-html:hover, #close-marker-html:hover,
#generate-multi-html-btn:hover, #close-multi-editor-btn:hover {
  background: #00bfff;
  color: #232f3e;
  transform: translateY(-2px) scale(1.06);
}
/* --- END MODERN TOOLTIP EDITOR STYLE --- */

/* Accordion Table Styles */
.accordion-table th, .accordion-table td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
  position: relative;
  font-size: 16px !important;
}
.accordion-table th {
  background: #00FF55;
  font-weight: bold;
}
.expand-btn {
  cursor: pointer;
  font-size: 16px;
  border: none;
  background: #eee;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  line-height: 26px;
  padding: 0;
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;

  /* ✅ Shadow nổi bật hơn một chút */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);

  /* ✅ Thêm hiệu ứng chuyển động mượt */
  transition: background 0.3s ease, transform 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ✅ Hover luôn hoạt động kể cả không nằm trong .accordion-table */
.expand-btn:hover {
  /* ✅ Thêm animation phóng nhẹ khi hover */
  transform: scale(1.15);
}

.accordion-table .expand-row td { background: #fff; }
/* .accordion-table .expand-row { background: #f3f9ff; } */
.accordion-table .expand-row td { color: #000000; padding: 0; }
.accordion-table .main-row td { background: #fff; }
.accordion-table .expand-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(.4,0,.2,1), opacity 0.3s cubic-bezier(.4,0,.2,1);
  padding: 0 10px;
}
.accordion-table .expand-row.show .expand-content {
  max-height: 200px;
  opacity: 1;
  padding: 10px;
  transition: max-height 0.35s cubic-bezier(.4,0,.2,1), opacity 0.3s cubic-bezier(.4,0,.2,1), padding 0.2s;
}

.accordion-table {
  border-collapse: collapse;
}

.accordion-table .main-row td, .accordion-table .expand-row td { background: #fff; }

.accordion-table tbody tr td { background: #fff !important; }

.accordion-table tr,
.accordion-table tr td,
.accordion-table tbody tr,
.accordion-table tbody tr td,
.accordion-table tr[style],
.accordion-table tr[style] td,
.accordion-table td > * {
  background: #fff !important;
  background-color: #fff !important;
}

.accordion-table,
.accordion-table tbody {
  background: #fff !important;
  background-color: #fff !important;
}

.accordion-table tr[style*="display: none"] td {
  border: none !important;
}


.custom-dropdown {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}
.custom-dropdown-selected {
  border: 2px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 44px;
  transition: border-color 0.3s;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.custom-dropdown-selected:focus, .custom-dropdown-selected.active {
  border-color: #00FF55;
  outline: none;
}
.custom-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 100;
  max-height: 80vh !important;
  overflow-y: auto;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: #b0b0b0 #f0f0f0;
}
.custom-dropdown-list.show {
  display: block;
}
.custom-dropdown-option {
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 16px;
  transition: background 0.2s;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.custom-dropdown-option:hover, .custom-dropdown-option.active {
  background: #e6fff2;
}
.custom-dropdown-option img,
.custom-dropdown-selected img {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 4px;
  object-fit: contain;
  /* background: #f4f4f4; */
}

.custom-dropdown-selected img {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 4px;
  object-fit: contain;
  /* background: #f4f4f4; */
}

.phai-converter {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}
.converter-title {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 24px;
  font-weight: bold;
}
.input-group {
  margin-bottom: 20px;
}
.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #555;
}
.convert-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #00FF55, #00CC44);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
  margin-bottom: 20px;
}
.convert-btn:hover {
  transform: translateY(-2px);
}
.result-container {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 20px;
  margin-top: 20px;
  display: none;
}
.result-container.show {
  display: block;
}
.copy-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.copy-btn:hover {
  background: #0056b3;
}
.phai-list {
  margin-top: 30px;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 20px;
}
.phai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.phai-item {
  background: white;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
  text-align: center;
}
.phai-vietnamese {
  font-weight: bold;
  color: #333;
}
.phai-chinese {
  /* font-family: 'Microsoft YaHei', 'SimSun', serif; */
  color: #666;
  margin-top: 5px;
}

/* ==== Style riêng cho chu-thien.html ==== */
.tab-header {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  justify-content: center;
}
.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #222c3a;
  border-radius: 7px;
  cursor: pointer;
  color: #eee;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.3s, color 0.3s, transform 0.2s;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}
.tab-btn.active, .tab-btn:hover {
  background: linear-gradient(90deg, #2f4c68 60%, #3a5c8a 100%);
  color: #ffcc66;
  border-color: #ffcc66;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 16px rgba(255,204,102,0.10);
}
.tab-btn-kim.active, .tab-btn-kim:hover {
  border-color: #ffd700;
  color: #ffd700;
}
.tab-btn-moc.active, .tab-btn-moc:hover {
  border-color: #43a047;
  color: #43a047;
}
.tab-btn-thuy.active, .tab-btn-thuy:hover {
  border-color: #2196f3;
  color: #2196f3;
}
.tab-btn-hoa.active, .tab-btn-hoa:hover {
  border-color: #ff7043;
  color: #ff7043;
}
.tab-btn-tho.active, .tab-btn-tho:hover {
  border-color: #ffcc66;
  color: #ffcc66;
}
.tab-icon {
  height: 28px;
  margin-right: 6px;
  transition: transform 0.3s;
}
.tab-btn:hover .tab-icon, .tab-btn.active .tab-icon {
  transform: scale(1.15) rotate(-8deg);
}
.tab-content {
  display: none;
  background: #1c2b3a;
  border-radius: 16px;
  padding: 32px 64px 24px 64px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  animation: fadeInTab 0.5s;
  max-width: 1320px;
  margin: 0 auto 32px auto;
}
.tab-content.active {
  display: block;
  animation: fadeInTab 0.5s;
}
@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.level-block {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  border-bottom: 1px solid #2f4c68;
  padding-bottom: 18px;
  gap: 18px;
  transition: background 0.3s;
  border-radius: 8px;
  position: relative;
}
.icon-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.desc {
  color: #ddd;
  line-height: 1.7;
  font-size: 18px;
  flex: 1;
  display: block;
}
.highlight {
  color: #ffcc66;
  font-weight: bold;
  text-shadow: 0 1px 8px #ffcc6640;
  transition: color 0.2s, text-shadow 0.2s;
}
.highlight:hover {
  color: #ffcc66;
  text-shadow: 0 0 16px #ffcc66cc;
  transition: color 0.2s, text-shadow 0.2s;
}
.highlight-kim {
  color: #ffd700;
  font-weight: bold;
  text-shadow: 0 1px 8px #ffe06680;
  transition: color 0.2s, text-shadow 0.2s;
}
.highlight-moc {
  color: #6ee07a;
  font-weight: bold;
  text-shadow: 0 1px 8px #6ee07a80;
  transition: color 0.2s, text-shadow 0.2s;
}
.highlight-thuy {
  color: #2196f3;
  font-weight: bold;
  text-shadow: 0 1px 8px #2196f380;
  transition: color 0.2s, text-shadow 0.2s;
}
.highlight-hoa {
  color: #ff7043;
  font-weight: bold;
  text-shadow: 0 1px 8px #ff704380;
  transition: color 0.2s, text-shadow 0.2s;
}
.highlight-tho {
  color: #ffcc66;
  font-weight: bold;
  text-shadow: 0 1px 8px #ffcc6640;
  transition: color 0.2s, text-shadow 0.2s;
}
.highlight-kim:hover {
  color: #fff6d6;
  text-shadow: 0 0 16px #ffd700cc;
}
.highlight-moc:hover {
  color: #eaffea;
  text-shadow: 0 0 16px #43a047cc;
}
.highlight-thuy:hover {
  color: #e0f7fa;
  text-shadow: 0 0 16px #2196f3cc;
}
.highlight-hoa:hover {
  color: #fff0e6;
  text-shadow: 0 0 16px #ff7043cc;
}
.highlight-tho:hover {
  color: #fff6d6;
  text-shadow: 0 0 16px #ffcc66cc;
}
.icon-group img {
  vertical-align: middle;
}
@media (max-width: 700px) {
  .tab-content { padding: 12px 2px; max-width: 98vw; }
  .level-block { flex-direction: column; gap: 8px; }
  .tab-icon { height: 36px; }
}
/* ==== END Style riêng cho chu-thien.html ==== */

/* Modal chi tiết tuyệt kỹ */
.icon-detail-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: #e0f7fa;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.18s;
  z-index: 2;
  padding: 0;
  outline: none;
}
.icon-detail-btn:focus {
  outline: none;
}
.icon-detail-btn:hover {
  transform: scale(1.10);
}
.icon-detail-info {
  font-size: 24px;
  color: #0097a7;
  pointer-events: none;
  transition: color 0.18s, transform 0.18s;
}
.icon-detail-btn:hover .icon-detail-info {
  color: #0097a7;
  transform: scale(1.18);
}
#modalContent {
  max-width: 1850px !important;
  border: 1.5px solid #e0e0e0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 1.5px 0 #e0e0e0;
}
#detailModal {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  background: transparent !important;
}
#detailModal.show {
  pointer-events: auto;
}
#detailModal.visible {
  opacity: 1;
  transform: scale(1);
}
#detailModal.hide {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.18s, transform 0.18s;
}
.modal-grid {
  display: flex;
  gap: 24px;
  flex-wrap: nowrap;
}
.modal-grid > div:nth-child(1) {
  min-width: 80px;
  max-width: 160px;
  flex: 0 0 140px;
}
.modal-grid > div:nth-child(2),
.modal-grid > div:nth-child(3) {
  min-width: 220px;
  flex: 1 1 0;
}
.badge {
  display: inline-block;
  background: #e0f7fa;
  color: #007baf;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 14px;
  margin: 2px 4px 2px 0;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.badge-tangcuong {
  background: #fff3e0;
  color: #222;
  border-radius: 8px;
  margin: 2px 0;
  display: block;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  padding: 4px 10px;
}
.badge-hieuung {
  background: linear-gradient(90deg, #ff5252 0%, #ff1744 100%) !important;
  color: #fff !important;
  border-radius: 14px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(255,82,82,0.10);
  letter-spacing: 0.5px;
  transition: background 0.18s, transform 0.18s;
  cursor: pointer;
}
.badge-hieuung:hover {
  background: linear-gradient(90deg, #d50000 0%, #ff1744 100%) !important;
  transform: scale(1.08);
}
#detailModal:not(.show):not(.visible) {
  box-shadow: none !important;
}
.modal-col > div:first-child {
  font-weight: bold;
  text-align: center;
  margin-bottom: 8px;
}



/* Animation cho modal OCR */
#ocr-help-modal {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  background: transparent !important;
}

#ocr-help-modal.show {
  pointer-events: auto;
}

#ocr-help-modal.visible {
  opacity: 1;
  transform: scale(1);
}

#ocr-help-modal.hide {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.18s, transform 0.18s;
}

#ocr-help-modal:not(.show):not(.visible) {
  box-shadow: none !important;
}

/* OCR Tool Modal và Elements */
.ocr-page-title {
  text-align: center;
  color: #007baf;
  margin-bottom: 18px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ocr-help-btn {
  font-size: 15px;
  padding: 6px 16px;
  border-radius: 6px;
  border: 1.5px solid #00bcd4;
  background: #fff;
  color: #007baf;
  cursor: pointer;
  transition: all 0.2s;
}

.ocr-help-btn:hover {
  background: #e0f7fa;
  transform: scale(1.05);
}

.ocr-description {
  text-align: center;
  color: #007baf;
  font-size: 15px;
  margin-bottom: 10px;
}

.ocr-dropzone-label {
  cursor: pointer;
  color: #007baf;
}

.ocr-upload-link {
  text-decoration: underline;
  color: #007baf;
  cursor: pointer;
}

.ocr-upload-link:hover {
  color: #00bcd4;
}

.ocr-help-modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.25);
  align-items: center;
  justify-content: center;
}

.ocr-modal-content {
  background: #fff;
  max-width: 680px;
  width: 90vw;
  padding: 32px 28px 24px 28px;
  border-radius: 14px;
  box-shadow: 0 8px 32px #0003;
  position: relative;
  margin: auto;
  max-height: 85vh;
  overflow-y: auto;
}

.ocr-modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 22px;
  background: none;
  border: none;
  color: #e65100;
  cursor: pointer;
  transition: color 0.2s;
}

.ocr-modal-close:hover {
  color: #ff5722;
}

.ocr-modal-title {
  color: #007baf;
  text-align: center;
  margin-bottom: 20px;
  font-size: 24px;
}

.ocr-section {
  margin-bottom: 24px;
}

.ocr-section-title {
  color: #007baf;
  font-size: 18px;
  margin-bottom: 12px;
  border-bottom: 2px solid #e0f7fa;
  padding-bottom: 6px;
}

.ocr-section-list {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
  padding-left: 20px;
  margin-bottom: 16px;
}

.ocr-dictionary-grid {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

.ocr-dictionary-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ocr-dictionary-category {
  color: #007baf;
  font-weight: bold;
}

.ocr-tips-section {
  margin-bottom: 20px;
}

.ocr-advanced-feature {
  background: #e8f5e8;
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid #4caf50;
}

.ocr-advanced-title {
  color: #2e7d32;
  font-size: 16px;
  margin: 0 0 8px 0;
}

.ocr-advanced-text {
  font-size: 14px;
  line-height: 1.6;
  color: #2e7d32;
  margin: 0;
}

/* ==== OCR Dual Zone Styles ==== */
body { background: #f7f7f7; }
.dual-ocr-container {
  max-width: 1200px;
  margin: 32px auto 0 auto;
  padding: 0 16px;
}
.dual-ocr-title {
  text-align: center;
  color: #007baf;
  margin-bottom: 24px;
  font-size: 28px;
  font-weight: bold;
}
.dual-ocr-description {
  text-align: center;
  color: #007baf;
  font-size: 16px;
  margin-bottom: 32px;
  line-height: 1.6;
}
.ocr-zones-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.ocr-zone {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 2px solid #e0f7fa;
}
.ocr-zone-title {
  font-size: 20px;
  font-weight: bold;
  color: #007baf;
  margin-bottom: 16px;
  text-align: center;
}
.ocr-zone-description {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
  text-align: center;
}
.ocr-dropzone {
  border: 2px dashed #00bcd4;
  padding: 20px;
  text-align: center;
  border-radius: 8px;
  background: #fafdff;
  font-size: 16px;
  color: #007baf;
  outline: none;
  cursor: pointer;
  transition: all 0.25s;
  user-select: none;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ocr-dropzone:focus {
  outline: 2px solid #00bcd4;
  outline-offset: 2px;
  border-color: #00bcd4;
  box-shadow: 0 0 0 4px rgba(0, 188, 212, 0.1);
}
.ocr-dropzone:hover {
  background: #e0f7fa;
  border-color: #00bcd4;
  box-shadow: 0 4px 24px rgba(0, 188, 212, 0.2);
  transform: scale(1.02);
}
.ocr-preview-container {
  position: relative;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 2px solid #e0f7fa;
}
.ocr-preview-image {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
}
.ocr-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #ff5722;
  color: #ff5722;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}
.ocr-remove-btn:hover {
  background: #ff5722;
  color: #fff;
  transform: scale(1.1);
}
.ocr-results {
  margin-top: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  min-height: 60px;
}
.ocr-result-item {
  background: #fff3e0;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #e65100;
  border: 1px solid #ffd6a0;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.ocr-result-item:hover {
  background: #ffe0b2;
  transform: scale(1.02);
}
.ocr-result-item:last-child {
  margin-bottom: 0;
}
.final-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.final-table th,
.final-table td {
  border: 1px solid #ddd;
  padding: 16px 18px;
  text-align: center;
  vertical-align: middle;
  min-width: 140px;
  font-size: 16px;
}
.final-table th {
  background: #4caf50;
  color: white;
  font-weight: 600;
  font-size: 17px;
}
.final-table tr:nth-child(even) {
  background: #f8f9fa;
}
.final-table tr:hover {
  background: #e8f5e8;
}
.copy-btn {
  background: #2196f3;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-left: 8px;
  transition: all 0.2s;
}
.copy-btn:hover {
  background: #1976d2;
  transform: scale(1.05);
}
.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}
.status-ready {
  background: #4caf50;
}
.status-waiting {
  background: #ff9800;
}
.status-processing {
  background: #2196f3;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}
.zone-status {
  font-size: 14px;
  color: #666;
  margin-top: 8px;
  text-align: center;
}
@media (max-width: 768px) {
  .ocr-zones-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .dual-ocr-container {
    padding: 0 8px;
  }
}
@media (max-width: 900px) {
  .final-table th,
  .final-table td {
    min-width: 100px;
    padding: 10px 6px;
    font-size: 14px;
  }
}

.final-table .empty-block {
  display: inline-block;
  min-width: 40px;
  min-height: 18px;
  background: #f8f9fa;
  border-radius: 4px;
}

.final-table td:empty {
  min-width: 140px;
  min-height: 32px;
  background: #fff;
  border-radius: 0;
  display: table-cell;
}

#backtotop-btn {
    visibility: hidden;
    position: fixed;
    cursor: pointer;
    right: 16px;
    bottom: 16px;
    user-select: none;
    transition: 1s;
}

.rocket {
    display: block;
    font-size: 50px;
    transform: rotate(315deg);
    transition: transform 0.2s ease-in-out;
}

#backtotop-btn:hover .rocket {
  animation: rocket-shake 0.4s cubic-bezier(.36,.07,.19,.97) both infinite;
}

.text {
    display: block;
    font-size: 30px;
    text-transform: uppercase;
    color: #000;
    padding: 6px 12px;
    border: 3px solid #000;
    border-radius: 16px 0 16px;
    font-weight: bold;
    transition: 300ms;
}

.text:hover {
    filter: drop-shadow(0 3px 3px #000);
}

.arrow-top {
    display: block;
    width: 64px;
    height: 64px;
    pointer-events: none;
    background-color: #0fb;
    border-radius: 50%;
}

.slide-in-bottom {
    -webkit-animation: slide-in-bottom 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
    animation: slide-in-bottom 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

.slide-out-top {
    -webkit-animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
    animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
}

.scale-in-center {
    -webkit-animation: scale-in-center 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
    animation: scale-in-center 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

.scale-out-center {
    -webkit-animation: scale-out-center 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
    animation: scale-out-center 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
}

@-webkit-keyframes slide-in-bottom {
    0% {
        -webkit-transform: translateY(1000px);
        transform: translateY(1000px);
        opacity: 0;
    }

    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-in-bottom {
    0% {
        -webkit-transform: translateY(1000px);
        transform: translateY(1000px);
        opacity: 0;
    }

    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

@-webkit-keyframes slide-out-top {
    0% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        -webkit-transform: translateY(-1000px);
        transform: translateY(-1000px);
        opacity: 0;
    }
}

@keyframes slide-out-top {
    0% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        -webkit-transform: translateY(-1000px);
        transform: translateY(-1000px);
        opacity: 0;
    }
}

@-webkit-keyframes scale-in-center {
    0% {
        -webkit-transform: scale(0);
        transform: scale(0);
        opacity: 1;
    }

    100% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scale-in-center {
    0% {
        -webkit-transform: scale(0);
        transform: scale(0);
        opacity: 1;
    }

    100% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
}

@-webkit-keyframes scale-out-center {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }

    100% {
        -webkit-transform: scale(0);
        transform: scale(0);
        opacity: 1;
    }
}

@keyframes scale-out-center {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }

    100% {
        -webkit-transform: scale(0);
        transform: scale(0);
        opacity: 1;
    }
}

/* Hiệu ứng rung cho tên lửa */
@keyframes rocket-shake {
  0%, 100% { transform: rotate(315deg) translate(0, 0); }
  25% { transform: rotate(317deg) translate(2px, -2px); }
  50% { transform: rotate(313deg) translate(-2px, 2px); }
  75% { transform: rotate(316deg) translate(2px, 2px); }
}
    /* Tabs Videos */
    .tab-container {
      width: 100%;
      max-width: 1400px;
      margin: 20px auto;
      background-color: #fff;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      box-sizing: border-box;
    }

    @media (max-width: 1500px) {
      .tab-container {
        max-width: 98vw;
        padding: 16px;
      }
    }

    @media (max-width: 992px) {
      .tab-container {
        max-width: 100vw;
        padding: 10px;
        border-radius: 0;
      }
    }

    .tab-buttons {
      display: flex;
      border-bottom: 1px solid #ddd;
      margin-bottom: 20px;
    }
    .tab-button {
      padding: 10px 20px;
      cursor: pointer;
      border: none;
      background-color: #f8f8f8; /* Nền sáng hơn cho nút tab */
      border-radius: 5px 5px 0 0;
      margin-right: 5px;
      transition: background-color 0.3s ease;
      font-size: 16px;
      color: #333;
    }
    .tab-button:hover {
      background-color: #e0e0e0;
    }
    .tab-button.active {
      background-color: #007bff;
      color: white;
      border-bottom: 2px solid #007bff; /* Đường kẻ đậm hơn cho tab active */
    }
    .tab-content {
      display: none;
      padding: 20px; /* Tăng padding cho nội dung tab */
      line-height: 1.6;
      background-color: #fff; /* Đảm bảo nền nội dung là trắng */
      color: #333; /* Đảm bảo chữ có màu đen */
      opacity: 0;
      transition: opacity 0.5s ease-in-out;
    }
    .tab-content.active {
      display: block;
      opacity: 1;
    }
    .video-container {
      margin-top: 20px;
      display: flex;
      flex-wrap: wrap;
      gap: 20px; /* Khoảng cách giữa các video */
      justify-content: center;
    }
    .video-wrapper {
      flex: 1 1 calc(33.33% - 20px); /* 3 video mỗi hàng, trừ đi gap */
      max-width: calc(33.33% - 20px); /* Đảm bảo không vượt quá 1/3 */
      box-sizing: border-box;
    }
    .video-wrapper iframe {
      width: 100%;
      aspect-ratio: 16/9; /* Standard YouTube aspect ratio */
      border: none;
      border-radius: 8px;
    }
    @media (max-width: 992px) { /* Điều chỉnh breakpoint nếu cần, ví dụ 3 video trên tablet */
      .video-wrapper {
        flex: 1 1 calc(50% - 20px); /* 2 video mỗi hàng trên màn hình trung bình */
        max-width: calc(50% - 20px);
      }
    }
    @media (max-width: 768px) {
      .video-wrapper {
        flex: 1 1 100%; /* 1 video mỗi hàng trên màn hình nhỏ */
        max-width: 100%;
      }
    }
	
    .info-card {
        background-color: #f9f9f9;
        border-left: 4px solid #007bff;
        padding: 15px 20px;
        margin: 20px 0;
        border-radius: 0 8px 8px 0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
      }
      .info-card h4 {
        margin-top: 0;
        color: #007bff;
        font-size: 1.1em;
      }
      .video-gallery {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 videos per row on large screens */
        gap: 20px;
        margin-top: 20px;
        justify-content: center; /* Canh giữa khi hàng cuối có ít hơn 3 video */
      }

      /* Responsive adjustments for video gallery */
      @media (max-width: 992px) {
        .video-gallery {
          grid-template-columns: repeat(2, 1fr); /* 2 videos per row on tablets */
        }
      }

      @media (max-width: 768px) {
        .video-gallery {
          grid-template-columns: 1fr; /* 1 video per row on mobile */
        }
      }
      .video-item {
        background-color: #fff;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); /* Enhanced shadow */
        border: 1px solid #e0e0e0; /* Subtle border */
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        position: relative;
        cursor: pointer;
      }
      .video-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      }
      .video-item img {
        width: 100%;
        height: auto;
        display: block;
        aspect-ratio: 16/9;
        object-fit: cover;
      }
      .video-item iframe {
        width: 100%;
        aspect-ratio: 16/9;
        border: none;
      }
      .video-item-title {
        padding: 15px;
        font-weight: bold;
        color: #333;
        background-color: #fafafa;
        text-align: center; /* Center the title text */
      }
      .play-button {
        position: absolute;
        top: 45%; /* Adjusted for smaller size */
        left: 50%;
        transform: translate(-50%, -50%);
        width: 45px; /* Smaller */
        height: 45px; /* Smaller */
        background-color: rgba(0, 0, 0, 0.6);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.3s ease;
        pointer-events: none; /* Make it unclickable */
        opacity: 0; /* Ẩn mặc định */
      }
      .play-button::after {
        content: '';
        display: block;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 10px 0 10px 18px; /* Smaller */
        border-color: transparent transparent transparent white;
        margin-left: 3px; /* Adjusted for smaller size */
      }
      .video-item:hover .play-button {
        background-color: rgba(255, 0, 0, 0.8);
        opacity: 1; /* Hiện khi hover */
        transform: translate(-50%, -50%) scale(1.2); /* Phóng to và hiện */
      }
      .guide-section {
        margin-bottom: 30px;
      }
      .guide-section h4 {
        border-bottom: 2px solid #eee;
        padding-bottom: 10px;
        margin-bottom: 15px;
        color: #333;
      }
      .guide-section ul {
        list-style-type: none;
        padding-left: 0;
      }
      .guide-section ul li {
        background: #fdfdfd;
        padding: 10px 15px;
        margin-bottom: 8px;
        border-radius: 5px;
        border: 1px solid #eee;
        display: flex;
        align-items: center;
      }
      .guide-section ul li::before {
        content: '✔';
        color: #28a745;
        font-weight: bold;
        margin-right: 10px;
        font-size: 1.2em;
      }
    @media (min-width: 993px) {
      .video-gallery {
        display: flex;
        flex-wrap: wrap;
        justify-content: center; /* Canh giữa các video ở hàng cuối */
        gap: 20px;
      }
      .video-item {
        flex: 0 1 calc(33.33% - 20px);
        max-width: calc(33.33% - 20px);
      }
    }
	
    /* Tabs Videos */

/* ===== TRANG BI CSS ===== */
:root {
    --rare-epic: #e67e22;
    --rare-legend: #9b59b6;
    --rare-unique: #00b894;
    --rare-normal: #3498db;
    --rare-hiem: #16a085;
    --card-bg: #fff;
    --card-shadow: 0 2px 12px 0 rgba(52, 152, 219, 0.08);
    --card-hover: #f0f6ff;
    --tag-bg: #e8edfa;
    --tag-border: #b2c3e6;
    --tag-color: #2d3a5a;
    --tag-hover: #d0e2ff;
}

.container {
    width: 100%;
    margin: 0 auto;
}

.sidebar { 
    width: 0; 
}

.filter-tags-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.filter-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-keyword-box {
    display: flex;
    align-items: center;
    margin-left: 12px;
}

@media (max-width: 600px) {
    .filter-tags-area {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-selects, .filter-keyword-box {
        width: 100%;
        margin-left: 0;
        justify-content: stretch;
    }
    #keywordSearchBox {
        width: 100%;
        max-width: 100%;
    }
}

.filter-tags-list {
    margin-top: 0;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #ff3030 0%, #ff7b42 100%);
  color: #fff;
  border-radius: 12px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  margin: 4px 6px 4px 0;
  box-shadow: 0 2px 8px rgba(255,88,88,0.08);
  border: 1px solid #ff7b42;
  cursor: pointer;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.filter-tag:hover {
  box-shadow: 0 4px 16px rgba(255,123,66,0.18);
  border-color: #ff3030;
  color: #fff;
}
.filter-tag .tag-remove {
  margin-left: 8px;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.filter-tag .tag-remove:hover {
  opacity: 1;
}

.filter-selects .custom-dropdown {
    position: relative;
    display: inline-block;
    width: max-content; /* Lấy theo nội dung lớn nhất của dropdown */
    min-width: 80px;
    max-width: 100vw;
    margin-bottom: 0;
    vertical-align: middle;
}

.filter-selects .custom-dropdown-selected {
    width: 100%; /* Luôn bằng với dropdown cha */
    max-width: 100vw;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px; /* Giảm chiều cao */
}

.filter-selects .custom-dropdown-list {
    min-width: 100%; /* Đảm bảo menu drop không nhỏ hơn ô filter */
    width: 100%; /* Luôn bằng với ô filter */
    box-sizing: border-box;
}

.filter-selects .custom-dropdown-selected:focus, .custom-dropdown-selected.active {
    border-color: #4a90e2;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.15);
    outline: none;
}

.filter-selects .custom-dropdown-selected::after {
    content: '▼';
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.filter-selects .custom-dropdown-selected.active::after {
    transform: rotate(180deg);
}

.filter-selects .custom-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    min-width: 100%;
    width: max-content; /* Đủ rộng cho nội dung dài nhất */
}

.filter-selects .custom-dropdown-list.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-selects .custom-dropdown-option {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 14px;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.filter-selects .custom-dropdown-option:last-child {
    border-bottom: none;
}

.filter-selects .custom-dropdown-option:hover, 
.filter-selects .custom-dropdown-option.active {
    background: #eaf6fb;
    color: #4a90e2;
}

section.item-section {
    width: 100%;
    margin: 0 auto 0 auto;
    padding: 0 2vw 24px 2vw;
    box-sizing: border-box;
    background: none;
}

.item-list {
    width: 100%;
    max-width: 100vw;
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    padding: 0;
    justify-content: center;
    gap: 15px !important;
}

.item-card {
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 18px 10px 14px 10px;
    cursor: pointer;
    transition: all 0.4s ease;
    border: 1px solid #e0e0e0;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    max-width: 280px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 !important;
}

.item-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(120deg, #a18cd1, #fbc2eb, #a6c0fe, #fbc2eb);
    animation: rotate 6s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.item-card:hover::before {
    opacity: 0.3;
}

.item-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    border-color: #c084fc;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.item-card > * {
    position: relative;
    z-index: 1;
}

.item-card.selected {
    border: 2.5px solid #e67e22;
    box-shadow: 0 0 16px #e67e22bb;
    animation: shake 0.2s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.item-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    margin-bottom: 6px;
    border-radius: 10px;
    filter: drop-shadow(0 2px 8px #b2bec3);
    background: #fff;
    display: block;
    transition: transform 0.3s ease;
}

.item-card:hover img {
    transform: scale(1.05);
}

.item-type-icon {
    font-size: 18px; 
    margin-right: 4px; 
    vertical-align: middle;
}

.item-name {
    font-size: 1em; 
    font-weight: bold; 
    margin-bottom: 2px;
    color: var(--rare-legend);
    text-shadow: 0 1px 2px #fff, 0 0 4px #9b59b6aa;
}

.item-rarity {
    font-size: 0.93em; 
    font-weight: bold; 
    margin-bottom: 2px;
}

.rarity-Độc\ Châu { color: var(--rare-unique); }
.rarity-Sử\ Thi { color: var(--rare-epic); }
.rarity-Hiếm { color: var(--rare-hiem); }
.rarity-Thường { color: var(--rare-normal); }

.item-level { 
    color: #636e72; 
    font-size: 0.93em; 
}

.details, .compare {
    background: linear-gradient(120deg, #f0f6ff 60%, #eaf6fb 100%);
    border-radius: 16px;
    padding: 20px 18px 18px 18px;
    min-width: 340px;
    box-shadow: 0 2px 16px 0 #b2bec366;
    margin-bottom: 18px;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.compare { 
    margin-top: 24px; 
}

.compare-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: #fff; 
    border-radius: 8px; 
    overflow: hidden; 
}

.compare-table th, .compare-table td { 
    border: 1px solid #dfe6e9; 
    padding: 7px 12px; 
    text-align: left; 
}

.compare-table th { 
    background: #eaf6fb; 
}

.btn-compare { 
    margin-top: 12px; 
    padding: 7px 18px; 
    background: linear-gradient(90deg,#4a90e2,#16a085); 
    color: #fff; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 1em; 
    box-shadow: 0 2px 8px #b2bec366; 
    transition: background 0.2s; 
}

.btn-compare:disabled { 
    background: #aaa; 
    cursor: not-allowed; 
}

.item-stats li { 
    color: #222; 
    font-size: 1em; 
    margin-bottom: 0px; 
}

.item-stats li b { 
    color: #e67e22; 
    font-weight: bold; 
}

.item-desc { 
    color: #0984e3; 
    font-size: 1em; 
    margin-bottom: 0px; 
    font-style: italic; 
}

.item-lore { 
    font-size: 0.97em; 
    color: #636e72; 
    margin-top: 0px; 
}

@media (max-width: 900px) {
    .container { flex-direction: column; }
    .details, .compare { min-width: unset; }
    .item-list { padding: 0 1vw; }
}

.item-meta-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-size: clamp(0.9em, 3vw, 1em);
    padding: 0 6px;
    box-sizing: border-box;
    margin-top: 2px;
    flex-wrap: wrap;
    gap: 2px;
}

.item-meta-row span {
    flex: 1 1 0;
    min-width: 0;
    font-weight: bold;
    font-size: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-meta-row .item-level {
    text-align: center;
    color: #e67e22;
    width: 100%;
    display: block;
}

.item-meta-row .item-score {
    text-align: right;
    color: #4a90e2;
}

/* Modal nâng cấp */
#itemDetailModal {
    display: none;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.18);
    transition: opacity 0.2s;
}
#itemDetailModal.show {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 10000 !important;
}

#itemDetailModalOverlay {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    position: absolute;
    left: 0;
    top: 0;
    background: transparent;
    z-index: 1;
}

#itemDetailModal.hide #itemDetailModalOverlay {
    opacity: 0;
}

#itemDetailModalBox {
    position: fixed;
    top: 50%; 
    left: 50%;
    transform: translate(-50%,-50%) scale(1);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 40px #0005, 0 0 0 4px #eaf6fb;
    min-width: 800px !important;
    max-width: 99vw !important;
    min-height: 220px;
    max-height: 90vh;
    padding: 36px 32px 28px 32px;
    z-index: 1001;
    overflow-y: auto;
    opacity: 1;
    transition: opacity 0.25s, transform 0.25s;
    animation: modalFadeIn 0.35s cubic-bezier(.4,1.4,.6,1) both;
}

#itemDetailModal.hide #itemDetailModalBox {
    opacity: 0;
    transform: translate(-50%,-50%) scale(0.95);
    transition: opacity 0.2s, transform 0.2s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translate(-50%,-48%) scale(0.95); }
    to   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

@keyframes compareModalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

#itemDetailModalClose {
    position: absolute;
    top: 14px; 
    right: 20px;
    font-size: 2em;
    background: none;
    border: none;
    cursor: pointer;
    color: #a3bffa;
    transition: color 0.2s, transform 0.2s;
    z-index: 1002;
}

#itemDetailModalClose:hover {
    color: #e67e22;
    transform: scale(1.15) rotate(8deg);
}

#itemDetailModalContent {
    margin-top: 8px;
}

#itemDetailModalContent .item-modal-img {
    width: 120px; 
    height: 120px; 
    object-fit: contain;
    box-shadow: 0 2px 16px #b2bec3;
    border-radius: 12px;
    margin: 0 auto 10px auto; 
    display: block;
    background: #fff;
    transition: transform 1s cubic-bezier(.25,.8,.25,1);
    cursor: pointer;
}

#itemDetailModalContent .item-modal-img:hover {
    transform: scale(1.12);
}

#itemDetailModalContent .item-modal-name {
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    color: #9b59b6;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

#itemDetailModalContent .item-modal-rarity {
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 4px;
}

#itemDetailModalContent .item-modal-meta {
    text-align: center;
    margin-bottom: 8px;
    color: #636e72;
    font-size: 1em;
}

#itemDetailModalContent .item-modal-get {
    text-align: center;
    margin-bottom: 8px;
}

#itemDetailModalContent .item-modal-stats {
    margin: 10px 0 8px 0;
    padding: 0 0 0 18px;
    list-style: disc;
}

#itemDetailModalContent .item-modal-stats li,
.item-stats li {
    margin-bottom: 2px;
    font-size: 1.05em;
    transition: color 0.2s, transform 0.2s;
    cursor: pointer;
}

#itemDetailModalContent .item-modal-stats li:hover,
.item-stats li:hover {
    color: #4a90e2;
    transform: scale(1.04);
}

#itemDetailModalContent .item-modal-stats li b,
.item-stats li b {
    color: #e67e22;
    font-weight: bold;
    transition: color 0.2s;
}

#itemDetailModalContent .item-modal-desc {
    color: #0984e3;
    font-size: 1em;
    margin-bottom: 8px;
    white-space: pre-line;
}

#itemDetailModalContent .item-modal-season {
    text-align: center;
    color: #16a085;
    font-size: 1em;
    margin-bottom: 8px;
}

/* Custom dropdown khung - chỉ ẩn những cái không dùng */
.custom-dropdown-label {
    display: none !important;
}

/* Đảm bảo các phần tử trong item-meta-row sát nhau và cùng baseline */
.item-meta-row {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  margin: 6px 0 0 0;
  width: 100%;
  justify-content: center;
  font-size: 1em;
}
.item-meta-row .item-type {
  color: #e67e22;
  font-weight: bold;
  margin: 0;
}
.item-meta-row .item-level {
  color: #636e72;
  font-weight: bold;
  margin: 0;
}
.item-meta-row .item-level span {
  color: #e67e22;
}
.item-meta-row .divider {
  color: #b2bec3;
  margin: 0 4px;
  font-weight: normal;
}

.custom-dropdown-list::-webkit-scrollbar {
  width: 8px;
  background: #f0f0f0;
  border-radius: 8px;
}
.custom-dropdown-list::-webkit-scrollbar-thumb {
  background: #b0b0b0;
  border-radius: 8px;
}
.custom-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: #888;
}
.custom-dropdown-list::-webkit-scrollbar-corner {
  background: #e0e0e0;
}

.custom-dropdown-list,
.custom-dropdown-option {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#keywordSearchBox {
    width: 300px;
    max-width: 90%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 15px;
    transition: border-color 0.2s;
}
#keywordSearchBox:focus {
    border-color: #0984e3;
    outline: none;
    box-shadow: 0 0 4px #0984e355;
}
#keywordSearchBox::placeholder {
    font-style: italic;
}

/* Modern table style for noi-cong - Excel-like borders */
.modern-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #ccc;
  margin: 18px 0;
  table-layout: fixed;
  box-shadow: none;
  border-radius: 0;
}
.modern-table th, .modern-table td {
  font-size: 16px;
  padding: 10px;
  border: 1px solid #ccc;
  font-family: Arial, sans-serif;
}
.modern-table td {
  text-align: left;
  vertical-align: top;
  color: #222;
}
.modern-table th {
  background: #00FF55;
  color: #222;
  text-align: center;
}
.modern-table thead th {
  background: #00FF55;
  color: #222;
}
.modern-table tbody td {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}

.modern-table tbody td img {
  width: 100px !important;
  height: 100px !important;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 8px #b2bec3;
  display: block;
  margin: 0 auto;
}

.modern-table th:nth-child(1), .modern-table td:nth-child(1) { width: 120px; min-width: 120px; max-width: 120px; text-align: center; }
.modern-table th:nth-child(2), .modern-table td:nth-child(2) { width: 200px; }
.modern-table th:nth-child(3), .modern-table td:nth-child(3) { width: 100px; text-align: center; }
.modern-table th:nth-child(4), .modern-table td:nth-child(4) { width: 100px; text-align: center; }
.modern-table th:nth-child(5), .modern-table td:nth-child(5) { width: auto; }

@media (max-width: 900px) {
  .modern-table thead th, .modern-table tbody td { font-size: 13px; padding: 7px 3px; }
  .modern-table tbody td img { width: 38px !important; height: 38px !important; }
}

.modern-table {
  width: 100%;
  min-width: 900px;
  max-width: 100vw;
}
@media (max-width: 900px) {
  .modern-table { min-width: 600px; }
}

.modern-table th:nth-child(2), .modern-table td:nth-child(2),
.modern-table th:nth-child(3), .modern-table td:nth-child(3),
.modern-table th:nth-child(4), .modern-table td:nth-child(4) {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modern-table th:nth-child(5), .modern-table td:nth-child(5) {
  text-align: center;
  vertical-align: middle;
}
.modern-table td:nth-child(5) > div,
.modern-table td:nth-child(5) > span,
.modern-table td:nth-child(5) > p {
  text-align: left;
}
.modern-table td:nth-child(1) {
  text-align: center;
  vertical-align: middle;
}
.modern-table tbody td img {
  display: block;
  margin: 0 auto;
  vertical-align: middle;
}
.modern-table td {
  height: 120px;
}

td .badge-hieuung, .badge-hieuung {
  background: linear-gradient(90deg, #ff5252 0%, #ff1744 100%) !important;
  color: #fff !important;
}

.modern-table td img {
  border-radius: 0 !important;
}

.modern-table td img:hover {
  cursor: pointer;
}

