/* Bootstrap overrides (Bootstrap CSS loaded from CDN in layout) */

/* Remap primary buttons to use secondary colors (toggle this when switching themes) */
.btn-primary {
  --bs-btn-bg: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-secondary);
  --bs-btn-hover-bg: var(--bs-secondary);
  --bs-btn-hover-border-color: var(--bs-secondary);
  --bs-btn-active-bg: var(--bs-secondary);
  --bs-btn-active-border-color: var(--bs-secondary);
}
.btn-outline-primary {
  --bs-btn-color: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-secondary);
  --bs-btn-hover-bg: var(--bs-secondary);
  --bs-btn-hover-border-color: var(--bs-secondary);
  --bs-btn-active-bg: var(--bs-secondary);
  --bs-btn-active-border-color: var(--bs-secondary);
}

a {
  text-decoration: none;
  color: var(--bs-secondary-emphasis);
}
a:hover {
  text-decoration: underline;
  color: var(--bs-secondary-emphasis);
}

/* Form controls - use theme-aware border */
.form-control {
  border-radius: 4px;
}

/* List separators (used in bets, devise) */
.links li + li {
  border-left: 1px solid var(--bs-border-color);
  padding-left: 10px;
}
.links li:first-child {
  border: none;
}

/* Table footer styling */
th.table-footer {
  border-top: 2px solid var(--bs-border-color) !important;
  border-bottom: none !important;
}

/* Preview/highlight boxes */
.preview {
  background-color: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  padding: 20px;
  margin-top: 20px;
}
.preview .label {
  display: inline;
  font-weight: bold;
}

/* List inline separators */
.list-inline-item + .list-inline-item:not(.right)::before {
  content: "|";
  padding-right: 0.5rem;
  color: var(--bs-secondary-color);
}

/* Make Bootstrap Icons larger in navbar */
.navbar .bi {
  font-size: 1.5em;
  vertical-align: -0.35em;
}

/* Wider nav items */
.navbar-nav .nav-link {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

body > .container {
  padding: 75px 15px 0;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60px;
}

.footer > .container {
  margin-top: 20px;
  padding-right: 15px;
  padding-left: 15px;
}

/* Restore Bootstrap 3 form-group behavior */
.form-group {
  margin-bottom: 1rem;
}

.navbar-form .form-group {
  margin-right: 5px;
}

#new_import {
  margin-top: 5em;
}

/* Bets table - stripe only unformatted (pending) rows */
#bets tbody tr:not(.table-success):not(.table-danger):not(.table-info):nth-child(even) td {
  background-color: rgba(180, 180, 180, 0.08) !important;
  color: var(--bs-body-color) !important;
}

/* Bets table row status colors - more vivid than default Bootstrap pastels */
#bets tr.table-success td { background-color: rgba(var(--bs-success-rgb), 0.5) !important; color: var(--bs-body-color) !important; }
#bets tr.table-danger td  { background-color: rgba(var(--bs-danger-rgb), 0.5) !important; color: var(--bs-body-color) !important; }
#bets tr.table-info td { background-color: rgba(180, 180, 180, 0.2) !important; color: var(--bs-body-color) !important; }
#balances thead th,
#balances tfoot th,
#bets thead th,
#bets tfoot th { background-color: rgba(180, 180, 180, 0.5) !important; color: var(--bs-body-color) !important; }

/* Bets */

input.form-control.datepicker {
  width: 8em;
}

input.form-control.currency {
  width: 6em;
  flex: none;
}

#all-bets, #pending-bets, #resulted-bets {
  margin-bottom: 2px;
}

#start-date-charts, #end-date-charts,
#start-date-bets, #end-date-bets {
  display: inline-block;
  vertical-align: top;
  margin-right: 5px;
  width: 8em;
}

#permalink-bets-table {
  margin-left: 5px;
}

div.fixed-table-footer {
  font-size: 80%;
}
div.fixed-table-footer .footer-label { font-weight: bold; }
div.fixed-table-footer .footer-value { font-weight: normal; }

a.remove-bet, a.autofill {
  margin-left: 10px;
}

.bonus_bet {
  padding-left: 15px;
  margin-top: 8px;
}
.bonus_bet label {
  margin-left: 5px;
  font-weight: bold;
}

#bets td {
  vertical-align: middle;
}

#bets td.resulted_on,
#bets td.bookie,
#bets td.stake,
#bets td.odds,
#bets td.units,
#bets td.profit,
#bets td.placed_on,
#bets td.category,
#bets td.source,
#bets td.action {
  white-space: nowrap;
}

#bets td.resulted_on,
#bets td.placed_on,
#bets td.action {
  text-align: middle;
}

#bets td.stake,
#bets td.odds,
#bets td.units,
#bets td.profit {
  text-align: right;
}

#bets td.action a {
  padding-left: 8px;
}

#bet-from-template-form {
  display: none;
}

ul.list-inline li.right {
  float: right;
}

/* Devise */

.form-signin {
  max-width: 330px;
  padding: 15px;
  margin: 0 auto;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
  margin-bottom: 10px;
}
.form-signin .checkbox {
  font-weight: normal;
}
.form-signin .form-control {
  position: relative;
  height: auto;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
  padding: 10px;
  font-size: 16px;
}
.form-signin .form-control:focus {
  z-index: 2;
}
.form-signin input[type="email"] {
  margin-bottom: -1px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
  margin-bottom: 10px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.form-signin .form-group {
  margin-bottom: 0px;
}
.form-signin .links {
  margin-top: 10px;
  text-align: center;
}

/* Exports */

#bets .col-sm-9 {
  margin-top: 7px;
}
#bets .col-sm-9 label {
  font-weight: normal;
  margin: 0 10px;
}

/* Export templates */

.remove-export_template {
  margin-left: 10px;
}

/* Import templates */

.remove-import_template {
  margin-left: 10px;
}

/* jQuery UI (loaded from CDN in layout) */

.ui-datepicker {
  z-index: 3 !important;
}

/* Watches */

#watches td.action a,
#watchers td.action a {
  padding-left: 8px;
}

/* Tom Select multiselect styling - inline display in filter bars */
.filters .ts-wrapper,
#chart-filters .ts-wrapper {
  display: inline-block;
  vertical-align: top;
  margin-right: 5px;
  margin-top: 0;
  margin-bottom: 0;
  width: 11em;
  position: relative;
  top: -2px;
}

/* Make dropdown menu wider to avoid text wrapping */
.ts-wrapper .ts-dropdown {
  width: max-content;
  min-width: 100%;
}

.ts-wrapper .ts-control {
  min-height: 38px;
}

/* Export CSV link alignment */
#export-csv {
  display: inline-block;
  vertical-align: top;
  line-height: 38px;
}

/* Dropdown caret indicator */
.ts-wrapper.multi .ts-control::after {
  content: "";
  display: inline-block;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--bs-secondary-color);
  pointer-events: none;
}

.ts-wrapper.multi .ts-control {
  position: relative;
  padding-right: 30px;
}

/* Style button_to forms in navbars to match regular nav-links */
.navbar-nav button.nav-link {
  background: none;
  border: none;
  cursor: pointer;
}
