:root {
  /* Light mode */
  --text: #1f3b63;
  --card: #ffffff;
  --stroke: #e6e9ef;
  --btn1: #3b82f6;
  /* blue-500 */
  --btn2: #2563eb;
  /* blue-600 */
  --bg-gradient: linear-gradient(180deg, #ECF3FF 0%, #FFFFFF 100%);
  --slider-btn-color: #000000; /* đen */
  --train-link: #252525;
}

body.dark {
  /* Dark mode overrides */
  --text: #e5e7eb;
  /* text-gray-200 */
  --card: #1f2937;
  /* gray-800 */
  --stroke: #374151;
  /* gray-700 */
  --btn1: #2563eb;
  /* blue-600 */
  --btn2: #1d4ed8;
  /* blue-700 */
  --bg-gradient: linear-gradient(180deg, #111827 0%, #1f2937 100%);
  --slider-btn-color: #ffffff; /* trắng */
  --train-link: #e5e7eb;
}

* {
  box-sizing: border-box
}

html, body {
  width: 100%;
  overflow-x: hidden; /* chống tràn ngang trên mobile */
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, Arial;
  color: var(--text);
  /* height: 100%; width: 100%;  <-- BỎ */
  background: var(--bg-gradient);
}

.content {
  display: flex;
  width: 100%;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  /* padding-top: calc(100px + env(safe-area-inset-top)); */
}

header {
  text-align: center;
  padding: 40px 16px 10px;
  margin-top: 16px;
}

.container {
  max-width: 800px;
  margin: auto;
  padding: 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: background 0.3s ease, border-color 0.3s ease;
}

h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  font-size: clamp(28px, 6vw, 48px)
}

h2 {
  margin: 0 0 24px;
  font-weight: 500;
  color: var(--text);
}

.options,
.buttons {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 16px;
  margin-bottom: 18px;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--stroke);
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .04);
  text-decoration: none;
  color: var(--bg-gradient);
}

.btn {
  padding: 14px 28px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: inline-block;
  background: linear-gradient(90deg, var(--btn1), var(--btn2));
  box-shadow: 0 6px 18px rgba(37, 99, 235, .25);
  transition: .25s transform;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02)
}

/* --- Video + QR layout --- */
.media-wrap {
  max-width: 1100px;
  margin: 24px auto 48px;
  padding: 0 16px;
}

.media {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 18px;
  align-items: start;
}

.qr-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .06);
}

.qr-card img {
  /* width: 100%;
  height: auto;
  border-radius: 8px */
  width: 100%;
  max-width: 220px;   /* to nhất trên desktop */
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.qr-title {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  /* margin: 8px 0 0;
  font-weight: 600;
  font-size: 14px */
}

@media (max-width:768px) {
  
  header { padding: 24px 12px 6px; }
  /* .topbar { justify-content: space-between;} */
  .slider-track .slide {
    aspect-ratio: 16 / 9;
    max-height: 280px;           /* thấp hơn chút cho màn nhỏ */
  }
  .media {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center; /* căn giữa các QR */
  }

  .qr-card {
    max-width: 280px; /* QR không quá to */
    width: 100%;
  }
}

.slider {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
}

.slide {
  position: relative;
}

.slider-track {
  display: flex;
  transition: transform 0.4s ease-in-out;
}

.slider-track .slide {
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;          /* tỉ lệ mặc định đẹp */
  max-height: 360px;
}

.slide img {
  width: 100%;  
  height: 100%;
  object-fit: contain; /* trước là fill */
  background: #00000010;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slider-btn-color);
  background-color: transparent;
  border: none;
  padding: 10px 14px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.2s;
  z-index: 100;
}

.slider-btn.prev {
  left: 10px;
}

.slider-btn.next {
  right: 10px;
}

.zoom-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 50%;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 16px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 200;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  display: block;
  margin: auto;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}

.topbar{
  position: static;
  width: 100%;
  display: flex;
  justify-content: flex-end;     /* đẩy link + nút về góc phải */
  align-items: center;
  /* gap: 0px; */
  margin-top: 8px;
  margin-bottom: 12px;           /* tạo khoảng cách với header */
  padding: 0 12px;
  z-index: 1;
}

.train-link {
  /* position: fixed;
  top: 30px;
  right: 80px;
  display: flex;
  align-items: center;
  height: 44px;
  text-decoration: none;
  color: var(--train-link);
  transition: color .2s ease-in-out; */
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card);
  color: var(--train-link);
  text-decoration: none;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  
}

.train-link:hover {
  /* opacity: 70%; */
  opacity: .85;
}

.theme-toggle {
  /* position: fixed;
  top: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--btn-bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
  z-index: 30 */
  position: static;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--btn-bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
  z-index: 1;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover)
}

.theme-toggle:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--focus), white 20%);
  outline-offset: 3px
}

.theme-toggle .icon {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
  transform-origin: 50% 50%
}

.theme-toggle.spin .icon {
  animation: toggle-spin 480ms ease-in-out
}

@keyframes toggle-spin {
  from {
    transform: rotate(0) scale(1)
  }

  50% {
    transform: rotate(140deg) scale(1.05)
  }

  to {
    transform: rotate(180deg) scale(1)
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}