/* For highschool_matching */

/* Header (navbar) */
header nav a.navbar-brand {
  font-size: 1.1em;
}

.main {
  padding-right: 0;
  padding-bottom: 0 !important;
}

.row {

}

a.hidden_show_button {
  display: inline-block;
  height: 1.5em;
  width: 2em;
}

.explain_alg h2 {
  position: relative;
}

.explain_alg h2 > a.hidden_show_button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.explain_alg h2 > a.hidden_show_button::after {
  padding-right: 0;
}

.explain_alg {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 4px solid #6c757d;
}

.explain_quick {
  margin-bottom: 0.25rem;
}

.explain_reference {
  margin-top: 0.75rem;
}

.visual-learn-cta {
  margin: 0.75rem 0 1rem;
}

.visual-learn-cta-link {
  white-space: normal;
}

.visual-learn-cta-link .visual-learn-cta-icon {
  margin-right: 0.4rem;
  vertical-align: -0.125em;
}

.explain_quick_steps {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.major-section-heading,
.detail-section-heading {
  position: relative;
  padding-right: 2rem;
}

.major-section-heading > a.hidden_show_button {
  position: absolute;
  right: -0.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.detail-section-heading > a.hidden_show_button {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
}

.major-section-heading > a.hidden_show_button::after,
.detail-section-heading > a.hidden_show_button::after {
  padding-right: 0;
}

.detail-section-body {
  min-width: 0;
}

html,
body {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
}

#left,
#right {
  min-width: 0;
}

#matching-panels {
  min-height: 0;
  position: relative;
}

#ajax_error_alert {
  display: none;
  margin-bottom: 0.75rem;
}

@media (min-width: 992px) {
  #right_overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 50%;
    height: 100%;
  }
}

#left,
#right {
  box-sizing: border-box;
  padding: 0 1rem 2rem 0;
}

#left {
  flex: 1 1 50%;
  max-width: 50%;
  padding-left: 0;
  padding-right: 2rem;
}

#right {
  flex: 1 1 50%;
  min-width: 0;
  position: relative;
  padding-left: 0.75rem;
  padding-right: 3rem;
  margin-right: 1rem;
}

#matching-panels.results-focused-mode #left {
  display: none;
}

#matching-panels.results-focused-mode #right {
  width: 100% !important;
  flex: 1 1 100%;
  margin-right: 0;
  padding-right: 1rem;
}

.settings-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: #f4f6f8;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #444;
}

.settings-summary[hidden] {
  display: none !important;
}

.settings-summary-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer {
  position: static;
  line-height: 1.2;
  padding: 0.35rem 0;
  border-width: 2px 0 0 0;
  font-size: 0.85rem;
}

.footer .container br {
  display: none;
}

@media (max-width: 991.98px) {
  #matching-panels {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  #left,
  #right,
  #input_form {
    display: contents;
  }

  .mobile-layout-block {
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-order-basic {
    order: 1;
    padding: 0 1rem 0 0;
  }

  .mobile-order-run {
    order: 2;
    padding: 0 1rem 0 0;
  }

  .mobile-order-auto {
    order: 3;
    padding: 0 1rem 0 0;
  }

  .auto-create-all-action .btn {
    width: 100%;
  }

  .form-row > .form-group.auto-create-range {
    flex: 0 0 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .mobile-order-detail {
    order: 4;
    padding: 0 1rem 0 0;
  }

  .mobile-order-results {
    order: 5;
    padding: 0 1rem 2rem 0;
  }

  #right_overlay {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 1040;
  }

  #left,
  #right {
    width: 100% !important;
    height: auto !important;
    max-height: none;
    overflow-y: visible;
  }

  .layout-hint-wide {
    display: none;
  }

  .main.mobile-run-bar-visible {
    padding-bottom: 4.5rem;
  }

  .detail-hot-tabs {
    display: flex;
    flex-wrap: wrap;
    margin: 0.25rem 5px 0.75rem;
    border-bottom: 1px solid #dee2e6;
  }

  .detail-hot-tabs .nav-item {
    margin-bottom: -1px;
  }

  .detail-hot-tabs .nav-link {
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
    background: none;
    color: #007bff;
    cursor: pointer;
  }

  .detail-hot-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
  }

  .detail-hot-tabs .nav-link.active {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
  }

  .detail-table-panel .detail-section-heading {
    display: none;
  }

  .detail-table-panel .detail-section-body.collapse:not(.show) {
    display: block !important;
    height: auto !important;
    visibility: visible;
  }

  .detail-table-panel[hidden] {
    display: none !important;
  }

  .detail-table-panel.is-active:not([hidden]) {
    display: block;
  }

  #matching-panels.results-focused-mode #left {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .detail-hot-tabs {
    display: none;
  }

  .detail-table-panel[hidden] {
    display: block !important;
  }
}

