/**
 * FlashBet brand layer — Akamba green + gold, Betika-style polish.
 * Load after sportpesa-theme.css and sp-pages.css.
 */

body.sp-theme {
  --sp-green: #009639;
  --sp-green-dark: #007a32;
  --sp-green-deep: #005e26;
  --sp-green-soft: #e8f7ee;
  --sp-gold: #ffb81c;
  --sp-gold-dark: #e5a500;
  --sp-gold-soft: #fff4d6;
  --sp-nav-dark: #007a32;
  --sp-page: #f4f6f8;
  --sp-ink: #0f172a;
  --sp-ink-muted: #64748b;
  --sp-border: #e2e8f0;
  --gradient-hero: linear-gradient(135deg, #007a32 0%, #009639 55%, #00b347 100%);
  --gradient-gold: linear-gradient(135deg, #ffb81c 0%, #f7941d 100%);
}

/* Header */
body.sp-theme header {
  border-bottom: none;
  box-shadow: 0 2px 20px rgba(0, 94, 38, 0.08);
  position: relative;
}

body.sp-theme header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-gold);
}

body.sp-theme header a.logo {
  font-weight: 800;
  letter-spacing: -0.03em;
}

body.sp-theme header a.logo {
  color: var(--sp-green-dark);
}

body.sp-theme header a.logo span {
  color: var(--sp-gold-dark);
  font-weight: 800;
}

/* Brand logo image (header, auth, preloader) */
body.sp-theme header a.logo.logo--image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 10px;
  background: #000;
  line-height: 0;
  flex-shrink: 0;
}

body.sp-theme header a.logo.logo--image:hover {
  opacity: 0.92;
}

body.sp-theme header a.logo .site-logo-img {
  display: block;
  height: 34px;
  width: auto;
  max-width: 128px;
  object-fit: contain;
}

body.sp-theme .auth-brand-logo-wrap {
  background: #000 !important;
  color: inherit !important;
  border-radius: 14px;
  padding: 12px 18px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  font-size: inherit !important;
  line-height: 0;
}

body.sp-theme .auth-brand-logo {
  display: block;
  width: min(100%, 220px);
  height: auto;
  margin: 0 auto;
}

.site-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.site-preloader--hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-preloader__inner {
  text-align: center;
  padding: 24px;
}

.site-preloader__logo {
  width: min(74vw, 320px);
  height: auto;
  animation: fb-logo-pulse 1.6s ease-in-out infinite;
}

.site-preloader__bar {
  width: min(58vw, 240px);
  height: 3px;
  margin: 22px auto 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.site-preloader__bar span {
  display: block;
  height: 100%;
  width: 42%;
  background: linear-gradient(90deg, #ffb81c, #f7941d);
  border-radius: 999px;
  animation: fb-preloader-slide 1.1s ease-in-out infinite;
}

@keyframes fb-logo-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.9; }
}

@keyframes fb-preloader-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

body.sp-theme .loading--brand {
  padding: 48px 20px;
}

body.sp-theme .loading--brand .loading-brand-logo {
  width: min(60vw, 200px);
  height: auto;
  margin: 0 auto 16px;
  display: block;
  animation: fb-logo-pulse 1.6s ease-in-out infinite;
}

body.sp-theme .user-info,
body.sp-theme .user-info strong {
  color: var(--sp-ink);
}

body.sp-theme .guest-header-actions .guest-tagline {
  color: var(--sp-ink-muted);
}

body.sp-theme .balance {
  background: var(--sp-gold-soft);
  color: var(--sp-green-deep);
  border: 1px solid rgba(255, 184, 28, 0.35);
  font-weight: 800;
}

/* Nav — green gradient bar */
body.sp-theme .site-top-chrome nav {
  background: var(--gradient-hero);
  border-bottom: 3px solid var(--sp-gold);
  padding: 0 10px;
  box-shadow: 0 4px 16px rgba(0, 94, 38, 0.15);
}

body.sp-theme nav a {
  border-radius: 10px 10px 0 0;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  gap: 8px;
}

