/* ── Đêm trên biển Đông ───────────────────────────────────────
   nền đêm   #0A1420   xanh đêm sâu
   biển      #0E2233
   ngọc      #7FD1AE   xanh ngọc đất liền
   vàng lá   #FFCD00   điểm nhấn
   ngà       #EFE6D0   chữ chính
   khói biển #8FA3B0   chữ phụ
──────────────────────────────────────────────────────────────── */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  background: #08101a;
  color: #efe6d0;
}

#app { position: fixed; inset: 0; }
#app canvas { display: block; }

/* ── Tiêu đề ── */
.masthead {
  position: fixed;
  top: clamp(20px, 4.5vh, 48px);
  left: clamp(20px, 4vw, 56px);
  pointer-events: none;
  user-select: none;
  z-index: 3;
}

.eyebrow {
  font-size: clamp(10px, 1.05vw, 13px);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #ffcd00;
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(255, 205, 0, 0.4);
}

.masthead h1 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.015em;
  background: linear-gradient(135deg, #ffffff 30%, #7fd1ae 70%, #ffcd00 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 4s linear infinite;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

@keyframes shine {
  to { background-position: 200% center; }
}

.masthead .sub {
  margin-top: 10px;
  font-size: clamp(12px, 1.25vw, 15px);
  font-style: italic;
  color: #8fa3b0;
}

.masthead .sub::before {
  content: '';
  display: inline-block;
  width: 34px;
  height: 1px;
  background: #8fa3b0;
  opacity: 0.6;
  vertical-align: middle;
  margin-right: 10px;
}

/* ── Thẻ thông tin tỉnh ── */
.card {
  position: fixed;
  left: clamp(20px, 4vw, 56px);
  bottom: clamp(20px, 4.5vh, 48px);
  width: min(380px, calc(100vw - 40px));
  max-height: calc(100vh - 120px);
  border-radius: 20px;
  background: rgba(10, 22, 34, 0.86);
  border: 1px solid rgba(127, 209, 174, 0.25);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 
              0 0 30px rgba(127, 209, 174, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 3;
  pointer-events: auto; /* Để có thể cuộn nội dung Card */
  user-select: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card.show { opacity: 1; transform: translateY(0); }

/* Card content fade when switching province/language */
.card-content.switching {
  opacity: 0;
  transition: opacity 0.18s ease;
}
.card-content.switching-in {
  opacity: 1;
  transition: opacity 0.22s ease;
}

.card-img-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  background: #060b12;
  display: none; /* Hidden by default — shown via JS when image available */
}

.card-img-container.visible {
  display: block;
}

.card-img-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(10, 22, 34, 0.95));
  pointer-events: none;
  z-index: 1;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease;
  opacity: 0;
  display: block;
}

.card-image.loaded {
  opacity: 1;
}

.card.show .card-image.loaded {
  transform: scale(1.06);
}

/* Shimmer loading placeholder */
.card-img-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(127, 209, 174, 0.04) 25%,
    rgba(127, 209, 174, 0.12) 50%,
    rgba(127, 209, 174, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  z-index: 0;
}

.card-img-shimmer.hidden {
  display: none;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.card-content {
  padding: 18px 22px 20px;
  overflow-y: auto;
  flex: 1;
  /* Custom scrollbar mượt */
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 209, 174, 0.2) transparent;
}

.card-content::-webkit-scrollbar {
  width: 4px;
}

.card-content::-webkit-scrollbar-thumb {
  background: rgba(127, 209, 174, 0.2);
  border-radius: 4px;
}

.card-type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #7fd1ae;
  opacity: 0.85;
}

.card-name {
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 800;
  background: linear-gradient(to right, #ffcd00, #ffe875);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 6px 0 8px;
  line-height: 1.15;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-landmark {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 205, 0, 0.15) 0%, rgba(255, 205, 0, 0.05) 100%);
  border: 1px solid rgba(255, 205, 0, 0.25);
  font-size: 11.5px;
  font-weight: 700;
  color: #ffcd00;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(255, 205, 0, 0.05);
  transition: all 0.3s ease;
}

.card-landmark:hover {
  background: linear-gradient(135deg, rgba(255, 205, 0, 0.2) 0%, rgba(255, 205, 0, 0.1) 100%);
  border-color: rgba(255, 205, 0, 0.45);
  box-shadow: 0 4px 15px rgba(255, 205, 0, 0.15);
}

.card-landmark-icon { font-size: 9px; }

.card-landmark:empty,
.card-landmark[style*="display: none"] {
  display: none !important;
}

.card-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #efe6d0;
  opacity: 0.9;
  margin-bottom: 16px;
  text-align: justify;
}

