/**
 * KIOSK MODE STYLES
 * Tối ưu cho màn hình cảm ứng lớn và thiết bị kiosk
 * 
 * Nguyên tắc thiết kế:
 * - Vùng chạm tối thiểu: 60-80px
 * - Font size lớn hơn: 18-24px
 * - Khoảng cách rộng hơn
 * - Feedback rõ ràng khi tương tác
 */

/* ============================================
   GLOBAL KIOSK SETTINGS
   ============================================ */
body.kiosk-mode {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Be Vietnam Pro', sans-serif;
  background-image: url('/wp-content/themes/bo-y-te/assets/images/leader-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Đảm bảo tất cả clickable elements phản hồi ngay lập tức */
body.kiosk-mode button,
body.kiosk-mode [onclick],
body.kiosk-mode a,
body.kiosk-mode .cursor-pointer {
  touch-action: manipulation !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Loại bỏ delay 300ms trên mobile */
body.kiosk-mode * {
  touch-action: manipulation;
}

/* Tắt text selection khi double tap */
body.kiosk-mode * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Modal Details - Đảm bảo content hiển thị đúng */
#modal-details p {
  display: block !important;
  margin-bottom: 1rem !important;
  line-height: 1.6 !important;
}

#modal-details p:last-child {
  margin-bottom: 0 !important;
}

/* ============================================
   3D MODEL VIEWER - Kiosk Mode
   ============================================ */
body.kiosk-mode model-viewer {
  /* Đảm bảo model viewer hiển thị đầy đủ */
  width: 100%;
  height: 100%;
  display: block;
}

/* Model viewer controls - Tăng kích thước cho touch */
body.kiosk-mode model-viewer::part(default-ar-button) {
  min-width: 80px;
  min-height: 80px;
  font-size: 1.2rem;
}

/* Loading indicator */
body.kiosk-mode model-viewer::part(default-progress-bar) {
  height: 8px;
}

body.kiosk-mode model-viewer::part(default-progress-bar-track) {
  background-color: rgba(0, 0, 0, 0.1);
}

body.kiosk-mode model-viewer::part(default-progress-bar-fill) {
  background-color: #0ea5e9;
}

/* Interaction prompt - Tăng kích thước */
body.kiosk-mode model-viewer .interaction-prompt {
  font-size: 1.5rem;
  padding: 1.5rem;
}

/* ============================================
   SCROLLBAR - Tăng kích thước
   ============================================ */
body.kiosk-mode ::-webkit-scrollbar {
  height: 8px;
}

body.kiosk-mode ::-webkit-scrollbar-track {
  background: none;
  /* border-radius: 10px; */
}

body.kiosk-mode ::-webkit-scrollbar-thumb {
  background: #d5d7da;
  border-radius: 10px;
  /* min-height: 80px; */
  /* border: 3px solid #f1f5f9; */
}

body.kiosk-mode ::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.8);
}

/* body.kiosk-mode ::-webkit-scrollbar-thumb:active {
    background: #0c4a6e;
} */

/* ============================================
   NAVIGATION - Tăng kích thước nút
   ============================================ */
body.kiosk-mode nav {
  min-height: 88px;
  padding-left: 80px;
  padding-right: 80px;
}
.welcome-des {
  margin-top: 16px;
  margin-left: 20px;
  color: #101828;
  font-family: 'Be Vietnam Pro';
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: 150%; /* 27px */
}
.welcome-des li {
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  body.kiosk-mode nav {
    padding-left: 10px;
    padding-right: 20px;
  }

  .welcome-title > span {
    display: block;
  }
}

body.kiosk-mode #nav-desktop button {
  min-height: 44px;
  text-align: center;
  font-size: 1.25rem; /* 20px */
  font-weight: 400;
  /* margin: 0 32px; */
}

body.kiosk-mode #nav-desktop button svg {
  width: 1.75rem;
  height: 1.75rem;
}

