/*
 ===================== Variables =====================
*/
:root {
  --admin-bg: hsl(213.9, 100%, 95%);
  --admin-bg-highlight: hsl(213.9, 100%, 85%);
  --admin-color: #000;
  --admin-table-border: #01579b;
  --admin-table-header-bg: #3D77C7;
  --admin-table-header-fg: #fff;
}

.nightmode {
  --admin-bg: hsl(213.9, 100%, 20%);
  --admin-bg-highlight: hsl(213.9, 100%, 35%);
  --admin-color: #fff;
  --admin-table-border: #01579b;
  --admin-table-header-bg: #3D77C7;
  --admin-table-header-fg: #fff;
}

/*
 ===================== main =====================
*/

[hidden] { display: none !important; }

.admin {
  background: var(--admin-bg);
  color: var(--admin-color);
  min-height: calc(100vh - 390px);
}

.admin .loading-spinner {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: #0002;
  z-index: 4;
}

.admin .container .actions {
  margin-left: -2rem;
}

.admin .container .actions button,
.admin .container .actions input {
  margin-left: 1rem;
  font-weight: normal;
  min-width: 150px;
}

.admin table {
  border: solid 1px var(--admin-table-border);
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.75em;
  margin-bottom: 1rem;
  width: 100%;
}

input[type=checkbox] {
  display: block;
  height: 20px;
  margin: 0.5rem 0;
  width: 20px;
}

.admin table thead th,
.admin table tbody td {
  text-align: left;
  padding: 0.5rem;
}

.admin table tbody td.nopadding {
  padding: 0;
  text-align: center;
  width: 75px;
}

.admin table tbody td.nopadding img {
  margin: 0;
  max-width: 75px;
  max-height: 75px;
}

.admin table thead th {
  background-color: var(--admin-table-header-bg);
  border: solid 1px var(--admin-table-border);
  color: var(--admin-table-header-fg);
}
.admin table tbody td {
  border: solid 1px var(--admin-table-border);
  color: var(--alt-color);
}

.admin table tr:hover td,
.admin table tr.rowfeatured td {
  background: var(--admin-bg-highlight);
}

.admin table button {
  color: var(--link);
  background: transparent;
  border-color: transparent;
  padding: 0;
  margin: 0;
}

.admin table td.right,
.admin table th.right {
  text-align: right;
}

.admin form {
  margin: 1rem 0 0;
}

.admin form input[type=text],
.admin form select {
  width: 100%;
}

.admin .input-row {
  display: flex;
  margin-right: -1rem;
}

.admin .input-row > * {
  margin-right: 1rem;
  flex: 2 1 50px;
}

.admin .input-row > .slim {
  flex: 0 0 auto;
}

.admin .error {
  position: fixed;
  top: 0;
  left: 50%;
  margin-left: -30%;
  width: 60%;
  z-index: 10;
}

/* ************** fileinfo ************** */

.admin fileinfo:hover {
  background: var(--admin-bg-highlight);
}

.admin fileinfo .remove {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(to right, transparent, var(--admin-bg) 2rem);
  padding-left: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin fileinfo:hover .remove {
  background: linear-gradient(to right, transparent, var(--admin-bg-highlight) 2rem);
}

.admin fileinfo .remove button {
  margin: 0;
}

/* ************** fileupload ************** */

fileupload {
  width: 100%;
}

fileupload,
.fileupload {
  position: relative;
  display: block;
}

fileupload.banner {
  margin: 0 0 -1px;
}

fileupload.empty {
  border: 3px solid var(--seperator);
  border-style: dashed;
}

fileupload.empty.useimg {
  max-width: 700px;
  margin: 0 auto;
}

fileupload a {
  display: block;
  width: 100%;
  background-position: center;
  background-size: cover;
}

fileupload .text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: center;
  flex-direction: column;
  color: var(--seperator);
}

