/*
 * Bootstrap colour override for the hackathon-portal
 * (primary cn-blue #0088DD, danger cn-red #EF5C64, success cn-green #12A286, warning cn-yellow #FFB123).
 * Generated, then hand-edited. Regenerate from the hp/ folder with (two steps):
 *
 *   node housekeeping/derive-colors.mjs \
 *     --primary=#0088DD --danger=#EF5C64 --success=#12A286 --warning=#FFB123 \
 *     --scope=html --out=apps/hackathon-portal/src/assets/theme/bootstrap-override.css
 *   sed -i '1s/^html {$/html:root {/' apps/hackathon-portal/src/assets/theme/bootstrap-override.css
 *
 * Then put this header back on top AND re-apply the hand edits below - regenerating drops them.
 *
 * Hand edits (white button text kept for the brand look, against the generator's
 * contrast choice of black):
 * - .btn-primary: --bs-btn-color, -hover-color, -active-color, -disabled-color #ffffff;
 *   --bs-btn-hover-bg #0069aa (darker, generator gives a lighter #269ae2).
 * - .btn-success: --bs-btn-color, -hover-color, -active-color, -disabled-color #ffffff.
 * - .btn-danger: --bs-btn-color, -hover-color, -active-color #ffffff.
 * - .btn-outline-primary / -success / -danger: --bs-btn-hover-color, -active-color #ffffff.
 *
 * Why two scopes (this file loads BEFORE styles.css, so it can only win on specificity):
 * - Variables on html:root (0,1,1): beats Bootstrap's :root (0,1,0) block.
 * - Component rules on html, e.g. "html .btn-primary" (0,1,1): beats Bootstrap's .btn-primary
 *   (0,1,0), but loses to a contest theme's ".themeable .btn-primary" (0,2,0), which
 *   HackathonService.loadContestTheme$() loads per contest. Do not raise these to html:root,
 *   or contest themes can no longer override the buttons.
 * Loaded from index.html; it is a plain asset, so it can be replaced without a rebuild.
 */

html:root {
  --bs-primary: #0088dd;
  --bs-primary-rgb: 0, 136, 221;
  --bs-primary-text-emphasis: #003658;
  --bs-primary-bg-subtle: #cce7f8;
  --bs-primary-border-subtle: #99cff1;
  --bs-link-color: #0088dd;
  --bs-link-color-rgb: 0, 136, 221;
  --bs-link-hover-color: #006db1;
  --bs-link-hover-color-rgb: 0, 109, 177;
  --bs-focus-ring-color: rgba(0, 136, 221, 0.25);
  --bs-success: #12a286;
  --bs-success-rgb: 18, 162, 134;
  --bs-success-text-emphasis: #074136;
  --bs-success-bg-subtle: #d0ece7;
  --bs-success-border-subtle: #a0dacf;
  --bs-form-valid-color: #12a286;
  --bs-form-valid-border-color: #12a286;
  --bs-danger: #ef5c64;
  --bs-danger-rgb: 239, 92, 100;
  --bs-danger-text-emphasis: #602528;
  --bs-danger-bg-subtle: #fcdee0;
  --bs-danger-border-subtle: #f9bec1;
  --bs-form-invalid-color: #ef5c64;
  --bs-form-invalid-border-color: #ef5c64;
  --bs-warning: #ffb123;
  --bs-warning-rgb: 255, 177, 35;
  --bs-warning-text-emphasis: #66470e;
  --bs-warning-bg-subtle: #ffefd3;
  --bs-warning-border-subtle: #ffe0a7;
}

html .btn-primary {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: #0088dd;
  --bs-btn-border-color: #0088dd;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #0069aa;
  --bs-btn-hover-border-color: #1a94e0;
  --bs-btn-focus-shadow-rgb: 0, 116, 188;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #33a0e4;
  --bs-btn-active-border-color: #1a94e0;
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-bg: #0088dd;
  --bs-btn-disabled-border-color: #0088dd;
}

html .btn-outline-primary {
  --bs-btn-color: #0088dd;
  --bs-btn-border-color: #0088dd;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #0088dd;
  --bs-btn-hover-border-color: #0088dd;
  --bs-btn-focus-shadow-rgb: 0, 136, 221;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #0088dd;
  --bs-btn-active-border-color: #0088dd;
  --bs-btn-disabled-color: #0088dd;
  --bs-btn-disabled-border-color: #0088dd;
}

html .text-bg-primary {
  color: #000000 !important;
}

html .link-primary:hover,
html .link-primary:focus {
  color: RGBA(51, 160, 228, var(--bs-link-opacity, 1)) !important;
  -webkit-text-decoration-color: RGBA(51, 160, 228, var(--bs-link-underline-opacity, 1)) !important;
  text-decoration-color: RGBA(51, 160, 228, var(--bs-link-underline-opacity, 1)) !important;
}

