/* header.css */

/* Keep header self-contained so other page CSS can't break it */
.header {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition-smooth);
}

.header.scrolled {
  background: rgba(26, 26, 26, 0.98);
  box-shadow: var(--shadow-dark);
}

/* Don't depend on global .container */
.header .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-content {
  display: flex;
  align-items: center;
  padding: 16px 0;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}
.logo:hover { transform: translateY(-2px); }
.logo-img { height: 36px; width: auto; display: block; }
.footer-logo-img { height: 44px; width: auto; display: block; }

.logo-icon {
  position: relative;
  width: 48px;
  height: 48px;
  background: var(--primary-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-cyan);
  overflow: hidden;
}
.logo-icon::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,.2), transparent);
  transform: rotate(45deg);
  animation: logoShine 3s ease-in-out infinite;
}
@keyframes logoShine {
  0%,100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}
.logo-icon i {
  font-size: 20px;
  color: #fff;
  position: relative;
  z-index: 2;
}

.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-main { font-size: 24px; font-weight: 900; color: var(--accent-cyan); letter-spacing: -0.5px; }
.logo-sub { font-size: 14px; font-weight: 600; color: var(--text-secondary); letter-spacing: 2px; }

.nav { display: flex; }
.nav-list { display: flex; list-style: none; gap: 8px; }

/* Push search bar to the right */
.gs-wrap{ margin-left: auto; }

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-radius: 12px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.nav-link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  transition: left 0.3s ease;
  z-index: 0;
}
.nav-link:hover::before,
.nav-link.active::before { left: 0; }

.nav-link:hover,
.nav-link.active { color: #fff; transform: translateY(-2px); }

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

/* IMPORTANT: scope buttons to header so other CSS .btn doesn't override */
.header .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.header .login-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: relative;
}
.header .login-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.header .login-btn:hover::before { left: 0; }
.header .login-btn:hover {
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-cyan);
  border-color: var(--accent-cyan);
}
.header .login-btn i,
.header .login-btn span { position: relative; z-index: 1; }

.header .signup-btn {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--shadow-cyan);
  position: relative;
}
.header .signup-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0099cc 0%, #006699 100%);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.header .signup-btn:hover::before { left: 0; }
.header .signup-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 50px rgba(0, 194, 255, 0.5);
}
.header .signup-btn i,
.header .signup-btn span { position: relative; z-index: 1; }

/* Mobile button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition-fast);
  z-index: 1001;
  position: relative;
  margin-left: auto;
}
.mobile-menu-btn:hover { background: rgba(255, 255, 255, 0.1); }

.hamburger {
  width: 24px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-fast);
  transform-origin: center;
}

.mobile-menu-btn.active .hamburger:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.mobile-menu-btn.active .hamburger:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active .hamburger:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* Mobile nav */
.mobile-nav {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  pointer-events: none;
}
.mobile-nav.active { transform: translateX(0); pointer-events: auto; }

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.mobile-nav-overlay.active { opacity: 1; visibility: visible; }

.mobile-nav-content {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 26, 0.98);
  backdrop-filter: blur(20px);
  padding: 100px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  border-right: 0;
  overflow-y: auto;
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  border-radius: 12px;
  transition: var(--transition-fast);
}
.mobile-nav-link:hover {
  background: var(--primary-gradient);
  color: #fff;
  transform: translateX(8px);
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

@media (max-width: 768px) {
  .nav { display: none; }
  .header-actions { display: none; }
  .mobile-menu-btn { display: flex; }
  .logo-text { display: none; }
}

/* Force mobile auth buttons to stack nicely */
.mobile-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100%;
}

.mobile-actions .mobile-btn {
  display: flex !important;
  width: 100% !important;
  justify-content: center;
}

/* =========================
   MOBILE NAV – LIGHT MODE
   (mobile only, does not touch desktop)
========================= */
@media (max-width: 768px) {
  /* overlay: lighter */
  .mobile-nav-overlay.active {
    background: rgba(17,24,39,0.25);
    backdrop-filter: blur(8px);
  }

  /* full screen sheet: light */
  .mobile-nav-content {
    background: #F5F7FB;
    border-right: 0;
  }

  .mobile-nav-link {
    color: #111827;
  }

  .mobile-nav-link:hover {
    transform: none;
    background: rgba(10,166,214,0.12);
    color: #055A78;
  }
}

