/* ============================================================
   8XBET — SHARED STYLES
   Header · Navbar · Ticker · Float Bar · Back-to-Top · Footer
   All page-specific overrides go in their own CSS file.
   ============================================================ */

/* ── Design Tokens ── */
:root {
  --blue:       #1a73e8;
  --dark:       #0d1b5c;
  --gold:       #f5c518;
  --gold2:      #b8860b;
  --white:      #ffffff;
  --light:      #f0f5ff;
  --text:       #1a1a2e;
  --muted:      #555555;
  --border:     #e0e8ff;
  --nav-bg:     #1557c0;
  --active-bg:  #0a0f3d;
  --footer-bg:  #0a0f2e;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 6px 24px rgba(0,0,0,.12);
  --shadow-lg:  0 16px 48px rgba(0,0,0,.18);
  --transition: 0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: 'Segoe UI', Arial, sans-serif; color: var(--text); background: #fff; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

/* ── CLS Prevention ──────────────────────────────────────────
   shared.js injects header (~66px) + navbar (~42px) + ticker
   (38px) into zero-height placeholder divs, causing a ~146px
   content shift (CLS ≈ 0.17). Reserving exact heights here
   prevents the shift. shared.css is render-blocking so these
   rules apply BEFORE shared.js fires.
─────────────────────────────────────────────────────────────── */
#shared-header { display: block; min-height: 66px; }
#shared-navbar { display: block; min-height: 42px; }
#shared-ticker { display: block; min-height: 38px; }
@media (max-width: 768px) {
  #shared-header { min-height: 60px; }
  #shared-navbar { min-height: 0; }   /* navbar hidden on mobile */
}

/* ── Shared Buttons ── */
.btn {
  padding: 10px 24px; border-radius: var(--radius-sm); border: none;
  cursor: pointer; font-size: .85rem; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-outline { background: transparent; border: 2px solid var(--dark); color: var(--dark); }
.btn-outline:hover { background: var(--dark); color: #fff; }
.btn-primary { background: var(--dark); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-gold {
  background: linear-gradient(90deg, var(--gold2), var(--gold));
  color: var(--dark); font-weight: 800;
  box-shadow: 0 4px 16px rgba(245,197,24,.35);
}
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ════════════════════════════════════════
   SITE HEADER
   ════════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 999;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,.10);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 32px;
}
.logo-wrap {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.logo-wrap:hover { text-decoration: none; }
.logo-img {
  height: 44px; width: auto;
  display: block; object-fit: contain;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.header-phone {
  color: var(--dark); font-size: .84rem; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; background: var(--light); border-radius: 20px;
}
.header-phone i { color: var(--blue); }

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block; width: 24px; height: 2.5px;
  background: var(--dark); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ════════════════════════════════════════
   NAVBAR
   ════════════════════════════════════════ */
.site-navbar {
  background: var(--nav-bg);
  border-top: 1px solid rgba(255,255,255,.12);
  position: sticky; top: 66px; z-index: 998;
}
.navbar-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; padding: 0 32px; gap: 2px;
  overflow: visible; /* must be visible so dropdown panel escapes */
  scrollbar-width: none;
}
.navbar-inner::-webkit-scrollbar { display: none; }
.nav-link {
  display: flex; align-items: center; gap: 7px;
  padding: 14px 18px;
  color: rgba(255,255,255,.88); font-size: .82rem; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase; white-space: nowrap;
  text-decoration: none; border-radius: 4px; transition: all var(--transition);
  border-bottom: 3px solid transparent;
}
.nav-link i { font-size: .88rem; opacity: .85; }
.nav-link.active {
  background: var(--active-bg); color: #fff;
  border-bottom-color: var(--gold);
}
.nav-link:hover:not(.active) {
  background: rgba(255,255,255,.12); color: #fff;
  text-decoration: none;
}

/* ════════════════════════════════════════
   NAV DROPDOWN  — Mega-menu style
   ════════════════════════════════════════ */
.nav-dropdown {
  position: relative;
  flex-shrink: 0;
}

/* Trigger — styled like a plain nav link with chevron */
.nav-dd-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.9) !important;
  font-size: .83rem; font-weight: 700;
  padding: 10px 14px !important;
  white-space: nowrap;
  letter-spacing: .3px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.nav-dd-trigger:hover,
.nav-dropdown.open .nav-dd-trigger {
  background: rgba(255,255,255,.1) !important;
  color: #fff !important;
  text-decoration: none;
}
.nav-dd-chevron {
  font-size: .58rem;
  transition: transform .25s ease;
  opacity: .7;
}
.nav-dropdown.open .nav-dd-chevron { transform: rotate(180deg); }

/* Panel */
.nav-dd-panel {
  display: none;
  position: absolute; top: calc(100% + 8px); right: -32px;
  background: #0d1433;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.7);
  z-index: 2000;
  padding: 22px;
  min-width: 960px;
  animation: ddFadeIn .18s ease;
}
.nav-dropdown.open .nav-dd-panel { display: block; }

@keyframes ddFadeIn {
  from { opacity:0; transform: translateY(-8px); }
  to   { opacity:1; transform: translateY(0); }
}

/* Body: groups + featured card */
.nav-dd-body {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 20px;
  align-items: start;
}

.nav-dd-groups {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr; /* Trò Chơi gets 2fr, others 1fr each */
  gap: 20px;
}

/* Column */
.nav-dd-col { display: flex; flex-direction: column; gap: 2px; }

/* Wide column — Trò Chơi: items in 2 sub-columns */
.nav-dd-col--wide .nav-dd-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 6px;
}
.nav-dd-col:not(.nav-dd-col--wide) .nav-dd-items {
  display: flex; flex-direction: column; gap: 2px;
}

.nav-dd-group-hd {
  display: flex; align-items: center; gap: 7px;
  font-size: .68rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 0 8px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.nav-dd-group-hd i { font-size: .72rem; }

/* Item row: icon-box + text stack */
.nav-dd-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .15s;
  color: inherit;
}
.nav-dd-item:hover { background: rgba(255,255,255,.07); text-decoration: none; }

.nav-dd-ico {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 9px;
  background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.55);
  font-size: .82rem;
  transition: background .15s, color .15s;
}
.nav-dd-item:hover .nav-dd-ico {
  background: rgba(245,158,11,.2);
  color: var(--gold);
}