/* Tối ưu cho MacBook Pro 14" và các laptop tương tự (1280px - 1680px) */
@media (min-width: 1280px) and (max-width: 1680px) {
  body.kiosk-mode #nav-desktop {
    gap: 0.25rem !important;
  }

  body.kiosk-mode #nav-desktop button.nav-menu-btn,
  body.kiosk-mode #nav-desktop button {
    font-size: 1rem !important;
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    min-height: 36px !important;
    white-space: nowrap !important;
  }
  #welcome-icon + span {
    font-size: 38px !important;
  }
  .welcome-title {
    font-size: 35px !important;
    line-height: 120% !important;
  }
}

/* Cho màn hình nhỏ hơn (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
  body.kiosk-mode #nav-desktop {
    margin-right: 4rem !important;
    gap: 0.125rem !important;
  }

  body.kiosk-mode #nav-desktop button.nav-menu-btn,
  body.kiosk-mode #nav-desktop button {
    font-size: 0.75rem !important; /* 12px */
    padding-left: 0.375rem !important; /* 6px */
    padding-right: 0.375rem !important; /* 6px */
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    min-height: 36px !important;
    white-space: nowrap !important;
  }
}

.hide {
  display: none !important;
}

/* Logo area */
body.kiosk-mode nav .flex.items-center.space-x-3 {
  padding: 1rem;
}

body.kiosk-mode nav .bg-moh-700.p-2 {
  padding: 1rem;
}

body.kiosk-mode nav .text-xl {
  font-size: 1.75rem;
}

body.kiosk-mode nav .text-lg {
  font-size: 1.5rem;
}

body.kiosk-mode nav .text-xs {
  font-size: 1rem;
}

/* Hero CTA buttons */
body.kiosk-mode .px-8.py-4 {
  padding: 1.5rem 2.5rem !important;
  font-size: 1.5rem !important;
  min-height: 90px;
}

/* Active state - Hiệu ứng khi chạm */
body.kiosk-mode button:active {
  transform: scale(0.95);
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Loại trừ modal content khỏi active state */
body.kiosk-mode #artifact-modal > div:active,
body.kiosk-mode #leader-modal > div:active {
  transform: none !important;
  box-shadow: none !important;
}

body.kiosk-mode {
  font-size: 18px;
  line-height: 1.7;
}

/* Headings */
body.kiosk-mode h1 {
  font-size: 3.5rem;
  line-height: 1.2;
}
body.kiosk-mode h1.title-font {
  margin-top: -27px;
  text-transform: uppercase;
  font-size: 2rem;
}

@media (max-width: 768px) {
  body.kiosk-mode h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }
}

body.kiosk-mode h2 {
  font-size: 2rem; /* 40px */
  line-height: 2rem;
  /* font-family: 'Roboto', sans-serif !important; */
}

body.kiosk-mode h4 {
  font-size: 18px;
  line-height: 1.2;
  /* font-family: Roboto, sans-serif; */
}

body.kiosk-mode p {
  font-size: 18px;
  margin-bottom: 1rem;
  line-height: 150%;
  color: #252b37;
}

.custom-audio::-webkit-media-controls-enclosure {
  background-color: transparent;
}
audio {
  filter: grayscale(100%) contrast(90%);
}
/* Tùy chỉnh thanh cuộn cho class .custom-scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #b5e7ff;
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #88d4ff;
}

/* Đảm bảo khung ảnh sheet nhạc cố định khi cuộn danh sách */
@media (min-width: 1024px) {
  .sticky-content {
    position: sticky;
    top: 20px;
  }
}

body.kiosk-mode .history-grid-item p {
  margin-bottom: 0;
}

/* Hero section */
body.kiosk-mode .text-4xl {
  font-size: 3rem !important;
  line-height: 4rem;
}

body.kiosk-mode .text-7xl {
  font-size: 6rem !important;
  line-height: 6rem;
}

body.kiosk-mode .text-xl {
  font-size: 1.5rem !important;
}

/* ============================================
   CARDS - Tăng vùng tương tác
   ============================================ */
body.kiosk-mode .group {
  padding: 0.75rem;
  cursor: pointer;
}

body.kiosk-mode .group:active {
  transform: scale(0.98);
}

