/* -*- css-indent-offset: 2 -*- */

/*
 * GENERAL LOOKS - used in all parts of SUPR
 */


/* Declare colours at the top */
:root {
  --supr-bg-highlight: #ffffe0;
  --supr-bg-highlight-darker: #f8f8d8;
  --supr-bg-links-header: #f0f0f0;
  --supr-bg-instancewarning: #f0d0d0;
  --supr-border-show: #e9ecef;
  --supr-border-listing: #a0a0a0;
}

/* Warning colour if turned on? */
body.instancewarning {
  background: var(--supr-bg-instancewarning);
}

/*
 * Text is hard to read if the column is too wide.
 * At the same time, we do not want to prohibit wide tables.
 * Instead of using <br> to introduce arbitrary line breaks,
 * place text in a div with a fixed max width.
 */

.narrow_text,
div.supr-nag-card,
div.supr-ua-card,
div.supr-doc-instructions-card {
    max-width: 50em;
}

/* Turn off spinners on number fields
 *   http://stackoverflow.com/questions/3790935/can-i-hide-the-html5-number-input-s-spin-box
 */

input[type='number'] {
    -moz-appearance:textfield;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/*
 * BOOTSTRAP-BASED TOP-LEVEL DESIGN
 */

/* LEFT COLUMN
 * Logos and menu
 */

div#supr-left-column {
    width: 16.5em;
    min-width: 16.5em;
    padding-left: 1em;
    padding-right: 1em;
    padding-bottom: 1em;
}

body.user div#supr-left-column {
}

body.admin div#supr-left-column {
    background: var(--supr-bg-highlight);
}

/*
 *  Logotypes in their "normal" left-menu context
 */

div#naiss-logotype {
    font-size: 42px;
}

div#naiss-logotype a {
    color: black;
}

div#supr-logotype {
    margin-left: 20px;
    margin-bottom: 12px;
}

div#supr-logotype img {
    width: 184px;
}

/* Admin User Switch */

.supr-admin-user-switch {
  width: 100%;
  margin-bottom: 12px;
}

.supr-admin-user-switch a,
.supr-admin-user-switch button {
  padding-top: 2px;
  padding-bottom: 1px;
  width: 50%;
}

/* Quick Search box */

#id_quick_search {
  width: 100%;
  margin-bottom: 6px;
}

/* RIGHT COLUMN
 * Title and contents
 */

div#supr-right-column { }

/*
 * Logotypes on top on small devices
 */

div#supr-small-top {
    margin-left: -15px;
    margin-right: -15px;
    padding-top: 9px;
    padding-bottom: 9px;
}

body.admin div#supr-small-top {
    background: var(--supr-bg-highlight);
}

span#supr-logotype-small {
    margin-top: 9px;
}

span#supr-logotype-small img {
    margin-top: 5px;
    width: 120px;
    margin-right: 6px;
}

button#show_menu_button {
    margin-top: 0px;
    margin-left: 15px;
    margin-right: 12px;
}

/*
 * Breadcrumbs
 */

.supr-breadcrumbs ol.breadcrumb {
    background: #ffffff;
    margin-top: 0.2em;
    padding-top: 0.2em;
    padding-bottom: 0.2em;
    padding-left: 0em;
}

.supr-breadcrumbs li.active {
    font-weight: bold;
    color: var(--bs-body-color);
}

/*
 * Title
 */

div#contenttitle {
  font-size: 200%;
  font-weight: bold;
  padding-bottom: 1pt;
  border-bottom: var(--bs-body-color) solid thin;
  margin-bottom: 24pt;
}

/*
 * Area for links to continued projects etc.
 */

div.supr-links-header {
  background: var(--supr-bg-links-header);
  margin: -2rem 0 0 0;
  padding: 5px 0 5px 5px;
}

div.supr-links-header > * {
  padding: 0;
}

/*
 * Left side menu
 */

div.supr-menu-subtitle {
  padding-top: 0pt;
  font-weight: bold;
}

div.supr-menu-alternative {
  padding-left: 1em;
  padding-right: 1em;
}

div.supr-menu-footer {
  padding-top: 6pt;
  font-size: 8pt;
}

/* HEADINGS */

h2 { margin-top: 1.5rem; }

/*
 * Zebra striping for tables is provided by Bootstrap class table-striped.
 *
 * We override the background for some specific cases below.
 */

/* Yellow highlighting for active projects, enabled accounts etc. (Only listingtable) */

table.table-striped tr.activerow  { background: var(--supr-bg-highlight) !important; }

/* Emulate Bootstrap striping and our own for tables striped using tablesorter zebra instead */

table.tablesorter tr.ts-odd > * { --bs-table-accent-bg: var(--bs-table-striped-bg);  }
table.tablesorter tr.activerow  { background: var(--supr-bg-highlight) !important; }

/* Mimic this for general background use */

.bg-active  { background: var(--supr-bg-highlight) !important; }


/* Slightly darker for selected rows in the admin Review Sheet */

tr:nth-child(even).selectedrow { background: var(--supr-bg-highlight-darker) !important; }
tr:nth-child(odd).selectedrow { background: var(--supr-bg-highlight-darker) !important; }

/*
 * SHOWING OBJECTS - showing data for a single object with labels to the
 * left. Used in both admin and portal parts.
 * Still used with Bootstrap using the supr_show_* tags.
 */