@media (min-width: 992px) {
  .layout-hint-narrow {
    display: none;
  }

  .mobile-run-bar {
    display: none !important;
  }
}

.mobile-run-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  padding: 0.75rem 1rem;
  background: #fff;
  border-top: 1px solid #dee2e6;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.mobile-run-bar[hidden] {
  display: none !important;
}

.mobile-run-bar .btn {
  height: 3em;
}

@media (max-width: 1199.98px) {
  #left .form-row > [class*="col-md-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.hot-table_scroll {
  flex: 0 0 calc(100% - 10px);
  width: calc(100% - 10px);
  max-width: calc(100% - 10px);
  max-height: calc((32px * 15) + 40px + 1em + 2px);
  box-sizing: border-box;
  border: 1px solid #d4d9e2;
  border-radius: 4px;
  background: #fff;
  overflow: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  padding: 0.5em;
  margin-left: 5px;
  margin-right: 5px;
  margin-top: 0.5rem;
}

.form-row > .hot-table_scroll {
  padding: 0.5em;
}

#hot-wrapper,
#school-hot-wrapper,
#score-hot-wrapper {
  width: 100%;
}

#hot-wrapper .handsontable td,
#school-hot-wrapper .handsontable td,
#score-hot-wrapper .handsontable td {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

#hot-wrapper .handsontable th,
#school-hot-wrapper .handsontable th,
#score-hot-wrapper .handsontable th {
  white-space: nowrap;
}

/* Parameters */
.parameters .form-row {
  margin-bottom: 10px;
}

.max-preference-length-control {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.max-preference-length-option {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0;
}

.max-preference-length-mode-radio {
  position: static;
  margin-top: 0;
  margin-right: 0.15rem;
}

.max-preference-length-limited-label {
  margin-bottom: 0;
}

.max-preference-length-input {
  width: 4.5rem;
  max-width: 100%;
}

.max-preference-length-input:disabled {
  background-color: #e9ecef;
  cursor: not-allowed;
}

.max-preference-length-suffix {
  color: #495057;
  font-size: 0.95rem;
  white-space: nowrap;
}

.parameters .form-detailed {

}

#parameter_submit {
  margin: 20px 0 0;
}

div.button_wrap {
  margin-bottom: 10px;
}

.run-simulation-section {
  margin-bottom: 1.25rem;
}

.detail-auto-generate-wrap {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.detail-auto-generate-wrap-collapsed {
  padding: 0 0 0.25rem;
}

.detail-auto-generate-wrap .btn {
  height: 3em;
}

.detail-auto-generate-hint {
  margin-bottom: 0.5rem;
}

.run-simulation-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  margin-top: 0.75rem;
}

.run-simulation-buttons .btn {
  height: 3em;
}

.run-simulation-buttons button + button {
  margin-left: 0;
}

@media (max-width: 1199.98px) {
  .run-simulation-buttons {
    flex-direction: column;
    align-items: flex-start;
  }
}

.matching-result-table {
  table-layout: fixed;
}

.matching-result-table th:first-child {
  width: 9rem;
  background: #f2f2f2;
}