fileupload .remove {
  width: 50px;
  height: 50px;
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  z-index: 3;
}

fileupload input,
.fileupload input {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.01;
  width: 100%;
  cursor: pointer;
  text-indent: -9999px;
  z-index: 2;
}

/* ************** dialogue ************** */

.floating-container {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: #00000099;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 4;
}

dialogue {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  text-align: center;
  width: calc(100% - 40px);
  max-width: 500px;
  color: var(--color);
}

dialogue p {
  padding: 1rem;
}

dialogue .buttons {
  display: flex;
  justify-content: space-around;
  padding: 1rem
}

dialogue button {
  border: 1px solid var(--link);
  background: transparent;
  color: var(--link);
  padding: 0.5rem 1rem;
  min-width: 150px;
}

dialogue button.alert {
  border: none;
  background: var(--error-bg);
  color: var(--error-fg);
}

dialogue button.cancel {
  border-color: var(--seperator);
  color: var(--seperator);
}

/*
 ===================== Blocks =====================
*/

.admin .cdx-quote__text {
  min-height: 80px !important;
}



@keyframes spinner-loader {
  to {transform: rotate(360deg);}
}

.loading-spinner:after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border-radius: 50%;
  border: 2px solid #ccc;
  border-top-color: #333;
  animation: spinner-loader .6s linear infinite;
  z-index: 1000;
}

/*
 ===================== 3rd party =====================
*/

/* ************** Editor ************** */

.ce-block__content,
.ce-toolbar__content { max-width:calc(100% - 120px) !important; }
.cdx-block { max-width: 100% !important; }

.codex-editor {
  border: 1px solid var(--color);
  background: var(--bg);
  color: var(--color);
  padding-top: 0.5rem;
}

.codex-editor:hover,
.codex-editor:active {
  border-color: var(--link);
}

/* ************** dte ************** */

.date-selector-wrapper {
  width: 200px;
  padding: 3px;
  background-color: #fff;
  box-shadow: 1px 1px 10px 1px #5c5c5c;
  position: absolute;
  font-size: 12px;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  z-index: 10;
  /* user-select: none; */
}
.cal-header, .cal-row {
  display: flex;
  width: 100%;
  height: 30px;
  line-height: 30px;
  text-align: center;
}
.cal-cell, .cal-nav {
  cursor: pointer;
}
.cal-day-names {
  height: 25px;
  line-height: 25px;
}
.cal-day-names .cal-cell {
  cursor: default;
  font-weight: bold;
}
.cal-cell-prev, .cal-cell-next {
  color: #777;
}
.cal-months .cal-row, .cal-years .cal-row {
  height: 60px;
  line-height: 60px;
}
.cal-nav-prev, .cal-nav-next {
  flex: 0.15;
}
.cal-nav-current {
  flex: 0.75;
  font-weight: bold;
}
.cal-months .cal-cell, .cal-years .cal-cell {
  flex: 0.25;
}
.cal-days .cal-cell {
  flex: 0.143;
}
.cal-value {
  color: #fff;
  background-color: #286090;
}
.cal-cell:hover, .cal-nav:hover {
  background-color: #eee;
}
.cal-value:hover {
  background-color: #204d74;
}

/* time footer */
.cal-time {
  display: flex;
  justify-content: flex-start;
  height: 27px;
  line-height: 27px;
}
.cal-time-label, .cal-time-value {
  flex: 0.12;
  text-align: center;
}
.cal-time-slider {
  flex: 0.77;
  background-image: linear-gradient(to right, #d1d8dd, #d1d8dd);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: left 50%;
  height: 100%;
}
.cal-time-slider input {
  width: 100%;
  -webkit-appearance: none;
  background: 0 0;
  cursor: pointer;
  height: 100%;
  outline: 0;
  user-select: auto;
}

.ce-block__content,
.ce-toolbar__content { max-width:calc(100% - 120px) !important; }
.cdx-block { max-width: 100% !important; }