.card-section {
  margin-top: 16px;
}

.card-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #7fd1ae;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  border-left: 2px solid #7fd1ae;
  padding-left: 8px;
}

.card-experiences-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-experiences-list li {
  font-size: 12.5px;
  color: #efe6d0;
  opacity: 0.85;
  line-height: 1.45;
  position: relative;
  padding-left: 16px;
}

.card-experiences-list li::before {
  content: '✦';
  color: #ffcd00;
  position: absolute;
  left: 0;
  font-size: 11px;
  top: 1px;
  text-shadow: 0 0 5px rgba(255, 205, 0, 0.7);
}

.card-foods-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.card-foods-tags span {
  font-size: 11.5px;
  color: #efe6d0;
  background: linear-gradient(135deg, rgba(127, 209, 174, 0.04) 0%, rgba(127, 209, 174, 0.08) 100%);
  border: 1px solid rgba(127, 209, 174, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-foods-tags span:hover {
  background: linear-gradient(135deg, rgba(255, 205, 0, 0.15) 0%, rgba(127, 209, 174, 0.15) 100%);
  border-color: #ffcd00;
  color: #ffcd00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 205, 0, 0.1);
}

.card-facts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(143, 163, 176, 0.15);
  font-size: 11px;
  color: #8fa3b0;
}

.card-facts span:empty { display: none; }

/* ── Gợi ý ── */
.hint {
  position: fixed;
  left: 50%;
  bottom: clamp(14px, 3vh, 28px);
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #8fa3b0;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 3;
  opacity: 0;
  animation: hint-in 1.2s ease 2.2s forwards;
}

@keyframes hint-in { to { opacity: 0.85; } }

/* ── Nút chuyến tàu Thống Nhất ── */
.train-btn {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(44px, 8vh, 72px);
  z-index: 3;
  padding: 11px 24px;
  border: 1px solid rgba(127, 209, 174, 0.35);
  border-radius: 999px;
  background: rgba(10, 22, 34, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #efe6d0;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.train-btn:hover {
  transform: translateX(-50%) translateY(-3px);
  border-color: #ffcd00;
  background: rgba(14, 34, 51, 0.85);
  color: #ffcd00;
  box-shadow: 0 12px 30px rgba(255, 205, 0, 0.2), 0 0 15px rgba(127, 209, 174, 0.1);
}

.train-btn:focus-visible { outline: 2px solid #ffcd00; outline-offset: 2px; }

.train-btn.hidden { display: none; }

/* ── Language Toggle Button ── */
.lang-btn {
  position: fixed;
  right: clamp(20px, 4vw, 56px);
  top: clamp(20px, 4.5vh, 48px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid rgba(127, 209, 174, 0.3);
  border-radius: 999px;
  background: rgba(10, 22, 34, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #efe6d0;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lang-btn:hover {
  transform: translateY(-3px);
  border-color: #7fd1ae;
  background: rgba(14, 34, 51, 0.85);
  box-shadow: 0 12px 30px rgba(127, 209, 174, 0.2);
}

.lang-btn:focus-visible {
  outline: 2px solid #7fd1ae;
  outline-offset: 2px;
}

.lang-btn.active-en {
  border-color: rgba(255, 205, 0, 0.5);
  color: #ffcd00;
}

.lang-flag { font-size: 15px; line-height: 1; }
.lang-label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; }

/* ── Watermark invietnam.vn ── */
.brand {
  position: fixed;
  right: clamp(20px, 4vw, 56px);
  bottom: clamp(20px, 4.5vh, 48px);
  z-index: 4;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(10, 22, 34, 0.75);
  border: 1px solid rgba(255, 205, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffcd00;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.brand span { color: #efe6d0; font-weight: 600; }

.brand:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 205, 0, 0.8);
  box-shadow: 0 12px 30px rgba(255, 205, 0, 0.25);
}

.brand:focus-visible {
  outline: 2px solid #ffcd00;
  outline-offset: 2px;
}

/* ── Màn hình chờ ── */
.loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #0e2233 0%, #0a1420 100%);
  z-index: 999;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.loader.done { opacity: 0; pointer-events: none; }

.loader-spinner {
  width: 64px;
  height: 64px;
  border: 2px solid rgba(127, 209, 174, 0.1);
  border-radius: 50%;
  border-top-color: #ffcd00;
  border-right-color: #7fd1ae;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 0 0 20px rgba(255, 205, 0, 0.15);
}

.loader-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.25em;
  background: linear-gradient(135deg, #ffcd00 0%, #7fd1ae 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
  animation: logo-fade 2s ease-in-out infinite alternate;
}

.loader-text {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #8fa3b0;
  animation: pulse-text 1.6s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes logo-fade {
  from { filter: drop-shadow(0 0 2px rgba(255,205,0,0.2)); }
  to { filter: drop-shadow(0 0 8px rgba(127,209,174,0.4)); }
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.95; }
}

/* ── Nút Day/Night Toggle ── */
.theme-btn {
  position: fixed;
  right: calc(clamp(20px, 4vw, 56px) + 96px); /* Nằm bên cạnh lang-btn */
  top: clamp(20px, 4.5vh, 48px);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(127, 209, 174, 0.3);
  border-radius: 50%;
  background: rgba(10, 22, 34, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #efe6d0;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.theme-btn:hover {
  transform: translateY(-3px);
  border-color: #ffcd00;
  background: rgba(14, 34, 51, 0.85);
  color: #ffcd00;
  box-shadow: 0 12px 30px rgba(255, 205, 0, 0.2);
}

.theme-btn:focus-visible {
  outline: 2px solid #ffcd00;
  outline-offset: 2px;
}

.theme-icon { font-size: 16px; line-height: 1; }

/* ── Light Theme Style ── */
body.light-theme {
  background: radial-gradient(circle at 50% 30%, #e2eef2 0%, #cbdfe5 100%);
  color: #1e293b;
}

body.light-theme .masthead h1 {
  background: linear-gradient(135deg, #0f172a 30%, #0d9488 70%, #d97706 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(15, 23, 42, 0.1);
}

body.light-theme .masthead .sub {
  color: #475569;
}

body.light-theme .card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(13, 148, 136, 0.25);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15), 
              0 0 30px rgba(13, 148, 136, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme .card-type {
  color: #0d9488;
}

body.light-theme .card-name {
  background: linear-gradient(to right, #d97706, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .card-landmark {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12) 0%, rgba(217, 119, 6, 0.04) 100%);
  border-color: rgba(217, 119, 6, 0.25);
  color: #d97706;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.06);
}

body.light-theme .card-landmark:hover {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.18) 0%, rgba(217, 119, 6, 0.08) 100%);
  border-color: rgba(217, 119, 6, 0.4);
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.12);
}

body.light-theme .card-desc {
  color: #334155;
}

body.light-theme .card-experiences-list li {
  color: #334155;
}

body.light-theme .card-experiences-list li::before {
  color: #d97706;
  text-shadow: 0 0 4px rgba(217, 119, 6, 0.4);
}

body.light-theme .card-section-title {
  color: #0d9488;
  border-left-color: #0d9488;
}

body.light-theme .card-foods-tags span {
  color: #334155;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.04) 0%, rgba(13, 148, 136, 0.08) 100%);
  border-color: rgba(13, 148, 136, 0.18);
}

body.light-theme .card-foods-tags span:hover {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(13, 148, 136, 0.15) 100%);
  border-color: #d97706;
  color: #d97706;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.1);
}

body.light-theme .card-facts {
  border-top-color: rgba(15, 23, 42, 0.1);
  color: #64748b;
}

body.light-theme .train-btn,
body.light-theme .lang-btn,
body.light-theme .theme-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(13, 148, 136, 0.25);
  color: #334155;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme .train-btn:hover {
  border-color: #d97706;
  color: #d97706;
  background: #f8fafc;
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.15);
}

body.light-theme .lang-btn:hover,
body.light-theme .theme-btn:hover {
  border-color: #0d9488;
  background: #f8fafc;
  box-shadow: 0 12px 30px rgba(13, 148, 136, 0.15);
}

body.light-theme .theme-btn:hover {
  color: #d97706;
  border-color: #d97706;
}

body.light-theme .brand {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(217, 119, 6, 0.3);
  color: #d97706;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme .brand span {
  color: #334155;
}

body.light-theme .brand:hover {
  border-color: #d97706;
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.2);
}

body.light-theme .loader {
  background: radial-gradient(circle at center, #e2eef2 0%, #cbdfe5 100%);
}

body.light-theme .loader-spinner {
  border-color: rgba(13, 148, 136, 0.15);
  border-top-color: #d97706;
  border-right-color: #0d9488;
}

body.light-theme .loader-logo {
  background: linear-gradient(135deg, #d97706 0%, #0d9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .loader-text {
  color: #64748b;
}

body.light-theme .eyebrow {
  color: #d97706;
  text-shadow: 0 0 8px rgba(217, 119, 6, 0.25);
}

/* ── Hộp tìm kiếm và lọc tỉnh thành ── */
.search-box {
  position: fixed;
  top: calc(clamp(20px, 4.5vh, 48px) + clamp(36px, 5vw, 64px) + 26px); /* Nằm dưới masthead h1 + sub */
  left: clamp(20px, 4vw, 56px);
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
  pointer-events: auto;
}

.search-input-wrapper,
.search-select-wrapper {
  position: relative;
  width: 100%;
}

#province-search,
#province-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(10, 22, 34, 0.72);
  border: 1px solid rgba(127, 209, 174, 0.25);
  font-family: inherit;
  font-size: 13px;
  color: #efe6d0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#province-search:focus,
#province-select:focus {
  border-color: #ffcd00;
  box-shadow: 0 0 15px rgba(255, 205, 0, 0.15), 0 4px 20px rgba(0, 0, 0, 0.4);
}

#province-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'><path d='M1 1l4 4 4-4' stroke='%23ffcd00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 6px;
  padding-right: 32px;
}

#province-select option {
  background: #0a1622;
  color: #efe6d0;
}

/* Nút xóa tìm kiếm */
.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #8fa3b0;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.search-clear-btn:hover {
  color: #ffcd00;
  background: rgba(255, 255, 255, 0.08);
}