/* History timeline cards */
body.kiosk-mode .bg-white.p-6 {
  padding: 2rem;
}

/* Leader cards */
body.kiosk-mode .grid.gap-8 {
  gap: 2rem;
}

/* Artifact cards */
body.kiosk-mode .grid.gap-8 {
  gap: 2.5rem;
}

/* ============================================
   MODAL - Cải thiện đóng modal
   ============================================ */
body.kiosk-mode #artifact-modal,
body.kiosk-mode #leader-modal,
body.kiosk-mode #history-modal,
body.kiosk-mode #unit-modal {
  padding: 2rem;
  pointer-events: auto !important;
}

/* Đảm bảo modal hiển thị ngay lập tức */
body.kiosk-mode #artifact-modal.flex,
body.kiosk-mode #leader-modal.flex,
body.kiosk-mode #history-modal.flex,
body.kiosk-mode #unit-modal.flex {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.kiosk-mode #artifact-modal {
  padding: 2rem;
}

/* Modal content */
body.kiosk-mode #artifact-modal .max-w-4xl {
  max-width: 80rem;
}

body.kiosk-mode #artifact-modal .text-3xl,
body.kiosk-mode #history-modal .text-3xl {
  font-size: 2.5rem;
  /* font-family: 'Roboto', sans-serif !important; */
  padding-right: 5rem !important;
  max-width: calc(100% - 10px) !important;
  line-height: 1.2;
}

body.kiosk-mode #artifact-modal .text-sm,
body.kiosk-mode #artifact-modal p {
  font-size: 1rem;
}

/* ============================================
   SEARCH INPUT - Tăng kích thước
   ============================================ */
body.kiosk-mode input[type='text'] {
  min-height: 70px;
  font-size: 1.25rem;
  padding: 1.25rem 1.5rem 1.25rem 3.5rem;
}

body.kiosk-mode input[type='text']::placeholder {
  font-size: 1.125rem;
}

body.kiosk-mode .absolute.left-3 svg {
  width: 1.75rem;
  height: 1.75rem;
}

/* ============================================
   SPACING - Tăng khoảng cách
   ============================================ */
body.kiosk-mode .container {
  padding-left: 2rem;
  padding-right: 2rem;
}

body.kiosk-mode .py-16 {
  padding-top: 3rem;
  padding-bottom: 0;
}

body.kiosk-mode .mb-16 {
  margin-bottom: 5rem;
}

/* ============================================
   TIMELINE - Cải thiện timeline
   ============================================ */
body.kiosk-mode .relative.mb-16 {
  margin-bottom: 4rem;
}

/* Timeline dot */
body.kiosk-mode .w-8.h-8.rounded-full {
  width: 3rem;
  height: 3rem;
}

/* Timeline line */
body.kiosk-mode .w-1 {
  width: 0.375rem;
}

/* ============================================
   HISTORY HORIZONTAL SCROLL - Cuộn ngang lịch sử
   ============================================ */