html .table-primary {
  --bs-table-color: #000000;
  --bs-table-bg: #cce7f8;
  --bs-table-border-color: #a3b9c6;
  --bs-table-striped-bg: #c2dbec;
  --bs-table-striped-color: #000000;
  --bs-table-active-bg: #b8d0df;
  --bs-table-active-color: #000000;
  --bs-table-hover-bg: #bdd6e5;
  --bs-table-hover-color: #000000;
}

html .form-control:focus {
  border-color: #80c4ee;
  box-shadow: 0 0 0 0.25rem rgba(0, 136, 221, 0.25);
}

html .form-select:focus {
  border-color: #80c4ee;
  box-shadow: 0 0 0 0.25rem rgba(0, 136, 221, 0.25);
}

html .form-check-input:focus {
  border-color: #80c4ee;
  box-shadow: 0 0 0 0.25rem rgba(0, 136, 221, 0.25);
}

html .form-check-input:checked {
  background-color: #0088dd;
  border-color: #0088dd;
}

html .form-check-input[type=checkbox]:indeterminate {
  background-color: #0088dd;
  border-color: #0088dd;
}

html .form-switch .form-check-input:focus {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2380c4ee'/%3e%3c/svg%3e");
}

html .form-range:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px #fff, 0 0 0 0.25rem rgba(0, 136, 221, 0.25);
}

html .form-range:focus::-moz-range-thumb {
  box-shadow: 0 0 0 1px #fff, 0 0 0 0.25rem rgba(0, 136, 221, 0.25);
}

html .form-range::-webkit-slider-thumb {
  background-color: #0088dd;
}

html .form-range::-webkit-slider-thumb:active {
  background-color: #b3dbf5;
}

html .form-range::-moz-range-thumb {
  background-color: #0088dd;
}

html .form-range::-moz-range-thumb:active {
  background-color: #b3dbf5;
}

html .btn-link {
  --bs-btn-focus-shadow-rgb: 0, 116, 188;
}

html .dropdown-menu {
  --bs-dropdown-link-active-bg: #0088dd;
}

html .dropdown-menu-dark {
  --bs-dropdown-link-active-bg: #0088dd;
}

html .nav-link:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(0, 136, 221, 0.25);
}

html .nav-pills {
  --bs-nav-pills-link-active-bg: #0088dd;
}

html .accordion {
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23003658' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(0, 136, 221, 0.25);
}

html .pagination {
  --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(0, 136, 221, 0.25);
  --bs-pagination-active-bg: #0088dd;
  --bs-pagination-active-border-color: #0088dd;
}

html .progress,
html .progress-stacked {
  --bs-progress-bar-bg: #0088dd;
}

html .list-group {
  --bs-list-group-active-bg: #0088dd;
  --bs-list-group-active-border-color: #0088dd;
}

html .btn-close {
  --bs-btn-close-focus-shadow: 0 0 0 0.25rem rgba(0, 136, 221, 0.25);
}

html .btn-success {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: #12a286;
  --bs-btn-border-color: #12a286;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #36b098;
  --bs-btn-hover-border-color: #2aab92;
  --bs-btn-focus-shadow-rgb: 15, 138, 114;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #41b59e;
  --bs-btn-active-border-color: #2aab92;
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-bg: #12a286;
  --bs-btn-disabled-border-color: #12a286;
}

html .btn-outline-success {
  --bs-btn-color: #12a286;
  --bs-btn-border-color: #12a286;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #12a286;
  --bs-btn-hover-border-color: #12a286;
  --bs-btn-focus-shadow-rgb: 18, 162, 134;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #12a286;
  --bs-btn-active-border-color: #12a286;
  --bs-btn-disabled-color: #12a286;
  --bs-btn-disabled-border-color: #12a286;
}

html .text-bg-success {
  color: #000000 !important;
}

html .link-success:hover,
html .link-success:focus {
  color: RGBA(65, 181, 158, var(--bs-link-opacity, 1)) !important;
  -webkit-text-decoration-color: RGBA(65, 181, 158, var(--bs-link-underline-opacity, 1)) !important;
  text-decoration-color: RGBA(65, 181, 158, var(--bs-link-underline-opacity, 1)) !important;
}

html .table-success {
  --bs-table-color: #000000;
  --bs-table-bg: #d0ece7;
  --bs-table-border-color: #a6bdb9;
  --bs-table-striped-bg: #c6e0db;
  --bs-table-striped-color: #000000;
  --bs-table-active-bg: #bbd4d0;
  --bs-table-active-color: #000000;
  --bs-table-hover-bg: #c0dad6;
  --bs-table-hover-color: #000000;
}