@media (max-width: 768px) {
  /* Mobile auth buttons: remove hover overlay layer that causes side bars */
  .mobile-actions .login-btn::before,
  .mobile-actions .signup-btn::before {
    display: none !important;
  }

  /* Make the mobile buttons look consistent */
  .mobile-actions .mobile-btn {
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 800;
    text-decoration: none;
    overflow: hidden;
  }

  .mobile-actions .login-btn {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid rgba(17,24,39,0.12) !important;
    box-shadow: 0 10px 22px rgba(17,24,39,0.08);
  }

  .mobile-actions .signup-btn {
    background: linear-gradient(135deg,#0AA6D6,#056F95) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 16px 34px rgba(10,166,214,0.22);
  }
}

@media (max-width: 768px) {
  .mobile-actions a.mobile-btn {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
    text-decoration: none !important;
    line-height: 1.1;
  }
}

/* Hamburger lines always white */
.mobile-menu-btn .hamburger {
  background: #fff !important;
}

/* Mobile menu close button (X) */
.mobile-nav-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: rgba(17,24,39,0.08);
  color: #111827;
}

.mobile-nav-close i {
  font-size: 20px;
}

@media (max-width: 768px) {
  .mobile-nav-content {
    position: relative; /* ensures the X positions correctly */
  }
}

/* Hide hamburger button when mobile menu is open */
.mobile-menu-btn.active {
  display: none !important;
}

/* Hide any legacy close buttons inside mobile nav */
#closeMobileNav,
.mobile-close,
.mobileNavClose,
.close-mobile-nav {
  display: none !important;
}

@media (max-width: 768px) {
  /* Make sure mobile auth buttons are always visible */
  .mobile-actions .mobile-btn {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .mobile-actions .login-btn {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid rgba(17,24,39,0.12) !important;
  }

  .mobile-actions .signup-btn {
    background: linear-gradient(135deg,#0AA6D6,#056F95) !important;
    color: #ffffff !important;
  }

  /* If any global CSS is adding weird underlines */
  .mobile-actions .mobile-btn,
  .mobile-actions .mobile-btn:visited {
    text-decoration: none !important;
  }
} 

@media (max-width: 768px) {
  /* Force mobile auth buttons to always be readable */
  #mobileNav .mobile-actions a.mobile-btn.login-btn {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid rgba(17,24,39,0.15) !important;
    opacity: 1 !important;
  }

  #mobileNav .mobile-actions a.mobile-btn.signup-btn {
    background: linear-gradient(135deg,#0AA6D6,#056F95) !important;
    color: #ffffff !important;
    border: 0 !important;
    opacity: 1 !important;
  }

  /* Kill any underline / link coloring */
  #mobileNav .mobile-actions a.mobile-btn,
  #mobileNav .mobile-actions a.mobile-btn:visited {
    text-decoration: none !important;
  }
}

/* =========================
   MOBILE HEADER LOGO – show full BonusRiver logo
   (mobile only)
========================= */
@media (max-width: 768px) {
  /* show the text again */
  .logo-text { 
    display: flex !important;
  }

  /* tighten spacing so it fits nicely */
  .logo {
    gap: 10px;
  }

  /* slightly smaller icon on mobile */
  .logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .logo-icon i {
    font-size: 18px;
  }

  /* scale down the wordmark */
  .logo-main {
    font-size: 18px;
    line-height: 1;
    letter-spacing: -0.3px;
  }
  .logo-sub {
    font-size: 11px;
    line-height: 1;
    letter-spacing: 2px;
  }
}

/* =========================
   DESKTOP DROPDOWN (NEWS)
========================= */

.nav-item{
  position: relative;
}