.history-filter-tab {
  border: 1px solid var(--Brand-Emphasis-brand-primary, #ab0e20);
  background: var(--Common-role-text-text-CTA, #fff);
  display: flex;
  max-width: 350px;
  padding: 10px 13px;
  line-height: 1.4;
  justify-content: center;
  align-items: center;
  gap: 10px;
  align-self: stretch;
}
.history-tabs {
  border-bottom: 1px solid #ab0e20;
}
.history-tabs button:not(:last-child) {
  border-right: none;
}
.history-tabs button {
  background-color: #e9eaeb;
  color: #ab0e20;
  font-size: 1.4rem;
}
.history-tabs button.active {
  background-color: #fff;
}

/* History Modal Close Button - Nút X */
body.kiosk-mode #history-modal > div > button:first-child {
  position: absolute !important;
  top: 12px !important;
  right: 24px !important;
  left: auto !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: 9999px !important;
}

/* History Modal Bottom Button - Nút đóng và quay lại */
body.kiosk-mode
  #history-modal
  button[onclick*='closeHistoryModal']:not(:first-child) {
  min-height: 80px !important;
  font-size: 1.5rem !important;
  padding: 1.5rem 2rem !important;
}

body.kiosk-mode .history-timeline-container {
  position: relative;
  padding: 0;
}

body.kiosk-mode .history-horizontal-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

body.kiosk-mode .history-item-wrapper {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: auto;
}

body.kiosk-mode .history-item {
  width: 450px;
  min-width: 450px;
  height: 565px;
  position: relative;
  z-index: 2;
  margin: 0 1rem;
}

/* Đảm bảo card bên trong có chiều cao 100% */
body.kiosk-mode .history-item > div {
  height: 100%;
}

/* Fix chiều cao ảnh và phần nội dung */
body.kiosk-mode .history-item .h-64 {
  height: 16rem;
  flex-shrink: 0;
}
.leader-filter-tab {
  border: 1px solid var(--Brand-Emphasis-brand-primary, #ab0e20);
  background: var(--Common-role-text-text-CTA, #fff);
  display: flex;
  padding: 12px 60px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  align-self: stretch;
}
.leader-tabs {
  border-bottom: 1px solid #ab0e20;
}
.leader-tabs button:not(:last-child) {
  border-right: none;
}
.leader-tabs button {
  background-color: #e9eaeb;
  color: #ab0e20;
  font-size: 1.5rem;
}
.leader-tabs button.active {
  background-color: #fff;
}

body.kiosk-mode .leader-item .h-64 {
  height: 18rem;
}

body.kiosk-mode .history-item .p-6 {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.kiosk-mode .history-item .p-6 p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

/* Timeline dot - Chấm tròn giữa các item */
body.kiosk-mode .timeline-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3rem;
  height: 3rem;
  background: #0369a1;
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(3, 105, 161, 0.4);
  z-index: 3;
  transition: all 0.3s ease;
}

body.kiosk-mode .timeline-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1rem;
  height: 1rem;
  background: #ffffff;
  border-radius: 50%;
}

/* Hover effect cho timeline dot */
body.kiosk-mode .history-item:hover .timeline-dot {
  width: 3.5rem;
  height: 3.5rem;
  background: #0284c7;
  box-shadow: 0 6px 16px rgba(3, 105, 161, 0.6);
}

/* Ẩn scrollbar mặc định */
body.kiosk-mode .history-horizontal-scroll::-webkit-scrollbar {
  display: none;
}

body.kiosk-mode .history-horizontal-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.custom-width {
  width: calc(50% - 50px);
}
body.kiosk-mode .custom-timeline-nav {
  position: relative;
}

/* Timeline track - Đường line chính */
body.kiosk-mode .custom-timeline-track {
  position: absolute;
  top: 50%;
  left: 4rem;
  right: 4rem;
  height: 8px;
  background: linear-gradient(to right, #0369a1 0%, #0ea5e9 100%);
  border-radius: 4px;
  transform: translateY(-50%);
  box-shadow: 0 2px 8px rgba(3, 105, 161, 0.3);
}

/* Container cho các dots */
body.kiosk-mode .custom-timeline-dots {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* Mỗi timeline dot */
body.kiosk-mode .custom-timeline-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 1rem;
}

body.kiosk-mode .custom-timeline-dot:hover {
  transform: translateY(-8px);
}

/* Vòng tròn của dot */
body.kiosk-mode .dot-circle {
  width: 56px;
  height: 56px;
  background: #0369a1;
  border: 6px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(3, 105, 161, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

body.kiosk-mode .dot-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
}

body.kiosk-mode .custom-timeline-dot:hover .dot-circle {
  width: 64px;
  height: 64px;
  background: #0284c7;
  box-shadow: 0 6px 20px rgba(3, 105, 161, 0.6);
}

body.kiosk-mode .custom-timeline-dot:hover .dot-circle::after {
  width: 24px;
  height: 24px;
}

/* Năm hiển thị dưới dot */
body.kiosk-mode .dot-year {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0369a1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

body.kiosk-mode .custom-timeline-dot:hover .dot-year {
  font-size: 1.5rem;
  color: #0284c7;
}

/* Active state cho dot hiện tại */
body.kiosk-mode .custom-timeline-dot.active .dot-circle {
  width: 64px;
  height: 64px;
  background: #0284c7;
  box-shadow: 0 6px 24px rgba(3, 105, 161, 0.8);
  animation: pulse 2s infinite;
}

body.kiosk-mode .custom-timeline-dot.active .dot-year {
  font-size: 1.5rem;
  color: #0284c7;
  font-weight: 800;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 6px 24px rgba(3, 105, 161, 0.8);
  }
  50% {
    box-shadow: 0 6px 32px rgba(3, 105, 161, 1);
  }
}
body.kiosk-mode .leaders-timeline-container {
  position: relative;
  padding: 0;
}

body.kiosk-mode .leaders-horizontal-scroll {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

body.kiosk-mode .leaders-horizontal-scroll::-webkit-scrollbar {
  display: none;
}

body.kiosk-mode .leaders-horizontal-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body.kiosk-mode .leader-item-wrapper {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: stretch; /* stretch để tất cả cards trong hàng cùng chiều cao */
  height: auto;
  justify-content: center;
}

body.kiosk-mode .leader-item {
  background: #ffffff;
  border: 1px solid #e0f2fe;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  transition: all 0.3s ease;
  width: 300px;
  /* Flex column để ảnh ở trên, text ở dưới, chiều cao tự stretch theo hàng */
  display: flex;
  flex-direction: column;
}
body.kiosk-mode .leader-item p {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.1px;
  margin-bottom: 0;
}
body.kiosk-mode .leader-item .img-wrapper {
  /* Căn giữa bản thân cái wrapper so với thẻ cha (leader-item) */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 12px;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
}

/* Khi ẩn title: img-wrapper chiếm full width của card */
body.kiosk-mode .leader-item.no-title .img-wrapper {
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
}
body.kiosk-mode .leader-item .img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
body.kiosk-mode p.leader-role {
  color: #0284c7;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
  font-family: 'Be Vietnam Pro', sans-serif;
  /* Giữ chiều cao cố định = 2 dòng, clamp nếu vượt quá */
  /* min-height: 2rem;
    max-height: 2.4rem;
    margin-top: 10px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; */
  text-align: center;
  line-height: 1.4;
}
body.kiosk-mode p.leader-title {
  color: #717680;
}
body.kiosk-mode h4.leader-name {
  color: #000080;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 4px;
  font-family: 'Be Vietnam Pro', sans-serif;
  text-align: center;
}

/* Text section bên dưới ảnh: flex-grow để chiếm hết không gian còn lại */
body.kiosk-mode .leader-item .leader-text-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* text luôn căn xuống dưới */
}
body.kiosk-mode .leader-icon {
  width: 30px !important;
  height: 30px !important;
  padding: 4px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  aspect-ratio: 1/1 !important;
  position: absolute !important;
  right: 10px !important;
  top: 15px !important;
  z-index: 10 !important;
  cursor: pointer !important;
  background: rgba(233, 234, 235, 0.9) !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
}

body.kiosk-mode .leader-icon:hover {
  background: rgba(233, 234, 235, 1) !important;
  transform: scale(1.05) !important;
}

body.kiosk-mode .leader-icon svg {
  width: 100% !important;
  height: 100% !important;
}
.kiosk-btn {
  padding-left: 24px;
  padding-right: 24px;
}
.close-btn {
  background-color: #d5d7da;
}
/* ============================================
   IMAGES - Tối ưu hiển thị
   ============================================ */
body.kiosk-mode img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* ============================================
   BADGES & TAGS - Tăng kích thước
   ============================================ */
body.kiosk-mode .text-xs {
  font-size: 1rem;
}

body.kiosk-mode .px-2.py-1,
body.kiosk-mode .px-3.py-1 {
  padding: 0.75rem 1.25rem;
}

/* Year badges - chỉ áp dụng cho badges trong history, leader và artifact items, không áp dụng cho modal buttons */
body.kiosk-mode .history-item .absolute.top-4,
body.kiosk-mode .leader-item .absolute.top-4,
body.kiosk-mode .artifact-item .absolute.top-3 {
  top: 0;
  right: 0;
}

/* ============================================
   DETAIL BUTTONS - Tăng kích thước nút xem chi tiết
   ============================================ */
body.kiosk-mode .history-item button,
body.kiosk-mode .artifact-item button,
body.kiosk-mode .leader-item button,
body.kiosk-mode button[onclick*="openPeriodModal"],
/* body.kiosk-mode button[onclick*="openLibraryModal"], */
body.kiosk-mode button[onclick*="openUnitModal"],
body.kiosk-mode button[onclick*="openEventDetailModal"] {
  min-height: 60px !important;
  font-size: 1.25rem !important;
  padding: 1rem 1.5rem !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
}

body.kiosk-mode .history-item button svg,
body.kiosk-mode .artifact-item button svg,
body.kiosk-mode button[onclick*='openPeriodModal'] svg,
body.kiosk-mode button[onclick*='openLibraryModal'] svg,
body.kiosk-mode button[onclick*='openUnitModal'] svg,
body.kiosk-mode button[onclick*='openEventDetailModal'] svg {
  width: 1.5rem !important;
  height: 1.5rem !important;
}

/* ============================================
   UNITS HORIZONTAL SCROLL - Cuộn ngang cho Các đơn vị
   ============================================ */
body.kiosk-mode .units-horizontal-scroll {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body.kiosk-mode .units-horizontal-scroll::-webkit-scrollbar {
  height: 0;
  display: none;
}

body.kiosk-mode .unit-item-wrapper {
  min-width: 400px;
  max-width: 400px;
}

body.kiosk-mode .unit-item {
  height: 100%;
}

body.kiosk-mode .unit-item h4 {
  font-size: 1.5rem;
}

body.kiosk-mode .unit-item p {
  font-size: 1.125rem;
  line-height: 1.7;
}

body.kiosk-mode .unit-item button {
  min-height: 70px;
  font-size: 1.25rem;
  padding: 1.25rem 2rem;
}

/* Unit Modal */
body.kiosk-mode #unit-modal-close-btn {
  position: absolute !important;
  top: 1rem !important;
  right: 1rem !important;
  width: 4rem !important;
  height: 4rem !important;
  min-width: 4rem !important;
  min-height: 4rem !important;
  max-width: 4rem !important;
  max-height: 4rem !important;
  padding: 0 !important;
  border-radius: 9999px !important;
}

body.kiosk-mode #unit-modal .p-8 {
  padding: 3rem;
}

body.kiosk-mode #unit-modal h3 {
  font-size: 2.5rem;
}

body.kiosk-mode #unit-modal h4 {
  font-size: 1.75rem;
}

body.kiosk-mode #unit-modal p,
body.kiosk-mode #unit-modal li {
  font-size: 1.25rem;
  line-height: 1.8;
}

