/* ===============================================================
   Alfred's site-wide styling for user pages (not dashboards)
   ---------------------------------------------------------------

   This stylesheet is the first in the CSS  cascade for a page.

   Don't add local tweaks to this file, it is likely to break
   styling somewhere.  Use a local style.css in the folder
   with the page, it will be automatically included in the tags
   in alfred_page.php.

   Important to know: Alfred's root color pallette is here as
   CSS variables, --text-color, --anchor-color, etc..
   Use them in your local styling to remain consistent with
   theming (dark/light as of now) and keep things readable/usable.
   =============================================================== */

:root {
  --text-color: #00506b;
  --body-color: rgb(248, 248, 247);
  --option-background-color: initial;
  --option-font-color: initial;
  --anchor-color: initial;
  --input-background: #eee;
  --input-color: #111;
  --input-background-disabled: #ddd;
  --input-color-disabled: initial;
  --button-color: var(--text-color);
  --button-background: rgb(223, 223, 223);
  --button-color-focus: revert;
  --button-background-focus: revert;
  --button-color-hover: revert;
  --button-background-hover: revert;
  --button-color-disabled: #555;
  --button-background-disabled: #ccc;
}

[data-theme="dark"] {
  --body-color: #111;
  --text-color: #ddd;
  --option-background-color: #222;
  --option-font-color: #ddd;
  --anchor-color: #72ae43;
  --input-background: #222;
  --input-color: #ccc;
  --input-background-disabled: #555;
  --input-color-disabled: initial;
  --button-color: #eee;
  --button-background: #333;
  --button-color-focus: #fff;
  --button-background-focus: #000;
  --button-color-hover: #fff;
  --button-background-hover: #000;
  --button-color-disabled: #999;
  --button-background-disabled: #222;
}

body {
  font-family: "Karla", sans-serif;
  font-size: 16px;
  color: var(--text-color);
  background: var(--body-color);
}

main {
  display: flex;
  flex-direction: column;
  margin: 1em 5vw;
}

main .centered-content {
  clear: both;
  margin-left: auto;
  margin-right: auto;
}

/* Text Centering */
.center {
  text-align: center;
}

section {
  margin: 2em 0;
}

a {
  color: var(--anchor-color);
  text-decoration: underline;
}

a:hover {
  cursor: pointer;
  text-decoration: underline;
}

input {
  border-style: solid;
  border-width: 1px;
}

select,
select option,
input[type="date"],
input[type="number"] {
  color: var(--option-font-color);
  background: var(--option-background-color);
  padding: 0.4em;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea {
  background: var(--input-background);
  color: var(--input-color);
  padding: 0.4em;
}

input[type="text"]:disabled,
textarea:disabled {
  background: var(--input-background-disabled);
  color: var(--input-color-disabled);
}

input:invalid {
  border: red solid 2px;
}

label {
  white-space: nowrap;
}

fieldset {
  margin: 0.4em 0;
  padding: 0.6em;
}

legend {
  margin-left: 0.6em;
}

.select-shorten > * {
  /* targets all descendents of the holder of the class */
  max-width: 12rem;
}

input[type="button"],
input[type="submit"],
button {
  padding: 0.6em;
  margin: 0.4em;
  color: var(--button-color);
  background: var(--button-background);
}

input[type="button"]:focus,
input[type="submit"]:focus,
button:focus {
  color: var(--button-color-focus);
  background: var(--button-background-focus);
}

input[type="button"]:hover,
input[type="submit"]:hover,
button:hover {
  background: var(--button-background-hover);
  color: var(--button-color-hover);
}

input[type="button"]:disabled,
input[type="submit"]:disabled,
button:disabled {
  background: var(--button-background-disabled);
  color: var(--button-color-disabled);
}

.float-right {
  float: right;
}

.float-left {
  float: left;
}

.float-middle {
  float: left;
  margin-left: 100px;
}

/* ================
   Header
   ================ */

header {
  position: relative;
  margin-bottom: 0px;
}

.header__logos {
  display: flex;
  justify-content: space-between;
  height: 15vw;
  max-height: 125px;
  min-height: 100px;
  padding: 2em 1em 1em 1em;
}

.header__logos > * {
  height: 100%;
}

.header__user_controls {
  display: flex;
  position: absolute;
  align-items: center;
  line-height: 1em;
  top: 0.2em;
  right: 1em;
  gap: 1em;
  color: var(--text-color);
}

.header__user_controls input {
  margin-right: 1em;
}

@media only screen and (max-width: 700px) {
  .header__logos {
    justify-content: center;
  }

  .header__logo--left {
    display: none;
  }
}

/* ================
   Footer
   ================ */

footer {
  text-align: center;
  color: white;
  background-color: #69a630;
  padding: 0.2em;
}

footer a {
  color: white;
  margin: 0 0 0 3em;
}

/* ================
   loading overlay
   ================ */

#ajax_loading {
  position: fixed;
  top: 0px;
  right: 0px;
  width: 100%;
  height: 100%;
  background-color: #666;
  background-image: url("/img/ajax_loading.gif");
  background-repeat: no-repeat;
  background-position: center;
  z-index: 10000000;
  opacity: 0.6;
}

