/*
  Custom classes that are used on all/most pages
*/

/* Font Awesome icon class names are all prefixed with "icon-" */
[class*=icon] {
  font-size: 120%;
}

.iconError {
  color: rgb(202, 60, 60);
}

/* A generic missing/unset information indicator for data that isn't
   always required to be present, but what really should be set */
.missingData {
  color: $missingDataFore;
}

/* Buttons, links and areas that are only visible to organisation owners */
.ownersOnly {
  border: 1px dashed $ownersOnlyBorder;
}

.ownersOnlyTop {
  border: 1px dashed $ownersOnlyBorder !important;
}

.adminOrOwner {
  color: $adminOwner;
}

/* Wraps everything on the page below the topmenu */
#pageWrapper {
  margin: 0;
  padding: 0;
}

/* Actual page contents. Margin cannot be set to pageWrapper, as it
   can leave a visible crack between the topbar and the page contents. */
#pageContainer {
  margin-top: 40px;

  @media #{$screen-breakpoint-one} {
    margin: 0;
  }
}

/* School name, integrations */
#schoolHeader {
  padding: 10px;
  background: $schoolHeaderBack;

  @media #{$screen-breakpoint-one} {
    margin: 0;
  }

  #schoolName {
    color: $schoolNameFore;
    font-size: 250%;
    font-weight: bold;
    font-variant: small-caps;
    padding: 0;
    margin: 0;
    overflow-wrap: break-word;  /* force splitting of long organisation names */

    @media #{$screen-breakpoint-one} {
      font-size: 200%;
    }
  }
}

/* Page contents below the in-page tab bar */
#content {
  background: $pageContentBack;
  color: $pageContentFore;
  margin: 0;
  padding: 20px;
  position: relative;
  width: 100%;
  font-size: 80%;
  flex: 1;

  @media #{$screen-breakpoint-one} {
    padding: 10px 5px;
    border: none;
  }

  /* Used on the school page to push content down, below the tools */
  .dashboard {
    float: left;
    margin: 0;
    width: 100%;
  }

  h1 {
    margin: 0 0 10px 0;
    padding: 0;
    line-height: 1;
  }
}

/*
  ".searchResultsBox" DIVs are created outside of the <body> element by JavaScript.
  Those DIVs contain A and .btn elements too.
*/
#content, .searchResultsBox {
  /* A generic link */
  a {
    color: $linkFore;
    background: $linkBack;
    font-weight: bold;
  }

  a:hover {
    color: $linkHoverFore;
    background: $linkHoverBack;
    text-decoration: none;
  }

  a:focus {
    color: $linkFocusFore;
    background: $linkFocusBack;
  }

  /* Hyperlinks styled as buttons */
  .btn {
    display: inline-block;
    padding: 4px 12px;
    margin: 2px;
    border-width: 2px;
    border-style: solid;
    border-color: $buttonBorderHi $buttonBorderLo $buttonBorderLo $buttonBorderHi;
    background: $buttonBack;
    color: $buttonFore;
    text-decoration: none;
    font-weight: normal;
    cursor: pointer;
  }

  .btn:hover, .btn:focus {
    background: $buttonHoverBack;
    color: $buttonFore;
  }

  .btn:active {
    border-color: $buttonBorderLo $buttonBorderHi $buttonBorderHi $buttonBorderLo;
    background: $buttonHoverBack;
    color: $buttonFore;
  }

  .btn-danger {
    border-color: $buttonDangerBorderHi $buttonDangerBorderLo $buttonDangerBorderLo $buttonDangerBorderHi;
    background: $buttonDangerBack;
    color: $buttonDangerFore;
  }

  .btn-danger:hover, .btn-danger:focus {
    background: $buttonDangerHoverBack;
    color: $buttonDangerFore;
  }

  .btn-danger:active {
    border-color: $buttonDangerBorderLo $buttonDangerBorderHi $buttonDangerBorderHi $buttonDangerBorderLo;
    background: $buttonDangerHoverBack;
    color: $buttonDangerFore;
  }

  /* Disabled buttons */
  .btn:disabled, .btn:disabled:hover, .btn:active:disabled, .btn:focus:disabled {
    border-color: $buttonBorderHi $buttonBorderLo $buttonBorderLo $buttonBorderHi;
    color: $buttonForeDisabled;
    background: $buttonBack;
    cursor: not-allowed;
  }

  .btn-danger:disabled, .btn-danger:disabled:hover, .btn-danger:active:disabled, .btn-danger:focus:disabled {
    border-color: $buttonDangerBorderHi $buttonDangerBorderLo $buttonDangerBorderLo $buttonDangerBorderHi;
    background: $buttonDangerBack;
    color: $buttonDangerForeDisabled;
    cursor: not-allowed;
  }
}

/* Server and git commit infos */
footer {
  display: block;
  color: $footerFore;
  border-top: 1px solid $footerBorder;
  text-align: right;
  font-size: 70%;
  margin: 0;
  padding: 1em;

  @media #{$screen-breakpoint-one} {
    font-size: 60%;
  }
}

.unstyledUL {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.margin-0 { margin: 0; }
.padding-0 { margin: 0; }

/*
A general-purpose spinner SVG animation. Apply this class to "img" element and set the source
to /images/spinner.svg. Taken from https://github.com/n3r4zzurr0/svg-spinners; I changed the
class names.
*/
.spinner {
  transform-origin: center;
  animation: spinner_animation .75s step-end infinite;
  width: 24px;
  height: 24px;
}

@keyframes spinner_animation {
  8.3% { transform: rotate(30deg); }
  16.6% { transform: rotate(60deg); }
  25% { transform: rotate(90deg); }
  33.3% { transform: rotate(120deg);}
  41.6% { transform: rotate(150deg); }
  50% { transform: rotate(180deg); }
  58.3% { transform: rotate(210deg); }
  66.6% { transform: rotate(240deg); }
  75% { transform: rotate(270deg); }
  83.3% { transform: rotate(300deg); }
  91.6% { transform: rotate(330deg); }
  100% { transform: rotate(360deg); }
}

#popupBackdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: block;
}

div.popup {
  border: 2px solid var(--popup-border);
  background: var(--popup-background);
  padding: 5px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.75);
  font-size: 80%;
}
