/* ============================================================
   BET SLIP — sticky right column, primary user-action surface
   Contains: header (count + clear), selections, totals, place btn
   States: empty / 1+ selections / validation error
   ============================================================ */

.bet-slip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Don't let it grow too tall; user scrolls within */
  max-height: calc(100vh - var(--space-7) * 2);
}

/* Header */
.bet-slip__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.bet-slip__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.bet-slip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.bet-slip__clear {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  cursor: pointer;
  text-decoration: none;
}

.bet-slip__clear:hover {
  color: var(--text-primary);
}

/* Mode tabs (Single / Parlay) — only when 2+ selections */
.bet-slip__mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: var(--space-2);
  background: var(--bg-subtle);
  margin: var(--space-3) var(--space-3) 0;
  border-radius: var(--radius-md);
}

.bet-slip__mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: var(--space-2);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: var(--weight-medium);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.bet-slip__mode-btn:hover { color: var(--text-secondary); }

.bet-slip__mode-btn--active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-sm);
}

.bet-slip__mode-btn-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
}

/* Selections list (scrollable if many) */
.bet-slip__selections {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  overflow-y: auto;
  flex: 1;
}

.bet-slip__selections::-webkit-scrollbar { width: 6px; }
.bet-slip__selections::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

/* Single selection */
.selection {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
}

.selection--error {
  border-color: var(--color-danger);
}

.selection__remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.selection__remove:hover {
  color: var(--color-danger);
  background: var(--color-danger-subtle);
}

.selection__remove svg {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

.selection__match {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding-right: var(--space-5);
}

.selection__pick {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-right: var(--space-5);
}

.selection__pick-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.selection__pick-market {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  display: block;
  margin-top: 2px;
  font-weight: var(--weight-normal);
}

.selection__odds {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

/* Stake input row */
.selection__stake-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.selection__stake {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.selection--error .selection__stake {
  border-color: var(--color-danger);
}

.selection__stake-prefix {
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
}

.selection__stake-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: var(--space-2) var(--space-2) var(--space-2) 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  width: 100%;
}

.selection__stake-input:focus {
  outline: none;
}

.selection__stake:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

/* Risk meter — visual feedback against max stake (2% rule) */
.selection__risk {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.selection__risk-bar {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border-subtle);
  overflow: hidden;
  position: relative;
}

.selection__risk-fill {
  height: 100%;
  background: var(--color-success);
  border-radius: inherit;
  transition: width var(--transition-base), background var(--transition-fast);
}

.selection__risk-fill--warn { background: var(--color-warning); }
.selection__risk-fill--danger { background: var(--color-danger); }

.selection__risk-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}

.selection__risk-label-value {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

/* Return display */
.selection__return {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.selection__return-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-success-text);
  letter-spacing: -0.01em;
}

/* Inline validation error */
.selection__error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--color-danger-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-danger-text);
  line-height: var(--leading-snug);
}

.selection__error svg {
  width: 12px;
  height: 12px;
  stroke-width: 2;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Footer: totals + place button + daily count */
.bet-slip__footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.bet-slip__totals {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.bet-slip__total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.bet-slip__total-row--main {
  padding-top: var(--space-2);
  margin-top: var(--space-1);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.bet-slip__total-value {
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.bet-slip__total-row--main .bet-slip__total-value {
  color: var(--color-success-text);
  font-weight: var(--weight-semibold);
}

/* Place button (full width) */
.bet-slip__place {
  width: 100%;
  justify-content: center;
}

/* Daily limit info */
.bet-slip__daily {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.bet-slip__daily-value {
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* Empty state */
.bet-slip__empty {
  padding: var(--space-7) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: center;
  flex: 1;
}

.bet-slip__empty-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.bet-slip__empty-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.bet-slip__empty-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.bet-slip__empty-text {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: var(--leading-snug);
  max-width: 220px;
}
