/* Bootstrap 5 classes for the default theme.
   The default theme (bootstrap.css + blitzboard.css) is Bootstrap 4.3, the other themes are Bootstrap 5.
   The pages use Bootstrap 5 classes, this file gives them the Bootstrap 5 behaviour on the default theme.
   Only loaded with the default theme, so the Bootstrap 5 themes keep their own definitions. */

/* spacing: 1 = .25rem, 2 = .5rem, 3 = 1rem */
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-auto { margin-right: auto !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-auto { margin-left: auto !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }

/* gutters between the columns of a row */
.row.g-2 { margin: -.5rem -.25rem 0; }
.row.g-2 > * { padding-left: .25rem; padding-right: .25rem; margin-top: .5rem; }
.row.g-3 { margin: -1rem -.5rem 0; }
.row.g-3 > * { padding-left: .5rem; padding-right: .5rem; margin-top: 1rem; }

@media (min-width: 1400px) {
    .row-cols-xxl-5 > * { flex: 0 0 20%; max-width: 20%; }
}

/* text */
.fs-1 { font-size: 2.5rem !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-6 { font-size: 1rem !important; }
.fw-normal { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }
.font-monospace { font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important; }
.text-end { text-align: right !important; }

.bg-gradient { background-image: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0)) !important; }

/* secondary is almost white in the default theme: outlined buttons and badges would be unreadable */
.btn-outline-secondary {
    color: var(--bb-muted);
    border-color: var(--bb-muted);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary.active,
.show > .btn-outline-secondary.dropdown-toggle {
    color: #fff;
    background-color: var(--bb-muted);
    border-color: var(--bb-muted);
}

/* Bootstrap 4 badges get their text colour from badge-*, Bootstrap 5 badges from bg-* */
.badge.bg-primary, .badge.bg-success, .badge.bg-danger, .badge.bg-secondary { color: #fff; }
.badge.bg-secondary { background-color: var(--bb-muted) !important; }
.badge.bg-warning { color: var(--bb-ink); }

/* forms */
.form-label {
    display: inline-block;
    margin-bottom: .5rem;
}

.form-select {
    display: block;
    width: 100%;
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem 1.75rem .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    appearance: none;
}
.form-select:focus {
    border-color: var(--bb-green-light);
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(31, 94, 59, .25);
}
.form-select:disabled {
    color: #6c757d;
    background-color: #e9ecef;
}
.form-select-sm {
    height: calc(1.5em + .5rem + 2px);
    padding: .25rem 1.75rem .25rem .5rem;
    font-size: .875rem;
}

/* switch: a checkbox drawn as a toggle */
.form-switch {
    padding-left: 2.5em;
}
.form-switch .form-check-input {
    width: 2em;
    height: 1em;
    margin-left: -2.5em;
    margin-top: .25em;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280,0,0,.25%29'/%3e%3c/svg%3e") no-repeat left center/contain;
    border: 1px solid rgba(0, 0, 0, .25);
    border-radius: 2em;
    transition: background-position .15s ease-in-out;
    cursor: pointer;
}
.form-switch .form-check-input:checked {
    background-color: var(--bb-green);
    border-color: var(--bb-green);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-position: right center;
}
.form-switch .form-check-input:focus {
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(31, 94, 59, .25);
}
.form-switch .form-check-input:disabled {
    opacity: .5;
    cursor: default;
}
@media (prefers-reduced-motion: reduce) {
    .form-switch .form-check-input { transition: none; }
}

/* modal close button */
.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: .25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: .25rem;
    opacity: .5;
}
.btn-close:hover { opacity: .75; }
.btn-close:focus { outline: 0; box-shadow: 0 0 0 .2rem rgba(31, 94, 59, .25); opacity: 1; }
.modal-header .btn-close { margin: -.5rem -.5rem -.5rem auto; padding: .5rem; }

.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* gold text on white is too light to read (see blitzboard.css): outlined warning buttons get dark text */
.btn-outline-warning {
    color: var(--bb-ink);
    border-color: var(--bb-gold);
}
.btn-outline-warning:hover,
.btn-outline-warning:focus {
    color: var(--bb-ink);
    background-color: var(--bb-gold);
    border-color: var(--bb-gold);
}
