/*
Generic admin styling overrides.

DO NOT PUT ANY TARGET APP-SPECIFIC RULES HERE.
 */
/* Colors */
/* Dimensions */
/* Responsive breakpoints used int the Django admin */
:root {
  --primary: #2E8DD0;
  --accent: #F3F3F3;
  --secondary: #2E8DD0;
  --primary-fg: #fff;
  --header-color: #fff;
  --breadcrumbs-fg: #2E8DD0;
  --breadcrumbs-link-fg: var(--body-fg);
  --breadcrumbs-bg: #F3F3F3;
  --link-fg: #005DD0;
  --link-hover-color: #124078;
  --hairline-color: #C6C6C6;
  --button-fg: #fff;
  --button-hover-bg: #124078;
  --default-button-bg: #124078;
  --default-button-hover-bg: #000;
  --close-button-bg: #c4dce8;
  --close-button-hover-bg: #333;
  --object-tools-bg: #888;
  --object-tools-hover-bg: #333;
  --version-fg: var(--body-quiet-color);
  --env-button-fg: #F3F3F3;
}

/* Overrides */
/**
 * Branding
 */
#branding h1 a:link,
#branding h1 a:visited {
  font-weight: bold;
}

#user-tools a {
  border-bottom: none;
  text-decoration: underline;
}
#user-tools a:focus, #user-tools a:hover {
  color: var(--header-link-color);
}

div.breadcrumbs a:focus, div.breadcrumbs a:hover {
  color: #000;
}

/* Important is used because Django templates include their own style, after ours */
#changelist-filter a:focus,
#changelist-filter a:hover {
  color: var(--link-fg) !important;
}
#changelist-filter li.selected a {
  color: var(--link-fg) !important;
}
#changelist-filter li.selected a:focus, #changelist-filter li.selected a:hover {
  color: var(--primary) !important;
}

/* Calendar & time widget */
.calendar caption,
.calendarbox h2 {
  background: #C6C6C6 !important;
  color: #333 !important;
}

.calendar td a:focus, .calendar td a:hover,
.timelist a:focus,
.timelist a:hover {
  background: #124078 !important;
}

.module.clockbox h2 {
  /* Match the clock widget with the calendar widget */
  background: #C6C6C6 !important;
  color: #333 !important;
  font-weight: bold !important;
}

/* Icons */
.addlink {
  background: url("../../img/admin/plus-square-regular.1cf496b57dbb.svg") 0 0/14px 14px no-repeat;
}

.changelink, .inlinechangelink {
  background: url("../../img/admin/edit-regular.7b0dc7ee756a.svg") 0 0/14px 14px no-repeat;
}

.deletelink {
  background: url("../../img/admin/trash-alt-regular.740028d44a1c.svg") 0 0/14px 14px no-repeat;
}

.datetimeshortcuts .clock-icon {
  background: url("../../img/admin/clock-regular.54749a5adbc8.svg") 0 0/14px 14px no-repeat !important;
}

.datetimeshortcuts .date-icon {
  background: url("../../img/admin/calendar-alt-regular.3d7774c68e3d.svg") 0 0/14px 14px no-repeat !important;
}

/**
 * Django form field lengths
 */
.change-form .vTextField {
  width: 20em;
}

/**
 * Help text mouseover
 */
div.help {
  cursor: help;
  block-size: 14px;
  inline-size: 14px;
  background-image: url("../../admin/img/icon-unknown.a18cb4398978.svg");
  background-repeat: no-repeat;
  background-size: 14px;
  margin-left: 8px !important;
  margin-top: 6px !important;
  padding-inline: 0 !important;
  padding-block: 0 !important;
  position: relative;
}
div.help > div {
  display: none;
}
div.help:hover {
  background-image: none;
}
div.help:hover > div {
  display: block;
  position: absolute;
  top: 1px;
  z-index: 10;
  block-size: auto;
  inline-size: -moz-max-content;
  inline-size: max-content;
  max-inline-size: 300px;
  padding-block: 5px 3px;
  padding-inline: 5px 5px;
  background-color: #fffeaa;
  border: 1px solid #f7f071;
  color: #000;
}

/**
 * Help text for datetime field is without inner div
 */
div.help:not(:has(div)) {
  cursor: help;
  width: 16px;
  height: 16px;
  background-image: url("../../admin/img/icon-unknown.a18cb4398978.svg");
  display: inline-block;
  background-repeat: no-repeat;
  background-size: 14px;
  margin-left: 8px !important;
  margin-top: 6px !important;
  position: absolute;
  text-indent: -9999px;
}
div.help:not(:has(div)):hover {
  text-indent: inherit;
  width: auto;
  background-image: none;
  background-color: #fffeaa;
  border: 1px solid #f7f071;
  color: #000;
  padding: 5px 5px 3px 5px !important;
  max-width: 300px;
  height: auto !important;
  margin-top: 2px !important;
  z-index: 10;
}

