/**
 * D247 Official Client Theme Overrides
 * Matches https://d247.com/ visual blueprint:
 * Primary #0088CC | Secondary #2C3E50 | Sidebar #CCCCCC | Back #72BBEF | Lay #FAA9BA
 */

:root {
  --primary: #0088CC;
  --secondary: #2C3E50;
  --bg-primary: #0088CC;
  --bg-primary90: #0088CCE6;
  --bg-secondary: #2C3E50;
  --bg-secondary85: #2C3E50D9;
  --bg-secondary70: #2C3E50B3;
  --login1: #0088CC;
  --login2: #2C3E50;
  --apx-blue: #0088CC;
  --apx-blue-mobile: #0088CC;
  --apx-navy: #2C3E50;
  --apx-navy-dark: #22303e;
  --apx-back: #72BBEF;
  --apx-lay: #FAA9BA;
  --back: #72BBEF;
  --back1: #72BBEFBF;
  --back2: #72BBEF7F;
  --lay: #FAA9BA;
  --lay1: #FAA9BABF;
  --lay2: #FAA9BA7F;
  --suspended-bg: #404A54;
}

/* Zero horizontal overflow on mobile (390px) & desktop (1440px) */
html,
body {
  max-width: 100%;
  overflow-x: clip;
  font-family: "Roboto Condensed", Arial, sans-serif;
}

/* Official D247 Header — solid #0088CC */
header.apx-header .apx-topbar,
header.apx-header .header-top,
section.header.apx-live-casino-header .header-top,
.apx-topbar,
.apx-marquee-row {
  background: #0088CC !important;
  background-image: none !important;
  color: #FFFFFF;
}

/* Crisp D247 logo rendering in desktop & mobile header */
.apx-logo,
.logo-header a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.apx-logo img,
.logo-header img,
.d247-header-logo {
  display: block;
  height: auto;
  max-height: 52px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

@media (max-width: 1199.98px) {
  .apx-logo img,
  .logo-header img,
  .d247-header-logo {
    max-height: 36px;
    max-width: 108px;
  }
}

/* Desktop Navigation Bar — solid #2C3E50 with crisp white active underline */
.apx-desktop-nav,
.header-bottom {
  background: #2C3E50 !important;
  background-image: none !important;
}

.apx-desktop-nav .navbar-nav .nav-link,
.header-bottom .navbar-nav .nav-link {
  color: #FFFFFF;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  position: relative;
}

.apx-desktop-nav .navbar-nav .nav-item.active > .nav-link::after,
.header-bottom .navbar-nav .nav-item.active > .nav-link::after,
.apx-desktop-nav .navbar-nav .nav-link:hover::after,
.header-bottom .navbar-nav .nav-link:hover::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 2px;
  background: #FFFFFF;
}

/* Desktop right-aligned marquee in header */
.d247-desktop-marquee {
  display: none;
}