/* ==============
   Misc elements
   ============== */

hr {
  width: 100%;
  display: inline-block;
  margin: 10px 0;
  border: none;
  height: 1px;
  background-color: var(--text-color);
}

.result-page-navigation {
  text-align: center;
  padding: 0.5em;
}

.form-table-buttons {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.alfred-content-row-div {
  clear: both;
  margin-left: auto;
  margin-right: auto;
  max-width: 1000px;
}

/*
  ALFRED MODAL POP-UP WINDOWS
*/

/* new alfred-page.php modal styling */

.alfred-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background-color: #666666f0;
  white-space: pre;

  display: grid;
  grid-template-areas:
    "tp tp tp"
    "lp mc rp"
    "bp bp bp";
  grid-template-rows: 1fr max-content 1fr;
  grid-template-columns: 1fr max-content 1fr;
}

.alfred-modal-content {
  grid-area: mc;
  background-color: var(--body-color);
  color: var(--text-color);
  padding: 4em;
  border-radius: 7px;
  border-color: #000000;
  border-width: 3px;
  border-style: solid;
}

.alfred-modal-bad .alfred-modal-content {
  grid-area: mc;
  background-color: var(--body-color);
  color: var(--text-color);
  padding: 4em;
  border-radius: 7px;
  border-color: #c12830;
  border-width: 3px;
  border-style: solid;
}

.alfred-modal-good .alfred-modal-content {
  grid-area: mc;
  background-color: var(--body-color);
  color: var(--text-color);
  padding: 4em;
  border-radius: 7px;
  border-color: #73ae43;
  border-width: 3px;
  border-style: solid;
}

.alfred-modal-warning .alfred-modal-content {
  grid-area: mc;
  background-color: var(--body-color);
  color: var(--text-color);
  padding: 4em;
  border-radius: 7px;
  border-color: #ff9531;
  border-width: 3px;
  border-style: solid;
}

/* old alfred modal styling */

.alfred_modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.4);
}

.alfred_modal_content {
  margin: auto;
  padding: 0;
  border: 1px solid #888;
  width: 80%;
  box-shadow:
    0 4px 8px 0 rgba(0, 0, 0, 0.2),
    0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.alfred_modal_header {
  padding: 2px 16px;
  background-color: #2f5f00;
  color: white;
}

.alfred_modal_body {
  background-color: var(--body-color);
  color: var(--text-color);
  padding: 2px 16px;
  min-height: 200px;
}

.alfred_modal_footer {
  padding: 2px 16px;
  background-color: #2f5f00;
  color: white;
}

/* ====================
   alfred pop messages
   ==================== */

.alfred-pop {
  z-index: 3;
  position: fixed;
  --pop-top-closed: -3em;
  top: 0;
  left: 0;
  width: 100%;

  transition-property: top, height;
  transition-duration: 0.5s;
  transition-timing-function: ease;

  display: flex;
  flex-direction: column;
  align-items: center;

  background-color: #666666f0;
}

.alfred-pop-content {
  font-size: 2em;
  margin: 0.2em;
  background-color: var(--body-color);
  color: var(--text-color);
}

/* pop customizations */

.alfred-pop-good {
  background-color: #050;
}

.alfred-pop-bad {
  background-color: #700;
}

.alfred-pop-warning {
  background-color: rgb(150, 150, 0);
}

.alfred-pop.is-closed {
  top: var(--pop-top-closed);
}

.link-sections-container {
  display: flex;
  flex-wrap: wrap;
}

.link-sections-container > section {
  width: 300px;
  margin: 1em;
}

.link-sections-container h3 {
  background: #354e20;
  color: white;
  text-align: center;
  padding: 0.2em;
}

.link-sections-container a {
  display: block;
  margin-bottom: 1.2em;
}

.php-errors {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.4em;
  background-color: darkred;
  color: white;
}

.is-hidden {
  display: none;
}

.table-row-anchor {
  cursor: pointer;
}

/* ALFRED TABLE */

.alfred_table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

.alfred_table td {
  padding: 10px 5px;
}

.alfred_table th {
  background-color: #354e20;
  color: #ffffff;
  padding: 10px 5px;
  position: sticky;
  top: 0; /* necessary for sticky to work */
}

.alfred_table tr:nth-child(even) {
  background: #2f5f001c;
}

.alfred_table tr.alfred_table_clickable:hover,
.alfred_table tr.download-admin-edited-orders:hover {
  background-color: #6aa630;
  color: #ffffff;
  cursor: pointer;
}

#item-type-dimensions-table th:nth-child(2) {
  width: 5px;
}