/* Khung gợi ý Autocomplete */
.suggestions-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 10px;
  background: rgba(10, 22, 34, 0.92);
  border: 1px solid rgba(127, 209, 174, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 5;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 209, 174, 0.2) transparent;
}

.suggestions-list::-webkit-scrollbar {
  width: 3px;
}
.suggestions-list::-webkit-scrollbar-thumb {
  background: rgba(127, 209, 174, 0.2);
  border-radius: 4px;
}

.suggestions-item {
  padding: 8px 14px;
  font-size: 12.5px;
  color: #efe6d0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.suggestions-item:hover {
  background: rgba(255, 205, 0, 0.12);
  color: #ffcd00;
  padding-left: 18px;
}

/* ── Light Theme cho Hộp tìm kiếm ── */
body.light-theme #province-search {
  background: rgba(255, 255, 255, 0.8);
}

body.light-theme #province-select {
  background-color: rgba(255, 255, 255, 0.8);
}

body.light-theme #province-search,
body.light-theme #province-select {
  border-color: rgba(13, 148, 136, 0.25);
  color: #334155;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme #province-select option {
  background: #ffffff;
  color: #334155;
}

body.light-theme #province-search:focus,
body.light-theme #province-select:focus {
  border-color: #d97706;
  box-shadow: 0 0 15px rgba(217, 119, 6, 0.15), 0 4px 20px rgba(15, 23, 42, 0.1);
}

