/* ============================================================
   VegasBet — Sidebar & Layout CSS  (v2 — 2-col, sport sidebar)
   ============================================================ */

/* ── Main 3-column Layout ───────────────────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: var(--sidebar-sport) 1fr 280px;
  gap: 8px;
  align-items: start;
  width: 100%; padding: 0;
}

/* ── Sport Sidebar ──────────────────────────────────────────── */
/* Sidebar search */
.sidebar-search-wrap {
  padding: 10px 10px 6px; border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.sidebar-search { position: relative; }
.sidebar-search input {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border-subtle); border-radius: 20px;
  padding: 6px 10px; font-size: 0.78rem;
  color: var(--text-primary); transition: border-color var(--transition);
}
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search input:focus { border-color: var(--purple); outline: none; }
.sidebar-search::before {
  display: none;
}

/* Live event-search dropdown (populated by main.js initEventSearch) */
.sidebar-search-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  z-index: 60;
  background: var(--bg-card);
  border: 1px solid var(--purple);
  border-radius: 12px;
  overflow: hidden auto;
  max-height: 320px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
}
.sidebar-search-results.is-hidden { display: none; }
.ssr-item {
  display: block;
  padding: 9px 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}
.ssr-item:last-child { border-bottom: none; }
.ssr-item:hover,
.ssr-item.is-active { background: var(--purple-dim); }
.ssr-teams {
  display: block;
  font-size: 0.8rem; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ssr-meta {
  display: flex; align-items: center; gap: 8px; margin-top: 3px;
  font-size: 0.68rem; color: var(--text-muted);
}
.ssr-league { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ssr-live { color: var(--red); font-weight: 700; flex-shrink: 0; }
.ssr-empty {
  padding: 14px 12px; text-align: center;
  font-size: 0.76rem; color: var(--text-muted);
}

.sport-sidebar {
  overflow: hidden;
  background: var(--bg-card);
  border: 1.5px solid #7c3aed;
  border-radius: 14px;
  display: flex; flex-direction: column;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.3),
              0 0 20px rgba(124, 58, 237, 0.12);
}

/* Sidebar quick-nav buttons (Sports | Esports) */
.sidebar-tabs-row {
  display: flex; padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 8px; flex-shrink: 0;
}
.sidebar-nav-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 12px 8px; border-radius: 10px;
  font-family: 'Google Sans', 'Inter', sans-serif; font-weight: 600;
  font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: #ffffff; text-decoration: none; cursor: pointer;
  border: none;
  background-image: linear-gradient(to right, #6d28d9 0%, #a855f7 51%, #6d28d9 100%);
  background-size: 200% auto;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.45);
  transition: background-position 0.5s ease, box-shadow 0.3s ease, transform 0.18s ease;
}
.sidebar-nav-btn:hover {
  background-position: right center;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(168, 85, 247, 0.75),
              0 0 46px rgba(124, 58, 237, 0.4);
}
.sidebar-nav-btn:active { transform: translateY(0); }

/* Sport list */
.sport-list { padding: 4px 0; flex: 1; }

.sport-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  border-left: 2px solid transparent;
}
.sport-item:hover { background-color: var(--purple-dim); }
.sport-item.active { background: var(--purple-dim); border-left-color: transparent; }

.si-icon { font-size: 0.95rem; flex-shrink: 0; width: 18px; text-align: center; }
.si-name {
  flex: 1; font-size: 14px; font-weight: 600; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--transition);
}
.sport-item:hover .si-name, .sport-item.active .si-name { color: var(--text-primary); }

.si-count {
  background: var(--purple-dim); color: var(--accent);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 1px 6px; font-size: 12px; font-weight: 700;
  flex-shrink: 0; transition: background var(--transition);
}

/* Sport-tabs pages: raise entire sidebar column to align with stb-inner */
.has-sport-tabs .sidebar-column {
  margin-top: calc(var(--header-height) + 10px - var(--header-total)); /* -62px */
}

