body.light-mode {
  --bg: #fff;
  --bg-rgb: 255, 255, 255;
  --text: #000;
  --text-rgb: 0, 0, 0;
  --card-text: #3f54ff;
  --input-bg: #e7f0ff;
  --input-bg-hover: #eee;
  --input-border-br: #bcd4e2;
  --input-border-tl: #bde6ff;
  --input-focus: #0010ff;
  --shadow: #e3e5f6;
  --hilight-bg: #f9f9f9;
  --text-light: #555;
}

body.dark-mode {
  --bg: #101010;
  --bg-rgb: 0, 0, 0;
  --text: #fff;
  --text-rgb: 255, 255, 255;
  --card-text: #7b92a7;
  --input-bg: #132749;
  --input-bg-hover: #081324;
  --input-border-br: #1d3e51;
  --input-border-tl: #253741;
  --input-focus: #545eff;
  --shadow: #1e152e;
  --hilight-bg: #232323;
  --text-light: #b6b6b6;
}

html {
  margin: 0;
  height: 100%;
}

body {
  --animation-duration: 150ms;
  margin: 0;
  font-family: sans-serif;
  font-size: 14px;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  height: 100%;
}

body.dark-mode a {
  color: #7b92a7;
}

body.dark-mode a:visited {
  color: #3563d1;
}

header {
  border-style: solid;
  border-width: 0px 0px 1px 0px;
  border-color: var(--input-bg);
  margin: 0px 0px 25px 0px;
  padding: 8px;
  box-shadow: 0px 2px 5px 0px var(--shadow);
}

main {
  padding: 20px 40px 20px 40px;
  flex: 1;
}

footer {
  text-align: center;
  padding: 0.2rem;
}

a {
  text-decoration: none;
  color: var(--card-text);
}

a:visited {
  color: var(--card-text);
}

ul {
  padding: 0;
  margin: 0;
}

li {
  list-style-type: none;
  padding: 5px;
}

ul.ul_stripe li:nth-of-type(2n + 1) {
  background-color: var(--input-bg-hover);
}

#logo img {
  vertical-align: middle;
  width: 35px;
  margin-right: 5px;
}

#logo {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  height: 100%;
  font-size: 17px;
}

#menu_username {
  top: 10px;
  right: 45px;
  position: absolute;
  text-align: right;
  font-size: 13px;
}

#user_menu {
  top: 8px;
  right: 8px;
  width: 170px;
}

#user_menu_button {
  background-image: url("/static/se/icon-user.svg");
}

#conf_menu {
  top: 48px;
  right: 8px;
  width: 170px;
}

#conf_menu_button {
  background-image: url("/static/se/icon-cog.svg");
}

#clear_button {
  background-image: url("/static/se/icon-clear.svg");
}

#search_button {
  background-image: url("/static/se/icon-search.svg");
}

#id_q {
  padding: 11px;
  min-width: 30%;
  height: 16px;
}

#id_q:hover+#clear_button {
  background-color: var(--input-bg-hover);
}

#id_q:focus+#clear_button {
  outline: 0px;
  border-color: #0010ff;
}

.menu {
  position: absolute;
  text-align: right;
}

.panel {
  padding: 4px 4px 4px 4px;
  border-color: #cfcbcb;
  border-style: solid;
  border-width: 1px;
  background-color: var(--bg);
  position: relative;
  z-index: 999;
  display: none;
}

.menu_links {
  text-align: center;
  padding: 5px;
}

.links {
  display: block;
  font-size: 16px;
  text-decoration: none;
  color: var(--text);
}

.links:visited {
  color: var(--text);
}

.links:hover {
  background-color: var(--input-bg);
  color: var(--text);
}

.img_button {
  background-size: 15px 15px;
  background-repeat: no-repeat;
  background-position: center;
  width: 35px;
  height: 35px;
  margin-bottom: 7px;
}

button,
input,
select,
textarea,
.modal {
  font-size: 14px;
  background-color: var(--input-bg);
  color: var(--text);
  border-right: 1px solid var(--input-border-br);
  border-bottom: 1px solid var(--input-border-br);
  border-top: 1px solid var(--input-border-tl);
  border-left: 1px solid var(--input-border-tl);
  padding: 5px;
}

select {
  margin-bottom: 5px;
}

button:focus,
input:focus,
select:focus {
  outline: 0px;
  border-style: solid;
  border-bottom-width: 1px;
  border-color: #0010ff;
}

button:hover,
input:hover,
select:hover {
  background-color: var(--input-bg-hover);
  cursor: pointer;
}

.a_button {
  color: var(--text);
  text-decoration: none;
  background-color: var(--input-bg);
  padding: 10px;
  margin: 2px 0px 2px 0px;
  border-right: 1px solid var(--input-border-br);
  border-bottom: 1px solid var(--input-border-br);
  border-top: 1px solid var(--input-border-tl);
  border-left: 1px solid var(--input-border-tl);
}

.a_button:hover {
  background-color: var(--input-bg-hover);
}

.a_button_disabled {
  background-color: var(--input-bg-hover);
  color: #737373;
}

.pagination {
  padding: 20px 0px 20px 0px;
  text-align: center;
}