body.kiosk-mode #unit-modal button {
  min-height: 80px;
  font-size: 1.5rem;
}

/* ============================================
   ARTIFACTS HORIZONTAL SCROLL - Cuộn ngang cho Hiện vật
   ============================================ */
.library-filter-tab {
  border: 1px solid var(--Brand-Emphasis-brand-primary, #ab0e20);
  background: var(--Common-role-text-text-CTA, #fff);
  display: flex;
  padding: 12px 60px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  align-self: stretch;
}
.library-tabs {
  border-bottom: 1px solid #ab0e20;
}
.library-tabs button:not(:last-child) {
  border-right: none;
}
.library-tabs button {
  background-color: #e9eaeb;
  color: #ab0e20;
  font-size: 1.5rem;
}
.library-tabs button.active {
  background-color: #fff;
}

body.kiosk-mode .artifacts-timeline-container {
  padding: 0;
}

body.kiosk-mode .artifacts-horizontal-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 400px;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 2rem;
  padding: 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body.kiosk-mode .artifacts-horizontal-scroll::-webkit-scrollbar {
  height: 0;
  display: none;
}

body.kiosk-mode .artifact-item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Fix chiều cao đồng đều cho artifact items */
body.kiosk-mode .artifact-item .aspect-square {
  height: 250px;
  flex-shrink: 0;
}

body.kiosk-mode .artifact-item h4 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  min-height: 3.6rem;
  max-height: 3.6rem;
  padding-bottom: 4.6rem;
}

/* Đảm bảo content area có flex-grow */
body.kiosk-mode .artifact-item .p-5 {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Đảm bảo nút luôn ở bottom */
body.kiosk-mode .artifact-item .flex.justify-center {
  margin-top: auto;
}

/* ============================================
   ANIMATIONS - Mượt mà hơn
   ============================================ */
body.kiosk-mode .transition-all {
  transition-duration: 200ms;
}

body.kiosk-mode .fade-in {
  animation: kiosk-fadeIn 0.6s ease-in-out;
}

@keyframes kiosk-fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
body.kiosk-mode #scroll-to-top {
  width: 60px;
  height: 60px;
  bottom: 1rem;
  right: 1rem;
  font-size: 1.5rem;
}

body.kiosk-mode #scroll-to-top svg {
  width: 2rem;
  height: 2rem;
}