.nav-caret{
  margin-left: 8px;
  font-size: 12px;
  opacity: 0.8;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.nav-dropdown{
  position: absolute;
  top: 100%;
  margin-top: 8px;
  left: 0;
  min-width: 280px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: rgba(26, 26, 26, 0.98);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-dark);
  display: none;
  z-index: 2000;
}

.has-dropdown:hover .nav-dropdown,
.has-dropdown:focus-within .nav-dropdown{
  display: block;
}

/* Casinos mega-dropdown */
.has-dropdown:hover .nav-dropdown--casinos,
.has-dropdown:focus-within .nav-dropdown--casinos{
  display: block;
  min-width: 580px;
  padding: 0;
  overflow: hidden;
}

.nav-dd-grid{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  padding: 14px 10px 10px;
}

.nav-dd-col{
  display: flex;
  flex-direction: column;
}

.nav-dd-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  white-space: nowrap;
}

.nav-dd-item:hover{
  background: rgba(10,166,214,0.1);
  color: #0AA6D6;
  border-left-color: #0AA6D6;
}

.nav-dd-icon{
  width: 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.nav-dd-item:hover .nav-dd-icon{
  color: #0AA6D6;
}

.nav-dd-country-row{
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.nav-dd-country-label{
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.3);
  padding: 0 14px 0 12px;
  white-space: nowrap;
}

.nav-dd-flag{
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Compact dropdown (Slots, News, Tools) */
.nav-dropdown--compact{
  padding: 8px !important;
  min-width: 220px !important;
}

.has-dropdown:hover .nav-caret,
.has-dropdown:focus-within .nav-caret{
  transform: rotate(180deg);
  opacity: 1;
}

/* Hover bridge: prevents dropdown from closing while moving mouse down */
.has-dropdown::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
}

/* Legacy dd-link styles (kept for any remaining usage) */
.nav-dd-link{
  display: grid;
  gap: 4px;
  padding: 12px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

/* =========================
   MOBILE: DROPDOWN ACCORDIONS (SLOTS / NEWS)
========================= */
@media (max-width: 768px){
  .mobile-nav-group{
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .mobile-nav-parent{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px 20px;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    background: transparent;

    /* match mobile-nav-link */
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;

    color: #111827;
  }

  .mobile-nav-parent:hover{
    background: rgba(10,166,214,0.12);
    color: #055A78;
  }

  .mobile-nav-parent i{
    transition: transform 0.18s ease;
    opacity: 0.8;
  }

  .mobile-nav-parent[aria-expanded="true"] i{
    transform: rotate(180deg);
    opacity: 1;
  }

  /* CLOSED by default (respects hidden) */
  .mobile-submenu[hidden]{
    display: none !important;
  }

  /* OPEN state */
  .mobile-submenu{
    display: grid;
    gap: 8px;
    padding: 2px 6px 10px;
  }

  .mobile-submenu-link{
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: #111827;
    background: #ffffff;
    border: 1px solid rgba(17,24,39,0.12);
    box-shadow: 0 10px 22px rgba(17,24,39,0.06);
    font-weight: 650;
  }

  .mobile-submenu-link:hover{
    background: rgba(10,166,214,0.10);
    border-color: rgba(10,166,214,0.20);
    color: #055A78;
  }
}

@media (max-width: 768px){
  /* Force dropdown parents to look EXACTLY like normal links */
  .mobile-nav-parent{
    all: unset;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    padding: 16px 20px;

    border-radius: 12px;
    cursor: pointer;

    /* MATCH .mobile-nav-link exactly */
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;

    color: #111827;
  }

  .mobile-nav-parent:hover{
    background: rgba(10,166,214,0.12);
    color: #055A78;
  }
}

@media (max-width: 768px){
  /* Make mobile menu items identical (a + button) */
  .mobile-nav-link,
  .mobile-nav-parent{
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
  }

  /* Ensure the button has the same layout box as links */
  .mobile-nav-parent{
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 20px !important;
    border-radius: 12px !important;
    background: transparent !important;
    border: 0 !important;
  }
}

@media (max-width: 768px){
  .mobile-nav-parent{
    -webkit-appearance: none !important;
    appearance: none !important;
  }
}
