/* ==========================================================================
   BÀI TỚI CỐ ĐÔ — GLOBAL LAYOUT, NAVIGATION, MODALS & FLOATING WIDGETS
   ========================================================================== */

/* Skip to content link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  background: var(--bt-gold);
  color: var(--ink-dark);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
}
.skip-link:focus {
  top: 1rem;
}

/* Main sticky FloatingNavigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--nav-h);
  background: rgba(24, 5, 16, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 3px solid var(--bt-gold);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.42);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 3px;
  background: linear-gradient(90deg, var(--bt-crimson), var(--bt-pink), var(--bt-orange), var(--bt-cyan), var(--bt-crimson));
  pointer-events: none;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid var(--bt-gold);
  background: linear-gradient(145deg, var(--bt-crimson), var(--bt-blue));
  display: grid;
  place-items: center;
  color: var(--bt-gold);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  box-shadow: 0 0 14px rgba(232, 184, 75, 0.35);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.12rem;
  color: var(--bt-paper);
  letter-spacing: 0.03em;
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--bt-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  position: relative;
  padding: 0.45rem 0.72rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-light);
  white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast);
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(243, 106, 158, 0.16);
  color: var(--bt-gold);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 18%; right: 18%; bottom: 2px;
  height: 2px;
  background: var(--bt-cyan);
}

/* Nav Dropdown wrapper */
.nav-dropdown {
  position: relative;
}

.nav-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 225px;
  padding: 0.55rem;
  border-radius: var(--radius-md);
  background: #1B0714;
  border: 2px solid var(--bt-gold);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 180ms ease;
  z-index: 950;
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--ink-light);
}

.nav-dropdown__item:hover {
  background: rgba(22, 188, 228, 0.16);
  color: var(--bt-gold);
}

/* Header utilities */
.nav-utils {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.icon-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 170, 0.42);
  background: rgba(9, 43, 87, 0.65);
  color: var(--bt-paper);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur-fast);
}

.icon-pill-btn:hover {
  border-color: var(--bt-cyan);
  background: rgba(22, 188, 228, 0.22);
}

.icon-pill-btn.is-on {
  border-color: var(--bt-gold);
  background: rgba(145, 27, 60, 0.78);
  color: var(--bt-gold);
}

.pill-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bt-orange);
  color: #FFF;
  font-size: 0.68rem;
  font-weight: 800;
}

.mobile-menu-btn {
  display: none;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid var(--bt-gold);
  background: rgba(145, 27, 60, 0.65);
  color: var(--bt-paper);
  font-weight: 700;
  cursor: pointer;
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 4, 12, 0.75);
}

.mobile-drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(86vw, 350px);
  background: linear-gradient(175deg, #3D0819 0%, #092B57 100%);
  border-left: 3px solid var(--bt-gold);
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-drawer__link {
  display: block;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  color: var(--bt-paper);
  border: 1px solid rgba(255, 214, 170, 0.14);
}

.mobile-drawer__link:hover {
  background: rgba(244, 123, 50, 0.2);
  color: var(--bt-gold);
}

@media (max-width: 1120px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: inline-flex; align-items: center; gap: 0.35rem; }
  .hide-sm { display: none; }
}

@media (max-width: 560px) {
  .nav-inner { padding: 0 0.65rem; gap: 0.35rem; }
  .brand-mark { gap: 0.4rem; min-width: 0; flex-shrink: 1; }
  .brand-emblem { width: 30px; height: 30px; font-size: 0.85rem; flex-shrink: 0; }
  .brand-title { font-size: 0.92rem; white-space: nowrap; }
  .brand-sub { display: none; }
  .nav-utils { gap: 0.25rem; }
  .icon-pill-btn { padding: 0.34rem 0.45rem; font-size: 0.72rem; gap: 0.2rem; }
  .pill-count { min-width: 16px; height: 16px; font-size: 0.64rem; }
  #btn-motion-toggle { display: none; }
  .mobile-menu-btn { padding: 0.36rem 0.56rem; font-size: 0.78rem; }
  .floating-draw-btn { right: 0.75rem; bottom: 0.75rem; padding: 0.58rem 0.92rem; font-size: 0.82rem; }
  .floating-draw-btn__card-icon { width: 11px; height: 22px; }
}