/* ── Main Content Area ──────────────────────────────────────── */
.main-content-area { min-width: 0; padding-right: 0; padding-top: 14px; }

/* ── Right Widgets Column ───────────────────────────────────── */
.right-column {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  scrollbar-width: none;
}
.right-column::-webkit-scrollbar { display: none; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .main-layout {
    grid-template-columns: var(--sidebar-sport) 1fr;
  }
  .right-column { display: none !important; }
}

@media (max-width: 1000px) {
  .main-layout {
    grid-template-columns: 1fr;
    padding: 8px 0 0;
  }
  /* Hide sidebar column from page flow; drawer has its own copies */
  .sidebar-column { display: none !important; }
  /* Catch any stray sidebar/nav children that might escape the column */
  .main-layout .sport-sidebar { display: none !important; }
  .main-layout .sidebar-nav-links { display: none !important; }
  .main-content-area { padding-right: 0; width: 100%; }
  .right-column { display: none !important; }
}
/* Drawer overrides — drawer content is NOT inside .main-layout */
.mob-drawer .sport-sidebar { display: flex !important; }
.mob-drawer .sidebar-nav-links { display: block !important; }

/* Single-column content wrapper (vip / about / promotions / license / feedback).
   Each has exactly one child, so this is a plain block — NOT a 1fr grid.
   A single-column grid track expands to its item's min-content (Chromium),
   so wide inner content like the VIP ladder blew the page past the viewport
   on mobile (forced zoom-out). Block sizes the child to the container width
   and lets its own overflow-x:auto scroll, killing the horizontal overflow. */
.content-layout {
  display: block;
  padding: 12px 14px 0;
  width: 100%;
}

/* ── Sport Sidebar SVG Icons ─────────────────────────────────── */
.sport-sidebar-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: invert(40%) sepia(60%) saturate(500%) hue-rotate(230deg) brightness(0.85);
  transition: filter 0.2s;
  flex-shrink: 0;
}

.sport-item.active .sport-sidebar-icon,
.sport-item:hover .sport-sidebar-icon {
  filter: invert(60%) sepia(60%) saturate(400%) hue-rotate(220deg) brightness(1.4);
}

/* Esport items keep their real brand logos (full-colour raster/SVG art). Crush
   them to pure black first (brightness 0), then apply the IDENTICAL tint as the
   line-icons — so Dota / CS / LoL render the same flat purple, at the same 18px,
   as every other sport in the sidebar. Rules come after the base ones so they
   win at equal specificity. */
.sport-sidebar-icon--es {
  filter: brightness(0) invert(40%) sepia(60%) saturate(500%) hue-rotate(230deg) brightness(0.85);
}
.sport-item.active .sport-sidebar-icon--es,
.sport-item:hover .sport-sidebar-icon--es {
  filter: brightness(0) invert(60%) sepia(60%) saturate(400%) hue-rotate(220deg) brightness(1.4);
}

/* ── Sidebar Column Wrapper ─────────────────────────────────── */
.sidebar-column {
  position: sticky;
  top: calc(var(--header-height) + 10px);
  height: fit-content;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Sidebar Nav Links ──────────────────────────────────────── */
.sidebar-nav-links {
  background: var(--bg-card);
  border: 1.5px solid #7c3aed;
  border-radius: 14px;
  overflow: hidden;
  padding: 6px 0;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.3),
              0 0 20px rgba(124, 58, 237, 0.12);
}
.snl-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer;
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}
.snl-item:hover {
  background-color: var(--purple-dim);
  color: var(--text-primary);
  border-left-color: transparent;
}
.snl-item:hover .sport-sidebar-icon {
  filter: invert(60%) sepia(60%) saturate(400%) hue-rotate(220deg) brightness(1.4);
}

/* Inline SVG icon (used for Feedback item — no filter needed, uses currentColor) */
.snl-svg-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #8884aa;
  transition: color 0.2s;
}
.snl-item:hover .snl-svg-icon {
  color: #f0eeff;
}