.nav-dd-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-dd-ttl {
  font-size: .8rem; font-weight: 700;
  color: rgba(255,255,255,.88);
  line-height: 1.2; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.nav-dd-dsc {
  font-size: .67rem;
  color: rgba(255,255,255,.38);
  line-height: 1.3; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* Featured card */
.nav-dd-featured {
  background: linear-gradient(145deg, #1a2e5a 0%, #0d1b3e 100%);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 14px;
  padding: 20px 16px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.nav-ddf-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(90deg, #b8860b, #f5c518);
  color: #000; font-size: .63rem; font-weight: 900;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
  width: fit-content;
}
.nav-ddf-title {
  font-size: 1rem; font-weight: 900;
  color: #fff; line-height: 1.3;
}
.nav-ddf-title span { color: var(--gold); font-size: 1.25rem; }
.nav-ddf-desc {
  font-size: .71rem;
  color: rgba(255,255,255,.55);
  line-height: 1.55;
}
.nav-ddf-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(90deg, #b8860b, #f5c518);
  color: #000 !important; font-weight: 800; font-size: .78rem;
  padding: 10px 14px; border-radius: 9px;
  text-decoration: none !important;
  transition: filter .18s, transform .18s;
}
.nav-ddf-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.nav-ddf-links {
  display: flex; flex-direction: column; gap: 4px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 10px;
  margin-top: 2px;
}
.nav-ddf-links a {
  display: flex; align-items: center; gap: 8px;
  font-size: .72rem; font-weight: 600;
  color: rgba(255,255,255,.55) !important;
  padding: 5px 6px; border-radius: 6px;
  text-decoration: none !important;
  transition: color .15s, background .15s;
}
.nav-ddf-links a:hover { color: var(--gold) !important; background: rgba(245,158,11,.08); }
.nav-ddf-links a i { width: 14px; text-align: center; font-size: .75rem; }

/* ── Mobile ── */
@media (max-width: 900px) {
  .nav-dropdown { margin-left: 0; }
  .nav-dd-trigger {
    width: 100%; margin: 0;
    border-radius: 0; border: none !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    background: rgba(255,255,255,.04) !important;
    padding: 13px 20px !important;
    justify-content: space-between;
  }
  .nav-dd-panel {
    position: static; min-width: unset;
    border-radius: 0; border: none !important;
    box-shadow: none; background: rgba(0,0,0,.25);
    padding: 12px 0; animation: none;
  }
  .nav-dd-body { grid-template-columns: 1fr; gap: 0; }
  .nav-dd-groups { grid-template-columns: 1fr; gap: 0; }
  .nav-dd-featured { display: none; }
  .nav-dd-group-hd { padding: 10px 20px 8px; margin-bottom: 0; border-bottom: none; }
  .nav-dd-col--wide { grid-column: span 1; }
  .nav-dd-col--wide .nav-dd-items { grid-template-columns: 1fr; }
  .nav-dd-item { padding: 8px 28px; border-radius: 0; }
  .nav-dd-ico { width: 28px; height: 28px; font-size: .72rem; }
  .nav-dd-ttl { font-size: .78rem; }
  .nav-dd-dsc { display: none; }
}

/* ════════════════════════════════════════
   LIVE TICKER
   ════════════════════════════════════════ */
.site-ticker {
  display: flex; align-items: center;
  overflow: hidden; height: 38px;
  background: var(--dark);
}
.ticker-label {
  height: 100%; padding: 0 18px;
  display: flex; align-items: center; gap: 7px;
  font-size: .72rem; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; white-space: nowrap; flex-shrink: 0;
  color: var(--dark); background: var(--gold);
}
.ticker-label .dot { font-size: .45rem; animation: blink 1.2s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ticker-viewport { overflow: hidden; flex: 1; }
.ticker-track {
  display: flex; gap: 56px; white-space: nowrap;
  animation: scrollTicker 40s linear infinite;
  padding-left: 40px;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item { font-size: .8rem; color: rgba(255,255,255,.88); }
.ticker-item .hit { color: var(--gold); font-weight: 700; }
@keyframes scrollTicker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ════════════════════════════════════════
   FLOATING SIDEBAR
   ════════════════════════════════════════ */
.float-sidebar {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 997; display: flex; flex-direction: column; gap: 1px;
}
.float-btn {
  position: relative; width: 46px; height: 46px;
  background: var(--dark); color: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; text-decoration: none; transition: background var(--transition);
  border-left: 3px solid transparent;
}
.float-btn:first-child { border-radius: 10px 0 0 0; }
.float-btn:last-child  { border-radius: 0 0 0 10px; }
.float-btn:hover { background: var(--blue); border-left-color: var(--gold); color: #fff; text-decoration: none; }
.float-btn .ft-tip {
  position: absolute; right: 54px;
  background: var(--dark); color: #fff;
  font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 5px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translateX(6px); transition: all var(--transition);
}
.float-btn .ft-tip::after {
  content: ''; position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent; border-left-color: var(--dark);
}
.float-btn:hover .ft-tip { opacity: 1; transform: translateX(0); }

/* ════════════════════════════════════════
   BACK TO TOP
   ════════════════════════════════════════ */
.back-top-btn {
  position: fixed; bottom: 28px; right: 28px; z-index: 998;
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: .95rem; box-shadow: 0 4px 16px rgba(26,115,232,.4);
  transition: all var(--transition); text-decoration: none;
  opacity: 0; pointer-events: none; transform: translateY(8px);
}
.back-top-btn.visible { opacity: 1; pointer-events: all; transform: translateY(0); }
.back-top-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }

/* ════════════════════════════════════════
   SITE FOOTER
   ════════════════════════════════════════ */
.site-footer { background: var(--footer-bg); padding: 64px 32px 0; }
.footer-inner { max-width: 1280px; margin: 0 auto; }

/* Top grid */
.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.6fr;
  gap: 56px;
  padding-bottom: 52px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Brand column */
.footer-brand {}
.footer-logo { display: block; margin-bottom: 14px; }
.footer-logo-img { height: 38px; width: auto; object-fit: contain; }
.footer-tagline {
  font-size: .88rem; color: rgba(255,255,255,.55); line-height: 1.85; margin-bottom: 24px;
}
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.fsoc-link {
  width: 38px; height: 38px; border-radius: 9px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.65); display: flex; align-items: center; justify-content: center;
  font-size: .95rem; text-decoration: none; transition: all var(--transition);
}
.fsoc-link:hover { background: var(--blue); border-color: var(--blue); color: #fff; text-decoration: none; }

/* Link columns */
.footer-col h4 {
  color: #fff; font-size: .9rem; font-weight: 800;
  margin-bottom: 18px; letter-spacing: .3px;
  padding-bottom: 10px; border-bottom: 2px solid rgba(255,255,255,.06);
}
.footer-col li { margin-bottom: 9px; }
.footer-col li a {
  color: rgba(255,255,255,.55); font-size: .86rem;
  display: flex; align-items: center; gap: 8px;
  transition: color var(--transition); text-decoration: none;
}
.footer-col li a i { color: var(--blue); font-size: .65rem; flex-shrink: 0; }
.footer-col li a:hover { color: var(--gold); }

/* Contact column */
.footer-contact-item {
  display: flex; align-items: flex-start; gap: 10px;
  color: rgba(255,255,255,.6); font-size: .86rem; margin-bottom: 13px; line-height: 1.55;
}
.footer-contact-item i { color: var(--blue); margin-top: 3px; flex-shrink: 0; width: 14px; }
.footer-hashtags { font-size: .73rem; color: rgba(255,255,255,.3); line-height: 2.1; margin-top: 14px; }

/* DMCA badge */
.footer-dmca {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 10px 14px;
  color: rgba(255,255,255,.65); font-size: .78rem; font-weight: 700; margin-top: 14px;
}
.footer-dmca i { color: #4caf50; font-size: 1.1rem; }

/* Bottom bar */
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  font-size: .82rem; color: rgba(255,255,255,.35);
}
.footer-bottom-links { display: flex; gap: 22px; }
.footer-bottom-links a {
  color: rgba(255,255,255,.35); font-size: .82rem;
  transition: color var(--transition); text-decoration: none;
}
.footer-bottom-links a:hover { color: rgba(255,255,255,.75); }

/* ════════════════════════════════════════
   RESPONSIVE – SHARED
   ════════════════════════════════════════ */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 768px) {
  /* Header */
  .header-inner { padding: 10px 16px; }
  .header-phone { display: none; }
  .btn { padding: 8px 14px; font-size: .78rem; }
  .nav-toggle { display: flex; }

  /* Collapsible navbar drawer */
  .site-navbar {
    position: static;
    overflow: hidden;
    max-height: 0;
    transition: max-height .3s ease;
  }
  .site-navbar.open { max-height: 600px; }
  .site-navbar.open.dd-open { max-height: 2400px; } /* expanded for dropdown items */

  .navbar-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 6px 0;
    gap: 0;
    overflow-x: unset;
  }
  .nav-link {
    padding: 13px 20px;
    font-size: .85rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    border-bottom-color: rgba(255,255,255,.08);
  }
  .nav-link.active {
    border-left: 3px solid var(--gold);
    border-bottom-color: rgba(255,255,255,.08);
  }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .footer-bottom-links { flex-wrap: wrap; justify-content: center; gap: 14px; }
  .site-footer { padding: 44px 20px 0; }
  .float-sidebar { display: none; }
}
