/**
 * Premium UX polish — hierarchy, scan speed, slip flow, micro-interactions.
 * Loads after theme + mobile-premium. Not a redesign: spacing, weight, motion, touch.
 */

/* --------------------------------------------------------------------------
   0) Bet slip header — segmented tabs + secondary quick-bet + close
   -------------------------------------------------------------------------- */
.betslip-header {
  padding: 8px 10px !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(11, 15, 20, 0.99)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  flex-shrink: 0;
}

.betslip-header__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.betslip-header__main {
  flex: 1 1 auto;
  min-width: 0;
}

.betslip-header__segment .bet-type {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  gap: 0 !important;
  width: 100%;
  max-width: 100%;
  padding: 3px;
  margin: 0 !important;
  padding-bottom: 0 !important;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
}

.betslip-header__segment .bet-type__btn {
  flex: 1 1 0;
  min-width: 0;
  margin: 0 !important;
  padding: 7px 8px !important;
  border-radius: 8px !important;
  border: none !important;
  background: transparent !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

/* My Bets: navigates to full history — same chrome as tab, no radio */
.betslip-header__segment a.bet-type__btn--my-bets-link {
  text-decoration: none !important;
  color: inherit !important;
}

.betslip-header__segment .bet-type__btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.9) !important;
  white-space: nowrap;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.betslip-header__segment .bet-type__btn:has(input:checked) {
  background: linear-gradient(135deg, var(--ct777-accent), var(--ct-brand-primary-dark, #00a3cc)) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.betslip-header__segment .bet-type__btn:has(input:checked) span {
  color: #0b0f14 !important;
}

.betslip-header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.betslip-header__quick-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.betslip-header__quick-slot .quick-bet-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(226, 232, 240, 0.75);
}

.betslip-header__quick-slot .quick-bet-toggle:hover {
  border-color: rgba(0, 212, 255, 0.35);
  color: var(--ct777-accent, #00d4ff);
}

.betslip-header__quick-slot .quick-bet-toggle.active {
  border-color: rgba(0, 212, 255, 0.55);
  color: var(--ct777-accent, #00d4ff);
}

.betslip-header__actions .betslip-close-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
}

.betslip-header__actions .betslip-close-btn:hover {
  border-color: rgba(0, 212, 255, 0.35);
  color: var(--ct777-accent, #00d4ff);
}

@media (max-width: 400px) {
  .betslip-header__segment .bet-type__btn span {
    font-size: clamp(0.62rem, 2.5vw + 0.35rem, 0.78rem) !important;
    gap: 4px;
  }

  .betslip-header__segment .bet-type__btn i[data-lucide],
  .betslip-header__segment .bet-type__btn svg.lucide {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
}

@media (max-width: 320px) {
  .betslip-header__row {
    gap: 4px;
  }

  .betslip-header__actions {
    gap: 4px;
  }
}

/* --------------------------------------------------------------------------
   1) Markets page — team vs league vs odds hierarchy
   -------------------------------------------------------------------------- */
.odd-list--markets-page .odd-list__title {
  margin-bottom: 0.75rem;
}

.odd-list--markets-page .odd-list__head {
  margin-bottom: 1rem !important;
}

.odd-list__team-name--primary {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ct777-text, #e8edf5) !important;
}

.odd-list__meta {
  width: 100%;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(232, 237, 245, 0.55);
  letter-spacing: 0.02em;
}

.odd-list__meta-label {
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(232, 237, 245, 0.4);
  margin-right: 0.35rem;
}

/* Market groups: clear separation */
.odd-list__market-group {
  margin-bottom: 12px;
}

.odd-list__market-group:last-child {
  margin-bottom: 0;
}

.accordion--odd.odd-list__market-group .accordion-item {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.accordion--odd .accordion-button {
  min-height: 48px;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  color: rgba(248, 250, 252, 0.95) !important;
}

.accordion--odd .accordion-button:not(.collapsed) {
  border-bottom: 1px solid rgba(0, 212, 255, 0.12);
}

.accordion--odd .accordion-body {
  padding: 4px 12px 14px !important;
}

.odd-list__outcomes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.odd-list__outcome-row {
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.odd-list__outcome-row:last-child {
  border-bottom: none;
}

.odd-list__outcome-text {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(241, 245, 249, 0.92) !important;
}

.odd-list__outcome.oddBtn {
  flex-shrink: 0;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/*
 * Markets page — override main.css light-gray outcome cards (#f9f9f9) + low-contrast odds.
 * Scoped to .cafetal777-layout .odd-list--markets-page (matches mobile-premium specificity).
 */
.cafetal777-layout .odd-list--markets-page .odd-list__market-group {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.cafetal777-layout .odd-list--markets-page .accordion--odd .accordion-button {
  background: rgba(0, 212, 255, 0.1) !important;
  color: #eaf6ff !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.cafetal777-layout .odd-list--markets-page .accordion--odd .accordion-button__label {
  letter-spacing: 0.3px;
}

.cafetal777-layout .odd-list--markets-page .accordion--odd .accordion-body {
  padding: 6px 10px 12px !important;
  background: rgba(11, 15, 20, 0.98) !important;
  background-color: rgba(11, 15, 20, 0.98) !important;
  color: #ffffff !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* main.css forces #f9f9f9 on li — restore dark theme readability */
.cafetal777-layout .odd-list--markets-page .odd-list__outcomes {
  padding: 6px 8px 12px !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__outcomes > li.odd-list__outcome-row {
  background: rgba(17, 24, 39, 0.72) !important;
  background-color: rgba(17, 24, 39, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  margin-bottom: 8px !important;
  padding: 10px 12px !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__outcomes > li.odd-list__outcome-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.06) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__outcomes > li.odd-list__outcome-row:last-child {
  margin-bottom: 0 !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__outcome-text {
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__outcome.oddBtn {
  background: #111827 !important;
  color: #ffffff !important;
  border: 1px solid rgba(0, 212, 255, 0.35) !important;
  border-radius: 8px !important;
  min-width: 56px !important;
  min-height: 36px !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__outcome.oddBtn:hover:not(.locked) {
  background: rgba(0, 212, 255, 0.18) !important;
  border-color: #00d4ff !important;
  color: #ffffff !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__outcome.oddBtn:active:not(.locked) {
  transform: scale(0.96);
}

.cafetal777-layout .odd-list--markets-page .odd-list__outcome.oddBtn.active {
  background: var(--ct777-accent, #00d4ff) !important;
  border-color: var(--ct777-accent, #00d4ff) !important;
  color: #0b0f14 !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__head {
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.15), rgba(0, 0, 0, 0)) !important;
  border: 1px solid rgba(0, 212, 255, 0.25) !important;
  border-radius: 12px !important;
  padding: 12px !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__team-name--primary {
  color: #ffffff !important;
  font-weight: 600 !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__meta {
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 12px !important;
}

.cafetal777-layout .odd-list--markets-page .odd-list__meta-label {
  color: rgba(255, 255, 255, 0.55) !important;
}

@media (max-width: 575.98px) {
  .cafetal777-layout .odd-list--markets-page .odd-list__outcomes > li.odd-list__outcome-row {
    padding: 12px 10px !important;
  }

  .cafetal777-layout .odd-list--markets-page .odd-list__outcome.oddBtn {
    min-width: 52px !important;
    min-height: 34px !important;
    font-size: 13px !important;
  }
}

/* --------------------------------------------------------------------------
   2) Fixture table — teams bold, league muted
   -------------------------------------------------------------------------- */
.sport-table__team--home,
.sport-table__team--away {
  font-weight: 700;
  color: rgba(248, 250, 252, 0.98);
  letter-spacing: -0.01em;
}

.sport-table__league {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem !important;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(148, 163, 184, 0.95) !important;
}

.sport-table__vs {
  font-weight: 600;
  opacity: 0.75;
  font-size: 0.72em;
}

/* --------------------------------------------------------------------------
   3) Bet slip — vertical flow & summary emphasis
   -------------------------------------------------------------------------- */
.betslip-settle__section--type {
  margin-bottom: 0.75rem;
}

.betslip-settle__section--stake {
  padding-bottom: 0.85rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.betslip-settle__section--picks {
  padding: 0.35rem 0 0.65rem;
}

.betslip-settle__section--returns {
  margin-top: 0.15rem;
}

.bet-return__summary {
  padding: 12px 12px !important;
  border-radius: 10px !important;
  background: rgba(0, 212, 255, 0.08) !important;
  border: 1px solid rgba(0, 212, 255, 0.22) !important;
}

.bet-return__summary-value {
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

.betslip__footer-bottom .delete-btn {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.betslip__footer-bottom .delete-btn:active {
  transform: scale(0.96);
}

.betslip__footer-btn {
  min-height: 48px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.betslip__footer-btn:active {
  transform: scale(0.98);
}

/* --------------------------------------------------------------------------
   4) Odds — tap feedback (class toggled from bet_slip JS)
   -------------------------------------------------------------------------- */
.oddBtn:not(.locked) {
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.oddBtn--tapped {
  transform: scale(0.96);
}

.odd-list__outcome.oddBtn.oddBtn--tapped {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   5) Navigation — stronger active context (hub pills)
   -------------------------------------------------------------------------- */
.sport-hub__tabs--pills .sport-hub__tab {
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sport-hub__tabs--pills .sport-hub__tab.active {
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.35);
}

/* --------------------------------------------------------------------------
   6) Empty states
   -------------------------------------------------------------------------- */
.empty-slip-message__next {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(232, 237, 245, 0.55);
  max-width: 18rem;
  margin-inline: auto;
}

.empty-message--markets .empty-message__hint {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: rgba(232, 237, 245, 0.55);
  line-height: 1.45;
}

.premium-empty-state__hint {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: rgba(232, 237, 245, 0.5);
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .oddBtn--tapped,
  .odd-list__outcome.oddBtn.oddBtn--tapped,
  .betslip__footer-bottom .delete-btn:active,
  .betslip__footer-btn:active {
    transform: none !important;
  }

  .sport-hub__tabs--pills .sport-hub__tab {
    transition: none;
  }
}

@media (max-width: 991.98px) {
  .cafetal777-layout .sport-widget__odd.oddBtn {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
  }

  .cafetal777-layout .stake-preset-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 10px !important;
  }

  .cafetal777-layout .bet-return__summary {
    padding: 12px 12px !important;
  }

  .cafetal777-layout .bet-return__summary-value {
    font-size: 1.18rem !important;
  }
}

/* Desktop (≥992px): profile + header dropdowns above sticky bet slip sidebar */
@media (min-width: 992px) {
  /*
   * Sticky betslip requires ancestors without overflow-x: hidden (see responsive-new base).
   * Restore visible on desktop only — mobile keeps overflow-x hidden to prevent sideways scroll.
   */
  html,
  body,
  .cafetal777-layout {
    overflow-x: visible !important;
  }

  /* Sticky site header — stays visible while scrolling (was position:relative, which broke stickiness). */
  .cafetal777-layout .header-primary {
    position: sticky !important;
    top: 0 !important;
    z-index: 8000 !important;
    overflow: visible !important;
  }

  .cafetal777-layout .header-primary .container-fluid,
  .cafetal777-layout .header-primary .header-fluid-custom-parent {
    overflow: visible !important;
  }

  .cafetal777-layout .header-primary .dropdown-menu,
  .cafetal777-layout .header-primary .dropdown-menu.show {
    z-index: 8100 !important;
  }

  .cafetal777-layout .header-primary .user-profile-dropdown {
    position: relative;
    z-index: 1;
  }

  /*
   * Sticky sidebar: viewport-height column, does not stretch to full document height.
   * align-self: flex-start + explicit height lets position:sticky work against the viewport
   * without the slip scrolling away as one giant flex-stretched box.
   */
  .cafetal777-layout .betslip {
    position: sticky !important;
    top: var(--header-h, 67px) !important;
    align-self: flex-start !important;
    width: var(--ct777-betslip-width) !important;
    min-width: var(--ct777-betslip-width) !important;
    height: calc(100vh - var(--header-h, 67px)) !important;
    max-height: calc(100vh - var(--header-h, 67px)) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .cafetal777-layout .betslip .betslip-inner {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  /* Bet Slip tab: single flex column — body scrolls, footer stays at bottom */
  .cafetal777-layout .bet-slip-container.betslip-inner {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .cafetal777-layout .bet-slip-container .betslip__body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .cafetal777-layout .bet-slip-container .betslip__footer {
    flex-shrink: 0 !important;
    position: relative !important;
  }
}

/*
 * Empty slip only: larger empty-state block (sibling after list). No min-height on
 * .betslip__body — few picks stay content-sized in the scrollport; many picks scroll inside body.
 * :not(:has(> li)) covers skeleton/whitespace; :empty covers a truly empty <ul>.
 */
.cafetal777-layout .bet-slip-container .betslip__list:empty + .empty-slip-message,
.cafetal777-layout .bet-slip-container .betslip__list:not(:has(> li)) + .empty-slip-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(480px, 52vh);
}

/* Sports rail — current sport / live context */
.sports-category__link.active {
  box-shadow: inset 0 0 0 2px rgba(0, 212, 255, 0.35);
}

/* Slip selections — clearer card separation */
.betslip-item,
.betslip__list > li.betslip-item {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
