/*
 * NEC Survey theme overrides for Bootstrap 5.3.
 *
 * The original project shipped a hand-edited copy of Bootstrap 5.0.2
 * (public/css/bootstrap.min.css). These are exactly the rules that differed
 * from stock 5.0.2, re-applied on top of the npm-installed Bootstrap so the
 * look is unchanged. Bootstrap 5.3 styles buttons through --bs-btn-* custom
 * properties, so the button edits are expressed through those variables.
 * Load this file directly after vendor/bootstrap/css/bootstrap.min.css.
 */

/*
 * Bootstrap 5.0.2 defaults that 5.3 changed and the layouts depend on
 * (border radii, translucent borders, table text colour, muted text,
 * modal text inheritance, disabled pagination background).
 */
:root {
    --bs-border-radius: .25rem;
    --bs-border-radius-sm: .2rem;
    --bs-border-radius-lg: .3rem;
    --bs-border-color-translucent: rgba(0, 0, 0, .125);
}

.modal {
    --bs-modal-border-color: rgba(0, 0, 0, .2);
}

.modal-content {
    color: inherit;
}

.text-muted {
    color: #6c757d !important;
}

.pagination {
    --bs-pagination-disabled-bg: #fff;
}

.table {
    --bs-table-color: #212529;
    --bs-table-striped-color: #212529;
    --bs-table-active-color: #212529;
    --bs-table-hover-color: #212529;
}

.table > :not(:last-child) > :last-child > * {
    border-bottom-color: currentColor;
}

/* Original theme edits */
.table > :not(caption) > * > * {
    background-color: #ffffff;
}

.form-control {
    border-radius: 0rem;
}

.form-control:focus {
    border-color: #82d5e6;
    box-shadow: 0 0 0 0.25rem rgb(130 249 222 / 38%);
}

.input-group-text {
    background-color: #82d5e6;
    border: 1px solid #81d0e0;
    border-radius: 0rem;
}

.btn {
    --bs-btn-padding-y: 0.9rem;
    --bs-btn-padding-x: 0.95rem;
    --bs-btn-border-radius: 0rem;
}

.btn-primary {
    --bs-btn-bg: #4996a6;
    --bs-btn-border-color: #95e4f4;
    --bs-btn-hover-bg: #59b0c2;
    --bs-btn-hover-border-color: #59b0c2;
    --bs-btn-focus-box-shadow: 0 0 0 0.25rem rgb(130 249 222 / 38%);
    --bs-btn-active-bg: #59b0c2;
    --bs-btn-active-border-color: #59b0c2;
    text-transform: uppercase;
}

/*
 * The Reports "Filter" toggle is an .accordion-button placed outside any .accordion.
 * Bootstrap 5.3 reads accordion colours/icons from variables declared on .accordion,
 * so supply them here, using the 5.0.2 values the design was built with.
 */
.accordion-header {
    --bs-accordion-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out, border-radius .15s ease;
    --bs-accordion-border-color: rgba(0, 0, 0, .125);
    --bs-accordion-border-width: 1px;
    --bs-accordion-btn-padding-x: 1.25rem;
    --bs-accordion-btn-padding-y: 1rem;
    --bs-accordion-btn-color: #212529;
    --bs-accordion-btn-bg: #fff;
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-icon-width: 1.25rem;
    --bs-accordion-btn-icon-transform: rotate(-180deg);
    --bs-accordion-btn-icon-transition: transform .2s ease-in-out;
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230c63e4'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
    --bs-accordion-active-color: #0c63e4;
    --bs-accordion-active-bg: #e7f1ff;
}

/* 5.0.2 gave a focused (not hovered) primary button the hover colours and a teal border */
.btn-check:focus + .btn-primary,
.btn-primary:focus {
    color: #fff;
    background-color: #59b0c2;
    border-color: #7ccfe0;
    box-shadow: var(--bs-btn-focus-box-shadow);
}