html .was-validated .form-control:valid,
html .form-control.is-valid {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2312a286' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1'/%3e%3c/svg%3e");
}

html .was-validated .form-select:valid:not([multiple]):not([size]),
html .was-validated .form-select:valid:not([multiple])[size="1"],
html .form-select.is-valid:not([multiple]):not([size]),
html .form-select.is-valid:not([multiple])[size="1"] {
  --bs-form-select-bg-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2312a286' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1'/%3e%3c/svg%3e");
}

html .btn-danger {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: #ef5c64;
  --bs-btn-border-color: #ef5c64;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #f1747b;
  --bs-btn-hover-border-color: #f16c74;
  --bs-btn-focus-shadow-rgb: 203, 78, 85;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #f27d83;
  --bs-btn-active-border-color: #f16c74;
  --bs-btn-disabled-color: #000000;
  --bs-btn-disabled-bg: #ef5c64;
  --bs-btn-disabled-border-color: #ef5c64;
}

html .btn-outline-danger {
  --bs-btn-color: #ef5c64;
  --bs-btn-border-color: #ef5c64;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #ef5c64;
  --bs-btn-hover-border-color: #ef5c64;
  --bs-btn-focus-shadow-rgb: 239, 92, 100;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #ef5c64;
  --bs-btn-active-border-color: #ef5c64;
  --bs-btn-disabled-color: #ef5c64;
  --bs-btn-disabled-border-color: #ef5c64;
}

html .text-bg-danger {
  color: #000000 !important;
}

html .link-danger:hover,
html .link-danger:focus {
  color: RGBA(242, 125, 131, var(--bs-link-opacity, 1)) !important;
  -webkit-text-decoration-color: RGBA(242, 125, 131, var(--bs-link-underline-opacity, 1)) !important;
  text-decoration-color: RGBA(242, 125, 131, var(--bs-link-underline-opacity, 1)) !important;
}

html .table-danger {
  --bs-table-color: #000000;
  --bs-table-bg: #fcdee0;
  --bs-table-border-color: #cab2b3;
  --bs-table-striped-bg: #efd3d5;
  --bs-table-striped-color: #000000;
  --bs-table-active-bg: #e3c8ca;
  --bs-table-active-color: #000000;
  --bs-table-hover-bg: #e9cdcf;
  --bs-table-hover-color: #000000;
}

html .was-validated .form-control:invalid,
html .form-control.is-invalid {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef5c64'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef5c64' stroke='none'/%3e%3c/svg%3e");
}

html .was-validated .form-select:invalid:not([multiple]):not([size]),
html .was-validated .form-select:invalid:not([multiple])[size="1"],
html .form-select.is-invalid:not([multiple]):not([size]),
html .form-select.is-invalid:not([multiple])[size="1"] {
  --bs-form-select-bg-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef5c64'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef5c64' stroke='none'/%3e%3c/svg%3e");
}

html .btn-warning {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: #ffb123;
  --bs-btn-border-color: #ffb123;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #ffbd44;
  --bs-btn-hover-border-color: #ffb939;
  --bs-btn-focus-shadow-rgb: 217, 150, 30;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #ffc14f;
  --bs-btn-active-border-color: #ffb939;
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-bg: #ffb123;
  --bs-btn-disabled-border-color: #ffb123;
}

html .btn-outline-warning {
  --bs-btn-color: #ffb123;
  --bs-btn-border-color: #ffb123;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #ffb123;
  --bs-btn-hover-border-color: #ffb123;
  --bs-btn-focus-shadow-rgb: 255, 177, 35;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #ffb123;
  --bs-btn-active-border-color: #ffb123;
  --bs-btn-disabled-color: #ffb123;
  --bs-btn-disabled-border-color: #ffb123;
}

html .text-bg-warning {
  color: #000000 !important;
}

html .link-warning:hover,
html .link-warning:focus {
  color: RGBA(255, 193, 79, var(--bs-link-opacity, 1)) !important;
  -webkit-text-decoration-color: RGBA(255, 193, 79, var(--bs-link-underline-opacity, 1)) !important;
  text-decoration-color: RGBA(255, 193, 79, var(--bs-link-underline-opacity, 1)) !important;
}

html .table-warning {
  --bs-table-color: #000000;
  --bs-table-bg: #ffefd3;
  --bs-table-border-color: #ccbfa9;
  --bs-table-striped-bg: #f2e3c8;
  --bs-table-striped-color: #000000;
  --bs-table-active-bg: #e6d7be;
  --bs-table-active-color: #000000;
  --bs-table-hover-bg: #ecddc3;
  --bs-table-hover-color: #000000;
}