body.light-theme #province-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'><path d='M1 1l4 4 4-4' stroke='%23d97706' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

body.light-theme .search-clear-btn {
  color: #64748b;
}

body.light-theme .search-clear-btn:hover {
  color: #d97706;
  background: rgba(15, 23, 42, 0.05);
}

body.light-theme .suggestions-list {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(13, 148, 136, 0.25);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

body.light-theme .suggestions-item {
  color: #334155;
}

body.light-theme .suggestions-item:hover {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}

@media (prefers-reduced-motion: reduce) {
  .hint { animation: none; opacity: 0.85; }
  .loader span { animation: none; }
}

@media (max-width: 640px) {
  .hint { display: none; }
  .card {
    left: 12px;
    right: 12px;
    bottom: 60px; /* chừa chỗ cho nút tàu phía dưới */
    width: auto;
    padding: 14px 16px 12px;
    max-height: 55vh;
  }
  .train-btn { bottom: 14px; font-size: 13px; padding: 9px 16px; }
  .card-name { font-size: 22px; }
  /* lang button dời xuống dưới brand */
  .lang-btn {
    top: auto;
    bottom: calc(clamp(20px, 4.5vh, 48px) + 56px);
  }
  .theme-btn {
    top: auto;
    bottom: calc(clamp(20px, 4.5vh, 48px) + 56px);
    right: calc(clamp(20px, 4vw, 56px) + 96px);
  }
  /* watermark dời lên trên để không đè thẻ thông tin */
  .brand {
    bottom: auto;
    top: clamp(20px, 4.5vh, 48px);
    right: 16px;
    font-size: 12px;
    padding: 6px 11px;
  }
  .search-box {
    position: fixed;
    top: calc(clamp(20px, 4.5vh, 48px) + 56px); /* Đẩy xuống dưới masthead trên mobile */
    left: 12px;
    right: 12px;
    width: auto;
    flex-direction: row;
    gap: 6px;
  }
  .search-input-wrapper,
  .search-select-wrapper {
    flex: 1;
  }
  #province-search,
  #province-select {
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 8px;
  }
  #province-select {
    background-position: right 8px center;
    padding-right: 24px;
  }
}