/* Main Content Wrapper */
.app-view {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--nav-h) - 240px);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

.page-section {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}

.page-hero {
  padding: clamp(2.2rem, 5vw, 3.8rem) 0 clamp(1.8rem, 4vw, 2.5rem);
  border-bottom: 2px solid rgba(232, 184, 75, 0.35);
  background: radial-gradient(circle at 50% 0%, rgba(145, 27, 60, 0.45), transparent 72%);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  line-height: 1.12;
  margin: 0.55rem 0 0.85rem;
  color: var(--bt-paper);
}

.page-hero__lead {
  max-width: 780px;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--ink-light-muted);
  margin: 0;
}

/* Floating "Rút Một Lá" Action Button */
.floating-draw-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 880;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.78rem 1.25rem;
  border-radius: 999px;
  border: 2.5px solid var(--bt-gold);
  background: linear-gradient(135deg, #911B3C 0%, #D9368B 52%, #F47B32 100%);
  color: #FFFDF8;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(9, 15, 42, 0.65), 0 0 0 3px rgba(22, 188, 228, 0.35);
  transition: transform 220ms var(--ease-imperial), box-shadow 220ms;
}

.floating-draw-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 18px 38px rgba(244, 123, 50, 0.55), 0 0 0 4px var(--bt-cyan);
}

.floating-draw-btn__card-icon {
  display: inline-block;
  width: 14px;
  height: 28px;
  border-radius: 3px;
  border: 1.5px solid var(--bt-gold);
  background: linear-gradient(180deg, #092B57, #911B3C);
}

/* Modals */
.bt-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bt-modal.is-open {
  display: flex;
}

.bt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 14, 0.84);
  backdrop-filter: blur(8px);
}

.bt-modal__dialog {
  position: relative;
  width: min(100%, 960px);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #2B0715 0%, #092B57 100%);
  border: 3px solid var(--bt-gold);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72), 0 0 0 4px rgba(243, 106, 158, 0.35);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  color: var(--ink-light);
  z-index: 2;
}

.bt-modal__close {
  position: sticky;
  top: 0;
  float: right;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--bt-gold);
  background: var(--bt-crimson);
  color: #FFF;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  z-index: 10;
}

/* Lightbox */
.lightbox-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-viewport {
  width: 100%;
  max-height: 74vh;
  overflow: auto;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-md);
  border: 1px solid rgba(232, 184, 75, 0.3);
  padding: 0.75rem;
}

.lightbox-img {
  max-height: 70vh;
  width: auto;
  transition: transform 220ms ease;
  transform-origin: center center;
}

/* Toast Notification */
.bt-toast {
  position: fixed;
  left: 50%;
  bottom: 5rem;
  transform: translateX(-50%) translateY(20px);
  background: #092B57;
  color: #FFF7EB;
  border: 2px solid var(--bt-cyan);
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 1700;
  transition: all 260ms var(--ease-imperial);
}

.bt-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #1E0510 0%, #061830 100%);
  border-top: 4px solid var(--bt-gold);
  padding: 3.5rem 0 2rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, minmax(150px, 1fr));
  gap: 2rem;
}

@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--bt-gold);
  margin: 0 0 0.85rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  font-size: 0.88rem;
  color: var(--ink-light-muted);
}

.footer-links a:hover {
  color: var(--bt-cyan);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 214, 170, 0.18);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: rgba(255, 232, 204, 0.72);
}

/* Scroll reveal utility */
.reveal-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 550ms var(--ease-imperial), transform 550ms var(--ease-imperial);
}

.reveal-up.is-shown {
  opacity: 1;
  transform: translateY(0);
}