/* ============================================
   IDLE WARNING - Cảnh báo không hoạt động
   ============================================ */
body.kiosk-mode #idle-warning .p-12 {
  padding: 3rem;
}

body.kiosk-mode #idle-warning .text-6xl {
  font-size: 5rem;
}

body.kiosk-mode #idle-warning .text-3xl {
  font-size: 2.5rem;
}

body.kiosk-mode #idle-warning .text-xl {
  font-size: 1.5rem;
}

body.kiosk-mode #idle-warning button {
  min-height: 90px;
  padding: 2rem 3rem;
  font-size: 1.75rem;
}

/* ============================================
   ACCESSIBILITY - Tăng cường khả năng tiếp cận
   ============================================ */
body.kiosk-mode :focus {
  outline: 1px solid #d5d7da;
  outline-offset: 1px;
}

body.kiosk-mode button:focus {
  box-shadow: 0 0 0 4px #d5d7da;
}

/* ============================================
   MODAL CONTENT UL LI STYLES
   ============================================ */
#unit-modal ul,
#history-modal ul,
#leader-modal ul,
#artifact-modal ul {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 1rem 0 !important;
}

#unit-modal ul li,
#history-modal ul li,
#leader-modal ul li,
#artifact-modal ul li {
  position: relative !important;
  padding-left: 2rem !important;
  margin-bottom: 0.75rem !important;
  line-height: 1.6 !important;
  list-style: none !important;
}