@media (min-width: 1200px) {
  .apx-topbar {
    position: relative;
  }
  .apx-userbar.user-details {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .d247-desktop-marquee {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 540px;
    font-size: 12px;
    line-height: 1.25;
    color: #FFFFFF;
    margin-top: 2px;
    overflow: hidden;
  }
  .d247-desktop-marquee marquee {
    display: block;
    width: 100%;
    color: #FFFFFF;
    font-weight: 400;
  }
}

/* Left Sidebar — #CCCCCC body + #0088CC accordion headers */
.apx-sidebar,
.left-sidebar {
  background: #CCCCCC;
  color: #000000;
}

.apx-sidebar .accordion-button,
.apx-sidebar .sidebar-title .accordion-button {
  background: #0088CC !important;
  color: #FFFFFF !important;
  font-weight: 700;
}

.apx-sidebar .apx-sidebar-link,
.apx-sidebar .nav-link {
  color: #000000;
  border-bottom: 1px solid #9E9E9E;
}

.apx-sidebar .apx-sidebar-link:hover,
.apx-sidebar .nav-link:hover {
  background: #BBBBBB;
  color: #000000;
}

.apx-sidebar .apx-sidebar-link.active,
.apx-sidebar .nav-link.active {
  background: #0088CC !important;
  color: #FFFFFF !important;
}

/* Official Back / Lay & Suspended Odds Palette */
.back,
.back-1,
.odds-box.back,
.apx-back,
.market-odd-box.back {
  background-color: #72BBEF !important;
  color: #000000 !important;
}
.back1,
.market-odd-box.back1 {
  background-color: #72BBEFBF !important;
  color: #000000 !important;
}
.back2,
.market-odd-box.back2 {
  background-color: #72BBEF7F !important;
  color: #000000 !important;
}
.lay,
.lay-1,
.odds-box.lay,
.apx-lay,
.market-odd-box.lay {
  background-color: #FAA9BA !important;
  color: #000000 !important;
}
.lay1,
.market-odd-box.lay1 {
  background-color: #FAA9BABF !important;
  color: #000000 !important;
}
.lay2,
.market-odd-box.lay2 {
  background-color: #FAA9BA7F !important;
  color: #000000 !important;
}

.odds-box-wrap.suspended-box::after {
  background-color: rgba(64, 74, 84, 0.88) !important;
}

/* Casino Section & Category Tabs — Official D247 #0088CC / #52A8D8 / #2C3E50 */
.apx-casino-section-tabs {
  background: #2C3E50;
}
.apx-casino-section-tabs li.active a,
.apx-casino-section-tabs li a:hover {
  background: #0088CC;
  color: #FFFFFF;
}
.apx-casino-category-tabs {
  background: #52A8D8;
}
.apx-casino-category-tabs li a {
  color: #FFFFFF;
  font-weight: 700;
}
.apx-casino-category-tabs li.active a,
.apx-casino-category-tabs li a:hover {
  background: #0088CC;
  color: #FFFFFF;
}
.apx-provider-rail button.active {
  background: #0088CC !important;
  border-color: #0088CC !important;
  color: #FFFFFF !important;
}

/* Casino Grid — Crisp Responsive Parity (7 cols desktop, 4 cols mobile Our Casino) */
@media (max-width: 575.98px) {
  body.apx-our-casino .casino-list,
  body.apx-home-page .casino-list {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 2px !important;
  }
  body.apx-slot-page .casino-list,
  body.apx-crash-page .casino-list,
  body.apx-casino-hub .casino-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }
}

/* Real Live TV Viewport — Clean Broadcast Video Only (Zero Chrome/Badges/Trackers) */
.apx-tv-embed-wrap {
  position: relative;
  width: 100%;
  background: #000000 !important;
  overflow: hidden;
  border-radius: 0;
}
.apx-tv-embed-wrap .hd-badge,
.apx-tv-embed-wrap .live-hd,
.apx-tv-embed-wrap .bottom-ticker,
.apx-tv-embed-wrap .tv-chrome-bar {
  display: none !important;
}

/* Footer — Official #0088CC Top Bar */
footer.apx-footer .apx-footer-main,
footer.apx-footer .footer-top {
  background: #0088CC !important;
  color: #FFFFFF;
}

/* Login Page Refinement — D247 Exact 350px Card & Gradient */
body.has-login-surface {
  background: linear-gradient(180deg, #0088CC 0%, #2C3E50 100%) !important;
}
body.has-login-surface .login,
body.has-login-surface .login-page {
  background: linear-gradient(180deg, #0088CC 0%, #2C3E50 100%) !important;
  min-width: 0 !important;
  width: 100% !important;
}
body.has-login-surface .login-box {
  width: min(350px, 92vw) !important;
  max-width: 350px !important;
}
body.has-login-surface .logo-login-1 {
  max-height: 84px !important;
  width: auto;
}
body.has-login-surface .login-form {
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
body.has-login-surface .login-form .login-title {
  color: #0088CC !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
body.has-login-surface .login-form .btn-primary,
body.has-login-surface .login-form .btn-demo {
  background-color: #0088CC !important;
  border-color: #0088CC !important;
  color: #FFFFFF !important;
  font-weight: 700;
  border-radius: 3px;
}
body.has-login-surface .login-form .btn-primary:hover,
body.has-login-surface .login-form .btn-demo:hover {
  background-color: #0073AD !important;
  border-color: #0073AD !important;
}
body.has-login-surface .d247-login-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: #0088CC;
}
body.has-login-surface .d247-login-meta a {
  color: #0088CC;
  text-decoration: none;
  font-weight: 600;
}
body.has-login-surface .d247-login-meta a:hover {
  text-decoration: underline;
}
body.has-login-surface .footer.footer-login {
  background-color: #0088CC !important;
}
.d247-social-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.d247-social-icons a {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #0088CC;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  text-decoration: none;
}
