/**
 * Sidebar Menu Styles v3.0
 * Visual style like roulettino, but with click interaction
 */

/* Overlay */
.nav-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 102;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Sidebar base */
.nav-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  background: var(--color-dark-grey-1, #1a1a1a);
  z-index: 105;
  transition: transform 0.3s ease, width 0.3s ease;
}

/* Desktop (MacBook 14" and larger) */
@media (min-width: 1281px) {
  .nav-sidebar {
    width: 64px !important;
    transform: translateX(0);
  }

  .nav-sidebar.opened {
    transform: translateX(0);
    width: 64px !important;
  }

  .nav-sidebar.expanded {
    width: 280px !important;
  }

  /* Fix content width */
  .nav-sidebar.opened:not(.expanded) .nav-sidebar-content {
    width: 64px !important;
  }

  .nav-sidebar.opened.expanded .nav-sidebar-content {
    width: 280px !important;
  }

  /* Header stays visible */
  .header {
    position: relative;
    z-index: 9999;
  }

  /* Main content offset for collapsed sidebar */
  .app, #container, .lobby-wrapper {
    margin-left: 15px !important;
    transition: margin-left 0.3s ease;
  }

  /* Expand margin when sidebar is expanded */
  .nav-sidebar.expanded ~ .app,
  .nav-sidebar.expanded ~ #container {
    margin-left: 15px !important;
  }
}