#unit-modal ul li::before,
#history-modal ul li::before,
#leader-modal ul li::before,
#artifact-modal ul li::before {
  content: '✓' !important;
  position: absolute !important;
  left: 0 !important;
  top: 0.6rem !important;
  width: 1.25rem !important;
  height: 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #0066cc !important;
  font-size: 1rem !important;
  font-weight: bold !important;
  border: 2px solid #0066cc !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

#unit-modal ul li.flex,
#history-modal ul li.flex,
#leader-modal ul li.flex,
#artifact-modal ul li.flex {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  padding-left: 0 !important;
}

#unit-modal ul li.flex::before,
#history-modal ul li.flex::before,
#leader-modal ul li.flex::before,
#artifact-modal ul li.flex::before {
  display: none !important;
}

/* ============================================
   LOADING STATES - Trạng thái loading
   ============================================ */
body.kiosk-mode .loading {
  pointer-events: none;
  opacity: 0.6;
}

body.kiosk-mode .loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #f3f4f6;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.size-full {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
}
/* Alignments
--------------------------------------------- */
.alignleft {
  /*rtl:ignore*/
  float: left;

  /*rtl:ignore*/
  margin-right: 1.5em;
  margin-bottom: 1.5em;
}

.alignright {
  /*rtl:ignore*/
  float: right;

  /*rtl:ignore*/
  margin-left: 1.5em;
  margin-bottom: 1.5em;
}

.aligncenter {
  clear: both;
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5em;
}
