/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f7fb;
  color: #222;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* ===== MENU ===== */
#menu {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.menu-item {
  position: relative;
  padding: 6px 12px;
  background: #eef2ff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.menu-item:hover {
  background: #dbeafe;
}

/* ===== SUBMENU ===== */
.menu-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* item cha */
.menu-item {
  position: relative;
}

.menu-label {
  padding: 5px 10px;
  background: #eef2ff;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-transform:capitalize;
}


.menu-item.active > .menu-label {
  background: #04205e;
  color: #fff;
}

/* ===== DROPDOWN ===== */
.submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  padding: 5px;
  display: none;
  z-index: 9999;
  max-height: 60vh;
  overflow-y: auto;
}

/* mũi tên nhỏ */
.submenu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  border-left: 1px solid #e5e7eb;
  border-top: 1px solid #e5e7eb;
}

/* mở dropdown */
.menu-item.open > .submenu {
  display: block;
}

/* item con */
.submenu .menu-item {
  margin: 2px 0;
}

.submenu .menu-label {
  border-radius: 8px;
  padding: 5px 8px;
  background: transparent;
}


/* search trong submenu */
.submenu-search {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .menu-bar {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .submenu {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 70px;
    max-height: 70vh;
  }
}


/* ===== CONTROLS ===== */
.controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

select,
button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  cursor: pointer;
}

button:hover,
select:hover {
  background: #f3f4f6;
}

/* ===== SESSION TIMER ===== */
#sessionTimer {
  font-weight: 600;
  color: #2563eb;
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), 1fr);
  gap: 12px;
  padding: 16px;
}

@media (min-width: 768px) {
  .gallery-grid {
    --cols: 3;
  }
}

.gallery-item {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  /* quan trọng */
  aspect-ratio: 1 / 1; /* ảnh vuông đều */
  display: flex;
}

.gallery-item:hover {
  cursor: pointer;

  transform: translateY(-3px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* cắt đều ảnh */
  display: block;
}

/* ===== PAGINATION ===== */
#pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px;
}

#pagination button {
  min-width: 36px;
}

#pagination button.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.lightbox img {
  max-width: 92%;
  max-height: 92%;
  border-radius: 8px;
  animation: zoomIn 0.25s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #dbeafe, #eef2ff);
}

.login-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  width: 300px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.login-card h1 {
  text-align: center;
  margin-bottom: 16px;
}

.login-card input {
  width: 100%;
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}

.login-card button {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 10px;
}

.login-card button:hover {
  background: #1d4ed8;
}

.error {
  color: #dc2626;
  text-align: center;
  margin-top: 8px;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
  font-size: 16px;
  opacity: 0.6;
}

.toggle-password:hover {
  opacity: 1;
}

img.lazy {
  filter: blur(10px);
  transform: scale(1.05);
  transition: filter 0.4s ease, transform 0.4s ease;
}

img:not(.lazy) {
  filter: blur(0);
  transform: scale(1);
}

@media (max-width: 768px) {
  #menu {
    position: static; /* ⬅️ QUAN TRỌNG */
    top: auto;
    max-height: none;
    overflow: visible;
  }
}
.menu-item.active   {
  background: #04205e;
}


/* ================= HEADER COLLAPSE ================= */
header {
  transition: transform 0.25s ease;
}

header.hide {
  transform: translateY(-100%);
}
#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: none;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.gallery-item.active {
  outline: 3px solid #4f7cff;
}

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.controls {
  display: flex;
  gap: 8px;
}

.submenu-search {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}

/* ===== HEADER COLLAPSE ===== */
header {
  transition: transform 0.3s ease;
}
header.collapsed {
  display: none;
}

/* VIDEO GALLERY */
.video-gallery {
  margin-bottom: 40px;
}

.video-card {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transition: transform .2s ease;
}

.video-card:hover {
  transform: translateY(-4px);
}

/* ===== VIDEO WRAPPER ===== */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== PLAY BUTTON CENTER ===== */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.25);
  pointer-events: none;
  transition: opacity .3s;
}

.video-wrapper iframe[src] + .play-overlay,
.video-wrapper iframe:not([data-src]) + .play-overlay {
  opacity: 0;
}

/* ===== TITLE ===== */
.video-title {
  font-weight: 600;
  margin-top: 8px;
  text-transform: capitalize;
}

/* ===== PAGINATION ===== */
.pagination .page-link {
  border-radius: 8px;
}

div[style*="position: fixed"][style*="bottom: 0"] {
    display: none !important;
}
center{
    display:none
}