/* Mobile */
@media (max-width: 1280px) {
  .nav-sidebar {
    width: 100vw !important;
    max-width: 320px !important;
    transform: translateX(-100%);
    top: 0 !important;
    height: 100vh !important;
  }

  .nav-sidebar.opened {
    transform: translateX(0);
  }

  /* Ensure sidebar content fits properly */
  .nav-sidebar-expanded {
    width: 100% !important;
  }

  .nav-sidebar-expanded-content {
    width: 100% !important;
    padding: 0 !important;
  }

  .nav-sidebar-expanded-scrollY {
    padding: 16px !important;
  }

  /* Ensure menu items fit within sidebar */
  .nav-sidebar-expanded-items,
  .nav-sidebar-items {
    width: 100% !important;
  }

  .nav-sidebar-items-title {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Wrapped (icons only) */
.nav-sidebar-wrapped {
  width: 64px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.nav-sidebar-wrapped-content {
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Support button at bottom in wrapped mode */
.nav-sidebar-wrapped-content .divider-top {
  margin-top: auto;
  padding-top: 16px;
}

.nav-sidebar-support-wrapped {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
  padding: 8px;
}

.nav-sidebar:not(.expanded) .nav-sidebar-wrapped {
  display: block !important;
}

.nav-sidebar.expanded .nav-sidebar-wrapped {
  display: none !important;
}

/* Expanded (full with cards) */
.nav-sidebar-expanded {
  width: 280px;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nav-sidebar-expanded-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.nav-sidebar-expanded-scrollY {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 0;
  max-height: 100% !important;
}

/* Sidebar menu items list */
.nav-sidebar-items,
.nav-sidebar-expanded-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-sidebar-items-item {
  margin: 0 0 8px 0;
}

.nav-sidebar-items-item:last-child {
  margin-bottom: 0;
}

/* CRITICAL: Override flexbox layout from main CSS */
.nav-sidebar-expanded-scrollY.nav-sidebar-expanded--gap {
  display: block !important;
  flex-flow: unset !important;
  gap: 0 !important;
  padding: 16px !important;
}

/* Cards section */
.nav-sidebar-expanded-cards {
  margin: 0 0 12px 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

/* CRITICAL: Remove margin-bottom: auto that creates huge gap */
.nav-sidebar-expanded-items {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* Individual menu items spacing */
.nav-sidebar-items-item {
  margin: 0 0 8px 0 !important;
}

.nav-sidebar-items-item:last-child {
  margin-bottom: 0 !important;
}

/* Support footer should stick to bottom */
.nav-sidebar-expanded-content {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
}

.nav-sidebar-expanded-content > .nav-sidebar-expanded-scrollY {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  min-height: 0 !important;
}

.nav-sidebar-expanded-content > .nav-sidebar-expanded-support {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
}

.nav-sidebar-expanded-scrollY::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.nav-sidebar:not(.expanded) .nav-sidebar-expanded {
  display: none !important;
}

.nav-sidebar.expanded .nav-sidebar-expanded {
  display: block !important;
}

/* Force visibility - override opacity:0 from animations */
.nav-sidebar-wrapped-content,
.nav-sidebar-expanded-content {
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
}

.nav-sidebar.opened .nav-sidebar-wrapped-content,
.nav-sidebar.opened.expanded .nav-sidebar-expanded-content {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Animations */
.nav-sidebar,
.nav-sidebar-wrapped,
.nav-sidebar-expanded {
  transition: all 0.3s ease;
}

/* Hamburger button */
.header-toggle {
  position: relative;
  z-index: 10000;
  cursor: pointer;
  padding: 8px;
}

.header-toggle:hover {
  opacity: 0.8;
}

/* Sidebar header with logo */
.nav-sidebar-header.nav-sidebar-expanded__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  gap: 12px;
}

/* Hide sidebar logo on desktop (header logo already visible) */
@media (min-width: 1281px) {
  .nav-sidebar-header.nav-sidebar-expanded__header .nav-logo {
    display: none !important;
  }
}

/* Close button */
.nav-sidebar-header__toggle {
  cursor: pointer;
  padding: 8px;
}

.nav-sidebar-header__toggle:hover {
  opacity: 0.8;
}

/* Hide scrollbars */
.hideScrollbar,
.nav-sidebar-wrapped-content,
.nav-sidebar-expanded-content {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.hideScrollbar::-webkit-scrollbar,
.nav-sidebar-wrapped-content::-webkit-scrollbar,
.nav-sidebar-expanded-content::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
  width: 0;
  height: 0;
}

/* Prevent horizontal scroll */
.nav-sidebar,
.nav-sidebar-content,
.nav-sidebar-wrapped,
.nav-sidebar-wrapped-content,
.nav-sidebar-expanded,
.nav-sidebar-expanded-content {
  overflow-x: hidden !important;
}

/* Cards grid in expanded mode */
.nav-sidebar-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Sidebar footer (support buttons) */
.nav-sidebar-expanded-support {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.nav-sidebar-expanded-support-help {
  display: flex;
  gap: 8px;
  width: 100%;
}

.nav-sidebar-expanded-support-help .m-button {
  flex: 1;
  min-width: 0;
}

.nav-sidebar-support,
.nav-sidebar-help-centre,
.lang-switcher-btn {
  width: 100% !important;
  justify-content: center;
  font-size: 14px;
  padding: 10px 12px;
  height: auto;
  min-height: 44px;
}

.nav-sidebar-support .m-button-content,
.nav-sidebar-help-centre .m-button-content,
.lang-switcher-btn .m-button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lang-switcher-country {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Icon sizing in buttons */
.nav-sidebar-support svg,
.nav-sidebar-help-centre svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .nav-sidebar-expanded-support {
    padding: 12px;
    gap: 8px;
  }

  .nav-sidebar-expanded-support-help {
    flex-direction: column;
  }

  .nav-sidebar-expanded-support-help .m-button {
    width: 100%;
  }
}

/* Prevent body scroll when sidebar open on mobile */
body.sidebar-open {
  overflow: hidden !important;
}

/* Prevent horizontal overflow on page */
body, html {
  overflow-x: hidden !important;
}

#app {
  overflow-x: hidden !important;
}

/* ========== MOBILE HEADER ========== */
/*
 * Simplified Layout:
 * Row 1: [Hamburger (44px)] [Logo (auto)] [Casino/Sports (1fr, right-aligned)]
 * Row 2: [Auth buttons spanning all 3 columns]
 */
@media (max-width: 1280px) {
  /* Grid container - sticky at top */
  .header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: var(--color-menu-top-background, #1a1a1a) !important;
    display: grid !important;
    grid-template-columns: 44px auto 1fr !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    padding: 12px 16px !important;
    column-gap: 12px !important;
    row-gap: 12px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  }

  /* Row 1, Col 1: Hamburger */
  .header-toggle {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 44px !important;
    height: 44px !important;
    padding: 8px !important;
  }

  /* header__content uses display:contents to "unwrap" children into grid */
  .header__content {
    display: contents !important;
  }

  /* Row 1, Col 2: Logo (direct child via display:contents) */
  .header__content > .nav-logo {
    grid-column: 2 !important;
    grid-row: 1 !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  .nav-logo img {
    max-height: 32px !important;
  }

  /* Row 1, Col 3: Casino/Sports menu (direct child via display:contents) */
  .header__content > .header-menu {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Row 2, Cols 1-3: Auth section (direct child via display:contents) */
  .header__content > .header__section-right {
    grid-column: 1 / 4 !important;
    grid-row: 2 !important;
    display: flex !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  /* Hide search */
  .header-search {
    display: none !important;
  }

  /* ===== AUTH BUTTONS (Row 2) ===== */
  .header-auth-buttons {
    display: flex !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .header-auth-buttons .m-button {
    flex: 1 !important;
    font-size: 14px !important;
    padding: 12px 16px !important;
    white-space: nowrap !important;
    min-height: 44px !important;
    font-weight: 600 !important;
  }

  /* Log in button (outline) */
  .header-auth-buttons .m-button--outline {
    border: 2px solid var(--color-pr500, #FFED00) !important;
    color: var(--color-pr500, #FFED00) !important;
    background: rgba(255, 237, 0, 0.1) !important;
  }

  /* Sign up button (filled) */
  .header-auth-buttons .m-button--primary {
    background: var(--color-pr500, #FFED00) !important;
    color: #000 !important;
  }

  /* ===== FIX CONTENT OVERLAP ===== */
  /* Header is now taller (2 rows), so add proper spacing below */
  .app {
    margin-top: 100px !important;
  }
}

/* ========== FOOTER NAVIGATION ========== */
.footer-nav {
  padding: 32px 20px;
  background: var(--color-dark-grey-0, #16110F);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-nav__content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Footer socials section */
.footer-nav__socials {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-nav__socials .nav-logo img {
  height: 28px;
  width: auto;
}

.footer-nav__lang {
  min-width: 180px;
}

/* Footer links grid */
.footer-links {
  display: grid;
  gap: 12px 32px;
  padding: 0;
}

/* Desktop: 5 columns for better distribution */
@media (min-width: 1200px) {
  .footer-links {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Desktop small: 4 columns */
@media (min-width: 768px) and (max-width: 1199px) {
  .footer-links {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablet: 3 columns */
@media (min-width: 480px) and (max-width: 767px) {
  .footer-links {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 16px;
  }
}

/* Mobile: 2 columns */
@media (max-width: 479px) {
  .footer-nav {
    padding: 24px 16px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
  }

  .footer-nav__socials {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .footer-nav__lang {
    width: 100%;
    min-width: 0;
  }
}

/* Footer link styles */
.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 12px;
  line-height: 1.6;
  display: block;
  white-space: nowrap;
}

.footer-links a:hover {
  color: var(--color-pr500, #FFED00);
}

/* Remove inline styles override */
.footer-links[style] {
  /* Override any inline grid styles */
  display: grid !important;
}

/* ========== BIG WINS SLIDER FIX ========== */
/* Fix positioning on mobile - prevent overlapping */
@media (max-width: 1280px) {
  .lobby-banners {
    position: relative !important;
    z-index: 1 !important;
    margin-bottom: 24px !important;
    min-height: 200px !important;
  }

  .lobby-banner {
    min-height: 180px !important;
  }

  .recent-big-wins-section {
    position: relative !important;
    z-index: 2 !important;
    margin-top: 24px !important;
    clear: both !important;
    background: var(--color-background-page, #0a0a0a) !important;
  }

  /* Ensure sections don't overlap */
  .lobby {
    position: relative !important;
    z-index: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
}

/* Fix for recent-big-wins-slider on mobile */
.recent-big-wins-slider {
  width: 100% !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 2 !important;
}

@media (max-width: 1280px) {
  .recent-big-wins-slider {
    padding: 0 16px !important;
  }

  .recent-big-wins-slider__container {
    width: 100% !important;
    overflow: visible !important;
  }
}

.recent-big-wins-slider__cards {
  display: grid !important;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100% !important;
}

.recent-big-wins-slider__cards::-webkit-scrollbar {
  display: none;
}

/* Desktop: 5 columns */
@media (min-width: 1200px) {
  .recent-big-wins-slider__cards--cols5 {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

/* Tablet large: 4 columns */
@media (min-width: 768px) and (max-width: 1199px) {
  .recent-big-wins-slider__cards--cols5 {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Tablet small: 3 columns */
@media (min-width: 480px) and (max-width: 767px) {
  .recent-big-wins-slider__cards--cols5 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Mobile: 2 columns */
@media (max-width: 479px) {
  .recent-big-wins-slider__cards--cols5 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

.recent-big-wins-card {
  min-width: 0;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
  z-index: 1 !important;
}

.recent-big-wins-card__game-icon img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Ensure all animation classes don't hide content */
.item-slide-left-leave-active,
.item-slide-left-leave-to,
.item-slide-left-enter-active,
.item-slide-left-enter-to {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  position: relative !important;
}

/* ========== MOBILE FONT SIZE REDUCTION ========== */
@media (max-width: 1280px) {
  /* Reduce header/title fonts */
  h1, h2, h3, h4, h5, h6 {
    font-size: 0.9em !important;
  }

  /* Reduce button text */
  .m-button {
    font-size: 13px !important;
  }

  /* Reduce big wins header */
  .recent-big-wins-header__title {
    font-size: 18px !important;
  }

  .recent-big-wins-header__title svg {
    width: 24px !important;
    height: 24px !important;
  }

  /* Reduce card text */
  .recent-big-wins-card__game-name {
    font-size: 13px !important;
  }

  .recent-big-wins-card__player-nickname {
    font-size: 11px !important;
  }

  .recent-big-wins-card__win-amount {
    font-size: 14px !important;
  }

  /* Reduce footer links */
  .footer-links a {
    font-size: 11px !important;
  }

  /* Reduce general body text */
  body, p, span, div {
    font-size: 14px !important;
  }

  /* Reduce segment control (Casino/Sports) */
  .header-menu .m-segment-control-item {
    font-size: 13px !important;
    padding: 6px 12px !important;
  }

  /* Reduce sidebar menu items */
  .nav-sidebar-items-title {
    font-size: 14px !important;
  }
}