/* Top nav link icons */
body.sp-theme .site-top-chrome nav a .nav-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

body.sp-theme .site-top-chrome nav a .nav-link-icon i {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1;
}

body.sp-theme .site-top-chrome nav a .nav-link-icon--live {
  background: rgba(255, 59, 48, 0.22);
  position: relative;
}

body.sp-theme .site-top-chrome nav a .nav-link-icon--live::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 2px rgba(0, 122, 50, 0.5);
  animation: fbLivePulse 1.6s ease-in-out infinite;
}

@keyframes fbLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.85); }
}

body.sp-theme .site-top-chrome nav a:hover .nav-link-icon {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

body.sp-theme .site-top-chrome nav a.active .nav-link-icon {
  background: var(--sp-green-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 150, 57, 0.15);
}

body.sp-theme .site-top-chrome nav a.active .nav-link-icon i {
  color: var(--sp-green-dark);
}

body.sp-theme .site-top-chrome nav a .nav-link-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

body.sp-theme nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

body.sp-theme nav a.active {
  background: var(--sp-surface);
  color: var(--sp-green-dark);
  font-weight: 700;
  box-shadow: 0 -2px 0 var(--sp-gold) inset;
}

body.sp-theme .nav-badge {
  background: var(--gradient-gold);
  color: var(--sp-green-deep);
  border-radius: 6px;
  font-weight: 800;
}

/* Primary actions — gold CTA */
body.sp-theme .top-actions .primary {
  background: var(--gradient-gold);
  color: var(--sp-green-deep);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(255, 184, 28, 0.35);
  border-radius: 8px;
}

body.sp-theme .top-actions .primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

body.sp-theme .top-actions .primary.alt {
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 150, 57, 0.25);
}

body.sp-theme .top-actions .primary.alt:hover {
  background: linear-gradient(135deg, #006428, #008a38);
}

body.sp-theme .auth-buttons .btn-register,
body.sp-theme.guest-home .guest-betslip-actions .btn-register {
  background: var(--gradient-gold) !important;
  color: var(--sp-green-deep) !important;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(255, 184, 28, 0.35);
  border: none;
}

body.sp-theme .auth-buttons .btn-login,
body.sp-theme.guest-home .guest-betslip-actions .btn-login {
  background: #fff !important;
  color: var(--sp-green-dark) !important;
  border: 2px solid var(--sp-green) !important;
  font-weight: 700;
}

body.sp-theme .auth-buttons .btn-register:hover,
body.sp-theme.guest-home .guest-betslip-actions .btn-register:hover {
  filter: brightness(1.04);
}

/* Cards & content */
body.sp-theme:not(.game-page) .content,
body.sp-theme:not(.game-page) aside:not(.sports-sidebar),
body.sp-theme:not(.game-page) .betslip {
  border-radius: 14px;
  box-shadow: none;
}

body.sp-theme:not(.game-page) aside.sports-sidebar {
  border-radius: 0;
  box-shadow: none;
}

body.sp-theme .featured-card:hover {
  border-color: var(--sp-green);
  box-shadow: 0 8px 24px rgba(0, 150, 57, 0.18);
  transform: translateY(-3px);
}

body.sp-theme .featured-card .badge {
  background: var(--gradient-gold);
  color: var(--sp-green-deep);
}

body.sp-theme .btn-place {
  background: var(--gradient-gold);
  color: var(--sp-green-deep);
  font-weight: 800;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(255, 184, 28, 0.35);
}

body.sp-theme .btn-place:hover:not(:disabled) {
  filter: brightness(1.04);
}

body.sp-theme .btn-deposit {
  background: var(--gradient-hero);
}

body.sp-theme .mobile-betslip {
  background: var(--gradient-gold);
  color: var(--sp-green-deep);
  box-shadow: 0 6px 20px rgba(255, 184, 28, 0.4);
}

body.sp-theme .filters button.active,
body.sp-theme .filters button:hover {
  background: var(--gradient-hero);
  border-color: var(--sp-green);
}

/* Auth pages */
body.sp-theme .auth-page-surface {
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(0, 150, 57, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(255, 184, 28, 0.08) 0%, transparent 50%),
    var(--sp-page);
}

body.sp-theme .auth-page-surface .login-container,
body.sp-theme .auth-page-surface .register-container {
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 94, 38, 0.1);
  position: relative;
  overflow: hidden;
}