.matching-result-table th:not(:first-child),
.matching-result-table td {
  width: 3rem;
  min-width: 3rem;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.result-table-legend {
  margin: 0 5px 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

.result-blocking-pair-note {
  margin: 0 5px 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: #495057;
  background: #f8f9fa;
  border-left: 3px solid #6c757d;
  border-radius: 0 0.25rem 0.25rem 0;
}

.result-legend-item {
  display: inline-block;
  margin-right: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid transparent;
}

table.result_table td.cell-unmatched,
.result-legend-item.cell-unmatched {
  background: #fdecea;
  border-color: #f5c6cb;
  color: #922b21;
  font-weight: 700;
}

table.result_table td.cell-vacancy,
.result-legend-item.cell-vacancy {
  background: #fff3cd;
  border-color: #ffeeba;
  color: #856404;
  font-weight: 700;
}

.apply-size-wrap {
  margin-top: 0.75rem;
}

.apply-size-actions .btn {
  margin-left: 0.35rem;
  margin-bottom: 0.35rem;
}

.apply-size-actions .btn:first-child {
  margin-left: 0;
}

.form-row > .form-group.auto-create-range {
  flex: 0 0 calc(33.333333% - 1rem);
  max-width: calc(33.333333% - 1rem);
  margin-bottom: 1rem;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.auto-create-section-lead {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.auto-create-all-wrap {
  margin-bottom: 0.25rem;
  padding: 0.875rem 1rem;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.25rem;
}

.auto-create-all-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #343a40;
}

.auto-create-all-hint {
  line-height: 1.5;
}

.auto-create-all-action {
  margin-top: 0.75rem;
  text-align: right;
}

.auto-create-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e9ecef;
}

.auto-create-block-heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.auto-create-block-hint {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.auto-create-field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.auto-create-button-wrap {
  margin-top: 1.75rem;
}

.auto-create-row-button-wrap {
  margin-top: 0.75rem;
}

.score-mode-options {
  margin-top: -0.25rem;
  margin-bottom: 0.25rem;
}

.score-mode-hint {
  margin-bottom: 0.5rem;
}

.score-copy-wrap {
  margin-top: 0.5rem;
}

.score-copy-hint {
  margin-top: 0.35rem;
}

#result_matching td .cell_inner {
  max-height: 200px;
  overflow-y: scroll;
}

table.result_table th {
  min-width: 150px;
}

table.result_table {
  min-width: max-content;
  margin-bottom: 0;
}

.result_table_scroll {
  width: calc(100% - 10px);
  max-width: calc(100% - 10px);
  min-height: calc((2.25rem + 1px) * 4);
  max-height: none;
  box-sizing: border-box;
  border: 1px solid #d4d9e2;
  border-radius: 4px;
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  padding: 0.5em;
  margin-left: 5px;
  margin-right: 5px;
  margin-bottom: 30px;
}

table.result_table.matching-result-table {
  width: max-content;
  min-width: 0;
  table-layout: fixed;
  margin-left: 0;
  margin-right: auto;
}

table.result_table.matching-result-table th:first-child {
  width: 9rem;
  min-width: 9rem;
  max-width: 9rem;
  background: #f2f2f2;
}

table.result_table.matching-result-table th:not(:first-child),
table.result_table.matching-result-table td {
  width: 2.5rem;
  min-width: 2.5rem;
  max-width: 2.5rem;
  text-align: center;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

table.result_table.school-stats-table {
  width: max-content;
  min-width: 0;
  table-layout: fixed;
  margin-left: 0;
  margin-right: auto;
}

table.result_table.school-stats-table th:first-child {
  width: 18rem;
  min-width: 18rem;
  max-width: 18rem;
  background: #f2f2f2;
}

table.result_table.school-stats-table th:not(:first-child),
table.result_table.school-stats-table td {
  width: 4rem;
  min-width: 4rem;
  max-width: 4rem;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

table#result_details {
  margin: 0;
}

.result-empty-state {
  margin: 0.5rem 5px 30px;
  padding: 0.75rem 1rem;
  background: #f4f6f8;
  border: 1px solid #d4d9e2;
  border-radius: 6px;
  color: #444;
  line-height: 1.5;
}

#result_empty_state[hidden],
#result_content[hidden] {
  display: none !important;
}

#upload_json_input {
  display: none;
}

/* range input */
.range-wrap {
  position: relative;
  margin: 0 auto 3rem;
}

.range {
  width: 100%;
  cursor: pointer;
  padding: 0;
}

.range:focus {
  outline: 0 !important;
  box-shadow: 0 0 0 0 !important;
}

.bubble {
  background: #007bff;
  color: white;
  padding: 4px 12px;
  position: absolute;
  border-radius: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.bubble::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 2px;
  background: #007bff;
  top: -1px;
  left: 50%;
}

/* Footer */
