/* DaisyUI tooltip overrides */

*,
::before,
::after {
  --tooltip-tail: 7px;
  --tooltip-tail-offset: calc(100% + 6px - var(--tooltip-tail));
  --tooltip-offset: calc(100% + 7px + var(--tooltip-tail, 0px));
  --tooltip-color: black;
  --tooltip-text-color: white;
  /* https://unused-css.com/blog/css-outer-glow/ */
}

.tooltip-bottom:before {
  padding: 0.4rem 0.7rem;
  box-shadow: 0px 0px 0px 1px #28282a;
  z-index: 8;
  pointer-events: none;
}

.tooltip-bottom:after {
  content: url("data:image/svg+xml,%3Csvg width='15' height='7.5' viewBox='0 0 15 7.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,7.5 L7.5,0 L15,7.5' fill='black' stroke='%2328282A' stroke-width='1' stroke-linecap='butt'/%3E%3C/svg%3E");
  transform: translateX(-50%);
  bottom: 0;
  left: 50%;
  right: auto;
  bottom: auto;
  display: block;
  width: 15px;
  height: 7.5px;
  border-color: transparent;
  border-style: none;
  border-width: 0;
  z-index: 9;
  pointer-events: none;
}

.tooltip-top:before {
  padding: 0.4rem 0.7rem;
  box-shadow: 0px 0px 0px 1px #28282a;
  z-index: 8;
  pointer-events: none;
}

.tooltip-top:after {
  content: url("data:image/svg+xml,%3Csvg width='15' height='7.5' viewBox='0 0 15 7.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 L7.5,7.5 L15,0' fill='black' stroke='%2328282A' stroke-width='1' stroke-linecap='butt'/%3E%3Cline x1='0' y1='0' x2='15' y2='0' stroke='black' stroke-width='1'/%3E%3C/svg%3E");
  transform: translateX(-50%);
  top: -25px;
  left: 50%;
  right: auto;
  bottom: auto;
  display: block;
  width: 15px;
  height: 7.5px;
  border-color: transparent;
  border-style: none;
  border-width: 0;
  z-index: 9;
  pointer-events: none;
}

.tooltip-right:before {
  padding: 0.4rem 0.7rem;
  box-shadow: 0px 0px 0px 1px #28282a;
  z-index: 8;
  pointer-events: none;
}

.tooltip-right:after {
  content: url("data:image/svg+xml,%3Csvg width='7.5' height='15' viewBox='0 0 7.5 15' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.5,0 L0,7.5 L7.5,15' fill='black' stroke='%2328282A' stroke-width='1' stroke-linecap='butt'/%3E%3C/svg%3E");
  transform: translateY(-50%);
  top: 50%;
  left: auto;
  bottom: auto;
  right: -14px;
  display: block;
  width: 7.5px;
  height: 19px;
  border-color: transparent;
  border-style: none;
  border-width: 0;
  z-index: 9;
  pointer-events: none;
}

.tooltip-left:before {
  padding: 0.4rem 0.7rem;
  box-shadow: 0px 0px 0px 1px #28282a;
  z-index: 8;
  pointer-events: none;
}

.tooltip-left:after {
  content: url("data:image/svg+xml,%3Csvg width='7.5' height='15' viewBox='0 0 7.5 15' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 L7.5,7.5 L0,15' fill='black' stroke='%2328282A' stroke-width='1' stroke-linecap='butt'/%3E%3C/svg%3E");
  transform: translateY(-50%);
  top: 50%;
  right: auto;
  bottom: auto;
  left: -14px;
  display: block;
  width: 7.5px;
  height: 25px;
  border-color: transparent;
  border-style: none;
  border-width: 0;
  z-index: 9;
  pointer-events: none;
}

.tooltip.tooltip-open:active:before,
.tooltip:hover:active:before {
  opacity: 0 !important;
  transition-delay: 0ms;
}

.tooltip.tooltip-open:active:after,
.tooltip:hover:active:after {
  opacity: 0 !important;
  transition-delay: 0ms;
}

/* Daisy Toast override */

.toast > * {
  animation: slide-in 0.15s ease-in !important;
}