body.sp-theme .auth-page-surface .login-container::before,
body.sp-theme .auth-page-surface .register-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-hero);
}

body.sp-theme .auth-page-surface .auth-brand-mark {
  background: var(--gradient-gold) !important;
  color: var(--sp-green-deep) !important;
  box-shadow: 0 4px 14px rgba(255, 184, 28, 0.35);
}

body.sp-theme.page-auth .auth-page-surface .auth-brand-mark {
  background: transparent !important;
  box-shadow: none !important;
}

body.sp-theme .auth-page-surface .btn-login,
body.sp-theme .auth-page-surface .btn-register {
  background: var(--gradient-gold);
  color: var(--sp-green-deep);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(255, 184, 28, 0.35);
}

body.sp-theme .auth-page-surface .btn-login:hover,
body.sp-theme .auth-page-surface .btn-register:hover:not(:disabled) {
  filter: brightness(1.04);
  background: var(--gradient-gold);
}

/* Footer */
body.sp-theme footer {
  background: linear-gradient(180deg, #007a32 0%, #005e26 100%);
  color: rgba(255, 255, 255, 0.85);
  border-top: 3px solid var(--sp-gold);
  padding: 32px 20px;
}

/* Landing hero */
body.sp-theme.landing .hero {
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

body.sp-theme.landing .hero::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 48px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 48' preserveAspectRatio='none'%3E%3Cpath fill='%23F4F6F8' d='M0,24 C200,48 400,0 600,24 C800,48 1000,0 1200,24 L1200,48 L0,48 Z'/%3E%3C/svg%3E")
    center bottom / 100% 100% no-repeat;
  pointer-events: none;
}

body.sp-theme.landing .hero h1 span {
  color: var(--sp-gold);
}

body.sp-theme.landing .cta-button {
  background: var(--gradient-gold);
  color: var(--sp-green-deep);
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(255, 184, 28, 0.4);
}

body.sp-theme.landing .cta-button:hover {
  filter: brightness(1.05);
}

/* Date filter / page-specific panels in sp-pages */
body.sp-theme .date-filter-container::before,
body.sp-theme.page-cashier .cashier-card::before {
  background: var(--gradient-gold);
}

/* --- Left sports category sidebar — dark panel (match betslip) --- */
body.sp-theme:not(.game-page) aside.sports-sidebar {
  --sp-sidebar: #1a1f2e;
  --sp-sidebar-muted: #8b96a2;
  background: var(--sp-sidebar) !important;
  color: var(--sp-sidebar-muted);
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  max-height: calc(100dvh - var(--sp-chrome-h, 108px));
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: var(--sp-chrome-h, 108px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

body.sp-theme:not(.game-page) aside.sports-sidebar::-webkit-scrollbar {
  width: 5px;
}

body.sp-theme:not(.game-page) aside.sports-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

body.sp-theme:not(.game-page) .sports-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 4px 0 12px;
  background: var(--sp-sidebar, #1a1f2e) !important;
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sport {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 11px 14px;
  font-size: 0.8125rem;
  color: var(--sp-sidebar-muted, #8b96a2);
  border-radius: 0;
  cursor: pointer;
  margin-bottom: 0;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  line-height: 1.35;
  border-left: none;
  -webkit-appearance: none;
  appearance: none;
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sport > span:not(.sport-icon-wrap) {
  color: inherit;
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sport-icon-wrap {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sport-icon-wrap svg {
  width: 18px;
  height: 18px;
  display: block;
  color: var(--sp-sidebar-muted, #8b96a2);
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sport-icon-wrap i {
  font-size: 0.8125rem;
  color: var(--sp-sidebar-muted, #8b96a2);
  line-height: 1;
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sport:hover .sport-icon-wrap svg,
body.sp-theme:not(.game-page) aside.sports-sidebar .sport:hover .sport-icon-wrap i,
body.sp-theme:not(.game-page) aside.sports-sidebar .sport.active .sport-icon-wrap svg,
body.sp-theme:not(.game-page) aside.sports-sidebar .sport.active .sport-icon-wrap i {
  color: #fff;
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sport span {
  flex: 1;
  min-width: 0;
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sport:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sport.active {
  color: #fff;
  font-weight: 700;
  background: transparent;
  border-left-color: transparent;
  box-shadow: none;
}

@media (max-width: 768px) {
  body.sp-theme:not(.game-page) aside.sports-sidebar {
    display: none;
  }
}

/* Sidebar text — win over legacy .sport / button defaults */
body.sp-theme:not(.game-page) aside.sports-sidebar .sports-sidebar-nav .sport,
body.sp-theme:not(.game-page) aside.sports-sidebar .sports-sidebar-nav .sport > span:not(.sport-icon-wrap) {
  color: var(--sp-sidebar-muted, #8b96a2);
}

body.sp-theme:not(.game-page) aside.sports-sidebar .sports-sidebar-nav .sport:hover,
body.sp-theme:not(.game-page) aside.sports-sidebar .sports-sidebar-nav .sport:hover > span:not(.sport-icon-wrap),
body.sp-theme:not(.game-page) aside.sports-sidebar .sports-sidebar-nav .sport.active,
body.sp-theme:not(.game-page) aside.sports-sidebar .sports-sidebar-nav .sport.active > span:not(.sport-icon-wrap) {
  color: #ffffff;
}

/* Mobile sport chips — icon badges */
body.sp-theme .sport-icon-wrap--chip {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--sp-green-soft);
  flex-shrink: 0;
}

body.sp-theme .sport-icon-wrap--chip svg {
  width: 16px;
  height: 16px;
  color: var(--sp-green-dark);
}

body.sp-theme .sport-icon-wrap--chip i {
  font-size: 0.6875rem;
  color: var(--sp-green-dark);
  line-height: 1;
}

/* Sports drawer icons */
.sports-drawer-nav .sport-icon-wrap {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sports-drawer-nav .sport-icon-wrap svg {
  width: 18px;
  height: 18px;
  color: #8b96a2;
}

.sports-drawer-nav .sport-icon-wrap i {
  font-size: 0.8125rem;
  color: #8b96a2;
}

.sports-drawer-nav .sport:hover .sport-icon-wrap svg,
.sports-drawer-nav .sport:hover .sport-icon-wrap i,
.sports-drawer-nav .sport.active .sport-icon-wrap svg,
.sports-drawer-nav .sport.active .sport-icon-wrap i {
  color: #fff;
}

.sports-drawer-nav .sport.active .sport-icon-wrap {
  background: transparent;
}

/* Mobile bottom nav — executive icon circles */
body.sp-theme .mobile-nav-icon-wrap {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
  transition: background 0.2s, transform 0.15s;
}

body.sp-theme .mobile-nav-icon-wrap i {
  font-size: 1.0625rem;
  color: var(--sp-ink-muted);
  line-height: 1;
}

body.sp-theme .mobile-nav-icon-wrap--live {
  position: relative;
}

body.sp-theme .mobile-nav-icon-wrap--live::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff3b30;
  animation: fbLivePulse 1.6s ease-in-out infinite;
}

body.sp-theme .mobile-bottom-nav-item.active .mobile-nav-icon-wrap {
  background: var(--sp-green-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 150, 57, 0.12);
}

body.sp-theme .mobile-bottom-nav-item.active .mobile-nav-icon-wrap i {
  color: var(--sp-green-dark);
}

body.sp-theme .mobile-bottom-nav-item:active .mobile-nav-icon-wrap {
  transform: scale(0.94);
}