/**
 * Help text layout
 */
.form-row:has(.help) {
  overflow: visible;
}

div:has(> div.help) {
  display: flex;
}

.related-widget-wrapper ~ div.help {
  margin-top: 8px !important;
}
.related-widget-wrapper ~ div.help:hover {
  margin-top: 4px !important;
}

/* Overrides default Django CSS */
.aligned label + p,
.aligned label + div.readonly {
  display: inline-block;
  margin-left: inherit !important;
}

.aligned label + div.help {
  margin-left: 2px !important;
}

/* Additional components seem to need the same behaviour */
/* TODO: TinyMCE is different... */
.aligned label + ul {
  display: inline-block;
  margin-left: inherit !important;
}

div:has(> div.help) {
  display: flex;
}

/*
 Project/app specific overrides, coupled to the data model.

 Generic overrides should go in _admin_theme.scss
 */
/* Colors */
/* Dimensions */
/* Responsive breakpoints used int the Django admin */
/**
 * DJANGO ADMIN INDEX
 */
body {
  --djai-tab-bg: var(--primary);
  --djai-tab-bg--active: var(--breadcrumbs-bg);
  --djai-tab-bg--hover: #124078;
  --djai-tab-fg--active: var(--secondary);
  --djai-dropdown-bg--active: #124078;
  --djai-dropdown-bg--hover: #124078;
}

.djai-dropdown-menu {
  margin-left: -15px;
  margin-right: -15px;
  padding-left: 15px;
  padding-right: 15px;
  width: 100%;
  /* Added to attach to body/breadcrumbs */
  border-bottom: 8px solid #F3F3F3;
}
@media all and (min-width: 768px) {
  .djai-dropdown-menu {
    margin-left: -30px;
    margin-right: -30px;
  }
}
@media all and (min-width: 1025px) {
  .djai-dropdown-menu {
    margin-left: -40px;
    margin-right: -40px;
  }
}
@media all and (min-width: 768px) {
  .djai-dropdown-menu {
    padding-left: 30px;
    padding-right: 30px;
  }
}
@media all and (min-width: 1025px) {
  .djai-dropdown-menu {
    padding-left: 40px;
    padding-right: 40px;
  }
}
.djai-dropdown-menu .djai-dropdown-menu__drop {
  min-width: 250px !important;
}
#header {
  padding-bottom: 0 !important;
}
#header + .breadcrumbs {
  padding-top: 2px;
}
#header .djai-dropdown-menu .djai-dropdown-menu__item--active:link,
#header .djai-dropdown-menu .djai-dropdown-menu__item--active:visited {
  color: var(--djai-tab-fg--active);
}
#header .djai-dropdown-menu .djai-dropdown-menu__item--active:link:hover,
#header .djai-dropdown-menu .djai-dropdown-menu__item--active:visited:hover {
  color: var(--djai-tab-fg--hover);
}

body.login #header {
  padding-bottom: 15px !important;
}

/**
 * DJANGO-BETTER-ADMIN-ARRAYFIELD
 * Some elements are marked as !important because the style is loaded after
 * this theme.
 */
.dynamic-array-widget {
  /* Substitute with icon */
}
.dynamic-array-widget button {
  background: #2E8DD0 !important;
  color: #fff !important;
  /* Substitute theme style above with icon. Solves translation string as well. */
}
.dynamic-array-widget button:hover {
  background: #124078 !important;
  /* border: 2px solid $color-dark !important; */
}
.dynamic-array-widget button.add-array-item {
  background: url("../../img/admin/plus-square-regular.1cf496b57dbb.svg") 0 0/14px 14px no-repeat !important;
  width: 14px;
  line-height: 16px;
  text-indent: -9999px;
  white-space: nowrap;
  margin: 0 0 5px 170px;
  display: block;
}
.dynamic-array-widget button.add-array-item:focus {
  outline-width: 0;
}
.dynamic-array-widget .remove {
  background: url("../../img/admin/trash-alt-regular.740028d44a1c.svg") 0 0/14px 14px no-repeat;
  width: 14px;
  line-height: 16px;
}
.dynamic-array-widget .remove .inline-deletelink {
  display: none;
}
.dynamic-array-widget .array-item input {
  width: 20em;
}

/* Secondary submit row */
.submit-row.submit-row-extended {
  margin-top: -24px;
  border-top: 0;
  padding-top: 0;
}

/* Extra login links in admin login screen */
.admin-login-option {
  text-align: center;
  clear: both;
  padding-top: 1em;
}

.jwt {
  display: inline-block;
  max-width: 40em;
  word-break: break-all;
}