@keyframes slide-in {
  0%,
  20% {
    transform: translateX(100%);
    opacity: 0;
  }
  80% {
    transform: translateX(-10%);
    opacity: 1;
  }
  90% {
    transform: translateX(8%);
  }
  95% {
    transform: translateX(-5%);
    opacity: 1;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}


/* Alert overrides */

/* this undoes the min-width special styling within daisy */

.alert {
  grid-auto-flow: column;
  grid-template-columns: auto minmax(auto, 1fr);
  justify-items: start;
  text-align: start;
}

/* Form overrides */

.input {
  background-color: transparent;
}

/* Modal override */

dialog button:focus,
dialog button:focus-visible {
  outline: none !important;
}

/* Code overrides — undoing */

.prose :where(code):not(:where([class~='not-prose'] *, pre *)) {
  padding: 0;
  border-radius: 0;
  background-color: transparent;
}

.prose :where(code):not(pre code):not(:where([class~='not-prose'] *)):before,
.prose :where(code):not(pre code):not(:where([class~='not-prose'] *)):after {
  content: '`';
  display: inline-block;
}

:root .prose {
  --tw-prose-pre-bg: #0d0d0d !important;
  --tw-prose-pre-code: #ffffff !important;
}

/* dark_mode overrides where daisy would otherwise override based upon prefers-color-scheme: dark*/

@media (prefers-color-scheme: dark) {
  :root body:not(.dark) .prose {
    --tw-prose-body: initial;
    --tw-prose-headings: initial;
    --tw-prose-lead: initial;
    --tw-prose-links: initial;
    --tw-prose-bold: initial;
    --tw-prose-counters: initial;
    --tw-prose-bullets: initial;
    --tw-prose-hr: initial;
    --tw-prose-quotes: initial;
    --tw-prose-quote-borders: initial;
    --tw-prose-captions: initial;
    --tw-prose-code: initial;
    /* --tw-prose-pre-code: initial; */
    /* --tw-prose-pre-bg: initial; */
    --tw-prose-th-borders: initial;
    --tw-prose-td-borders: initial;
    --tw-prose-invert-body: initial;
    --tw-prose-invert-headings: initial;
    --tw-prose-invert-lead: initial;
    --tw-prose-invert-links: initial;
    --tw-prose-invert-bold: initial;
    --tw-prose-invert-counters: initial;
    --tw-prose-invert-bullets: initial;
    --tw-prose-invert-hr: initial;
    --tw-prose-invert-quotes: initial;
    --tw-prose-invert-quote-borders: initial;
    --tw-prose-invert-captions: initial;
    --tw-prose-invert-code: initial;
    --tw-prose-invert-pre-code: initial;
    --tw-prose-invert-pre-bg: initial;
    --tw-prose-invert-th-borders: initial;
    --tw-prose-invert-td-borders: initial;
  }
}
:root body.dark .prose {
  --tw-prose-body: initial;
  --tw-prose-headings: initial;
  --tw-prose-lead: initial;
  --tw-prose-links: initial;
  --tw-prose-bold: initial;
  --tw-prose-counters: initial;
  --tw-prose-bullets: initial;
  --tw-prose-hr: initial;
  --tw-prose-quotes: initial;
  --tw-prose-quote-borders: initial;
  --tw-prose-captions: initial;
  --tw-prose-code: initial;
  /* --tw-prose-pre-code: initial; */
  /* --tw-prose-pre-bg: initial; */
  --tw-prose-th-borders: initial;
  --tw-prose-td-borders: initial;
  --tw-prose-invert-body: initial;
  --tw-prose-invert-headings: initial;
  --tw-prose-invert-lead: initial;
  --tw-prose-invert-links: initial;
  --tw-prose-invert-bold: initial;
  --tw-prose-invert-counters: initial;
  --tw-prose-invert-bullets: initial;
  --tw-prose-invert-hr: initial;
  --tw-prose-invert-quotes: initial;
  --tw-prose-invert-quote-borders: initial;
  --tw-prose-invert-captions: initial;
  --tw-prose-invert-code: initial;
  --tw-prose-invert-pre-code: initial;
  --tw-prose-invert-pre-bg: initial;
  --tw-prose-invert-th-borders: initial;
  --tw-prose-invert-td-borders: initial;
}

/* hide tooltip on touch devices */

@media (hover: none), (hover: on-demand), (-moz-touch-enabled: 1), (pointer: coarse) {
  .tooltip:hover:after,
  .tooltip:hover:active:before,
  .tooltip:hover:active:after,
  .tooltip:hover:before {
    display: none;
  }
}