/* _url column in the Document list view of the admin page */
.field-_url>a {
  display: inline-block;
  width: 500px;
  overflow: hidden;
  text-overflow: "…";
  white-space: nowrap;
}

.archive_links {
  display: block;
}

.archive_links * {
  display: inline;
}

.archive_links a {
  margin-left: 3px;
}

.archive-preview {
  float: right;
  max-width: 20%;
  max-height: 100px;
  box-shadow: 0px 5px 10px 0px var(--shadow);
  border-radius: 3px;
}

.home-preview {
  max-width: 160px;
  max-height: 100px;
  box-shadow: 0px 5px 10px 0px var(--shadow);
  border-radius: 3px;
}

.tab_link {
  margin: 0px 2px 25px 3px;
  padding: 8px;
  color: black;
  border-style: solid;
  border-color: var(--input-border-br);
  text-decoration: none;

  border-width: 0px 0px 1px 0px;
  box-shadow: 0px 0px 3px 3px var(--shadow);
}

.tab_link:hover {
  box-shadow: 0px 0px 5px 5px var(--shadow);
}

#tab_selected {
  border-width: 1px;
  box-shadow: none;
}

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

.loader {
  animation: rotate 1s linear infinite;
}

.card {
  display: inline-block;
  width: 24%;
  height: 80px;
  vertical-align: top;
  padding-top: 10px;
  color: var(--card-text);
  font-size: x-large;
  font-weight: 600;
  background-color: var(--input-bg);
  border-right: 1px solid var(--input-border-br);
  border-bottom: 1px solid var(--input-border-br);
  border-top: 1px solid var(--input-border-tl);
  border-left: 1px solid var(--input-border-tl);
}

.card>* {
  text-align: center;
  height: 100%;
  width: 100%
}

.card:hover {
  background-color: var(--input-bg-hover);
  cursor: pointer;
}

.card a {
  color: var(--card-text);
  text-decoration: none;
}

.card a:visited {
  color: var(--card-text);
}

/* Django admin apps tables */
div.app-se:first-child {
  border: 1px solid var(--input-border-br);
  padding: 0px 10px 10px 10px;
  margin-right: 10px;
}

div.app-se>table th,
div.app-auth>table th {
  width: 60%;
}

div.app-se>table td,
div.app-auth>table td {
  width: 40%;
}

.label_tag {
  padding-left: 15px;
}

.label_tag_inline {
  padding-left: 5px;
}

.column-crawl_policy_desc {
  min-width: 40%;
}

.tag {
  display: inline-block;
  font-size 12px;
  min-height: 19px;
  padding: 1px 8px 0px 8px;
  border-radius: 12px 12px 12px 12px;
  margin-bottom: 4px;
}

.tag a {
  text-decoration: none;
}

.tag-action {
  display: inline-block;
  cursor: pointer;
  border: 1px solid #666;
  color: var(--text);
}

.tag-action a {
  color: var(--text);
}

.tag-action:hover {
  background-color: var(--input-bg-hover);
}

.tag-counter {
  display: inline-block;
  font-size: 12px;
  padding: 0px 8px;
  border-radius: 12px 12px 12px 12px;
  margin: 4px;
  color: var(--bg);
  background-color: var(--text);
  opacity: 0.5;
}

#tags_list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: minmax(30px, auto);
}

#tags_list>div {
  width: 200px;
}

#editing_tags {
  min-height: 25px;
  padding-top: 10px;
}

.modal {
  display: none;
  position: fixed;
  padding: 10px 10px 20px 10px;
  bottom: 10%;
  top: 10%;
  left: 10%;
  right: 10%;
  background-color: var(--bg);
  z-index: 1000;
  box-shadow: 5px 5px 5px rgba(var(--text-rgb), 0.2);
  overflow-y: hidden;
  transform: translateY(10px);
}

@keyframes modalFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
    box-shadow: 0px rgba(var(--text-rgb), 0.2);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 5px 5px 5px rgba(var(--text-rgb), 0.2);
  }
}

@keyframes modalFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 5px 5px 5px rgba(var(--text-rgb), 0.2);
  }

  100% {
    opacity: 0;
    transform: translateY(10px);
    box-shadow: 0px rgba(var(--text-rgb), 0.2);
  }
}

.modal.fadeIn {
  display: block;
  animation: modalFadeIn var(--animation-duration) ease-out forwards;
}

.modal.fadeOut {
  animation: modalFadeOut var(--animation-duration) ease-out forwards;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(var(--bg-rgb), 0.6);
  z-index: 999;
}

@keyframes modalOverlayFadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 0.6;
  }
}

@keyframes modalOverlayFadeOut {
  0% {
    opacity: 0.6;
  }

  100% {
    opacity: 0;
  }
}

.modal-overlay.fadeIn {
  display: block;
  animation: modalOverlayFadeIn var(--animation-duration) ease-out forwards;
}

.modal-overlay.fadeOut {
  animation: modalOverlayFadeOut var(--animation-duration) ease-out forwards;
}

.modal-content {
  padding: 10px;
  overflow-y: auto;
  max-height: 90%;
  height: 100%;
}