div.supr-show div.row {
  border-top: 1px solid var(--supr-border-show);
  margin-left: 0px;
  width: auto;
}
div.showlabel {
  font-weight: bold;
  max-width: 16em;
  padding-top: 2pt;
  padding-left: 0;
 }
div.showvalue {
  padding-top: 2pt;
  margin-bottom: 2pt;
  padding-left: 0;
}
div.showvalue p { margin-top: 0px; margin-bottom: 0px; }

/*
 * LISTINGTABLE - listing multiple objects with field labels on the top.
 * Used in both admin and portal parts. Invoked via table class "listingtable"
 * and the tr class "fieldname" on the row containing the field labels.
 */

table.table-suprlisting { width: auto; }
tr.fieldname { font-weight: bold;}
tr.fieldname td { border-bottom: var(--supr-border-listing) solid thin; }
tr.total td { border-top: var(--supr-border-listing) solid thin; padding-top: 4pt;}

/* Overrides */

table.review_usage_list .showlabel { width: 8em; }

/*
 * EDITING OBJECTS - editing data for a single object with labels to
 * the left. In the portal, we mainly do this using the edit_fields_*
 * tags and in the admin mainly using the admin_editform.html
 * template.
 */

div.supr-edit .editlabel {
    font-weight: bold;
    max-width: 20em;
}

div.supr-edit .editvalue {
    max-width: 40em;
}

div.supr-edit .editvalue.editvalue-wider {
    max-width: 60em;
}

div.supr-edit .editheading {
    font-weight: bold;
    font-size: 120%;
}

div.supr-edit .edithelp {
    max-width: 62em;
}

div.supr-edit div.supr-form-check-full-width input.form-check-input {
    margin-top: 0.1rem;
}

div.supr-edit div.supr-form-check-full-width {
    margin-bottom: 6pt;
}

span.reqfield {
  color: #d00000;
  font-size: 80%;
}

/* We only generate content with "invalid-feedback" when there are
   errors, so always showing it make things less complicated. */

div.supr-edit div.invalid-feedback {
  display: block;
  font-size: 90%;
}

/* ajax_select tweaks */

div.results_on_deck {
  padding-bottom: 0;
}

div.results_on_deck div {
  margin-bottom: 0;
}

.ui-menu .ui-menu-item {
  font-size: 90%;
}

/* Make our buttons inside tables a bit less tall */

.supr-table-button {
  padding-top: .15rem;
  padding-bottom: .15rem;
}

/* Legacy handling for mergetable (was based on edittable before */

td.supr-merge-label {
  font-weight: bold;
  width: 20em;
}

/* Similar for table used by federated UA approval */

td.supr-federated-ua-label {
  font-weight: bold;
  width: 14em;
}

/*
 * OBJECT HELP TEXT - in admin_*_help.html
 */

div.objecthelp {
  max-width: 60em;
}

div.objecthelp h2 {
  font-size: 144%;
}

/*
 * ROUND DRILLDOWN
 */

div.round-drilldown div.card {
  min-width: 18rem;
  max-width: 18rem;
}

/*
 * NAG CARDS
 */

div.supr-nag-card {
  background: var(--supr-bg-highlight);
}

/*
 * ICON TWEAKS
 */

i.bi-box-arrow-up-right {
  position: relative;
  top: -0.09em;
}

/*
 * TWEAKS FOR PRINTING
 */


@media print {
  /* Based on https://github.com/twbs/bootstrap/issues/23489 */
  #supr-page-row { display: block; }

  /* From https://daneveland.com/content/printing-bootstrap */
  [class*="col-sm-"] {
    float: left;
  }
  [class*="col-xs-"] {
    float: left;
  }
  .col-sm-12, .col-xs-12 {
    width:100% !important;
  }

  .col-sm-11, .col-xs-11 {
    width:91.66666667% !important;
  }

  .col-sm-10, .col-xs-10 {
    width:83.33333333% !important;
  }

  .col-sm-9, .col-xs-9 {
    width:75% !important;
  }

  .col-sm-8, .col-xs-8 {
    width:66.66666667% !important;
  }

  .col-sm-7, .col-xs-7 {
    width:58.33333333% !important;
  }

  .col-sm-6, .col-xs-6 {
    width:50% !important;
  }

  .col-sm-5, .col-xs-5 {
    width:41.66666667% !important;
  }

  .col-sm-4, .col-xs-4 {
    width:33.33333333% !important;
  }

  .col-sm-3, .col-xs-3 {
    width:25% !important;
  }

  .col-sm-2, .col-xs-2 {
    width:16.66666667% !important;
  }

  .col-sm-1, .col-xs-1 {
    width:8.33333333% !important;
  }

  .col-sm-1,
  .col-sm-2,
  .col-sm-3,
  .col-sm-4,
  .col-sm-5,
  .col-sm-6,
  .col-sm-7,
  .col-sm-8,
  .col-sm-9,
  .col-sm-10,
  .col-sm-11,
  .col-sm-12,
  .col-xs-1,
  .col-xs-2,
  .col-xs-3,
  .col-xs-4,
  .col-xs-5,
  .col-xs-6,
  .col-xs-7,
  .col-xs-8,
  .col-xs-9,
  .col-xs-10,
  .col-xs-11,
  .col-xs-12 {
    float: left !important;
  }
  body {
    margin: 0;
    padding-left: 3rem !important;
    padding-right: 3rem !important;
    min-width: 768px;
    font-size: 10px;
  }
  .container {
    width: auto;
    min-width: 750px;
  }
}