.item-type-dimension-option[data-added-dimension-business-unit-id] {
  text-decoration: underline;
}
.item-type-dimension-option.selected {
  background: rgb(25, 103, 210);
  color: white;
}

/* alfred-dashboard */

.alfred-dashboard {
  font-size: 24px;
  color: black;
}

.alfred-dashboard h1,
.alfred-dashboard h2,
.alfred-dashboard h3 {
  font-family: "Tomorrow", sans-serif;
  margin: 0;
  margin-bottom: 0.2em;
  text-align: center;
}

.alfred-dashboard .alfred_table {
  font-size: 24px;
}

.alfred-dashboard .alfred_table td {
  border: 1px solid black;
}
.alfred-dashboard .alfred_table th {
  font-family: "Tomorrow", sans-serif;
  font-style: italic;
  font-weight: normal;
  /* temporary fix: make tables have thead and tbody and style the thead */
  border-left: 1px solid black;
  border-right: 1px solid black;
}

/* Dark Mode Toggle Btn */

.header__theme {
  display: flex;
  align-items: center;
}
.header__theme > span {
  margin-left: 0.25em;
}
.theme-switch {
  display: inline-block;
  height: 26px;
  position: relative;
  width: 48px;
}

.theme-switch > input {
  display: none;
}

.theme-slider {
  background-color: #ccc;
  cursor: pointer;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  transition: 0.4s;
}

.theme-slider:before {
  /* the button displayed */
  background-color: #fff;
  bottom: 3px;
  content: "";
  height: 20px;
  left: 2px;
  position: absolute;
  transition: 0.4s;
  width: 20px;
}

input:checked + .theme-slider {
  background-color: #72ae43;
}

input:checked + .theme-slider:before {
  transform: translateX(24px);
}

.theme-slider.round {
  border-radius: 100vmax;
}

.theme-slider.round:before {
  border-radius: 50%;
}

/* Search Field Grid Control */

label {
  /* Provides spacing */
  margin: 0 0.25em;
}

/* For Controlling the User Search Page Grid*/

.form-grid {
  display: grid;
  grid-template-columns: repeat(6, max-content);
  grid-template-rows: auto;
  gap: 0.5em;
  align-items: center;
}

.col-1 {
  grid-column: 1 / 2;
}

.col-2 {
  grid-column: 2 / 3;
}

.col-3 {
  grid-column: 3 / 4;
}

.col-4 {
  grid-column: 4 / 5;
}

.col-5 {
  grid-column: 5 / 6;
}

.col-6 {
  grid-column: 6 / 7;
}

.row-1 {
  grid-row: 1 / 2;
}

.row-2 {
  grid-row: 2 / 3;
}

.row-3 {
  grid-row: 3 / 4;
}

.row-4 {
  grid-row: 4 / 5;
}

.row-5 {
  grid-row: 5 / 6;
}

.row-6 {
  grid-row: 6 / 7;
}

.row-7 {
  grid-row: 7 / 8;
}

.Fadein {
  opacity: 1;
  transition: 600ms;
}

.Fadeout {
  opacity: 0;
  height: 0;
  z-index: -1;
  pointer-events: none;
  transition: 80ms;
}

.show-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

/* For Icon coloring */
.red-icon {
  color: #ff0000;
}

.green-icon {
  color: #008000;
}

.site_wide_notice {
  background-color: #ff2400;
  border-width: 0.2em;
  border-color: black;
  border-style: solid;
  border-radius: 0.2em;
  padding: 0.2em;
  font-family: "Arial Bold", sans-serif;
  font-size: 1.5em;
  color: black;
  text-align: center;
}

.icon.existing_file_icon:hover,
.icon.existing_file_trash_icon:hover {
  cursor: pointer;
}

.number-input {
  max-width: 3rem;
}
