/* components/_accordion.scala.html */
a.accordion-toggle:after {
  font-family: FontAwesome;
  content: "\f078";
  float: right;
  margin-right: 12px;
  color: #302e2e;
}

a.accordion-toggle.collapsed:after {
  content: "\f054";
}

/* components/_filter.scala.html */
.checkbox-filter .section-divider {
  height: 1px;
  width: 100%;
  background-color: #ccc;
  margin: 16px 0;
}

/* components/_toast.scala.html */
#fl-toast-container {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap-reverse;
  align-content: flex-end;
  /* Only the column gap: the vertical rhythm is each toast's own margin, so a leaving toast can
     animate it away instead of leaving 8px that snaps shut when the node goes. */
  column-gap: 8px;
  padding: 8px;
  max-height: 100vh;
  box-sizing: border-box;
  /* Clips toasts parked off-canvas to the right, so they neither show nor widen the page. */
  overflow: hidden;
}

/* Hidden until it is in the container: a server-rendered toast is markup wherever the template was
   included, and only moves into the container when components.js runs at end of body. Laid out where
   it sits, a 400px block pushed off to the right shifts the page and can widen it - and stays that
   way if anything throws earlier in that script. */
.fl-toast {
  --fl-toast-accent: #3086ea;
  display: none;
  justify-content: space-between;
  width: 400px;
  margin-bottom: 8px;
  text-align: center;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0px 0px 6px -1px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* In the container, the resting state is also the exit state and `.show` the entry state; each
   carries its own timing function, which is what gives entry and exit different curves from one
   class toggle. The offset clears the container's own padding, which overflow clips at rather than
   the content edge - 100% alone would leave a sliver showing.
   Both states are scoped: an id outranks `.show`, so an unscoped `.show` could not take the
   transform back off. */
#fl-toast-container .fl-toast {
  display: flex;
  transform: translateX(calc(100% + 16px));
  transition: transform 500ms cubic-bezier(0.7, 0, 0.84, 0);
}

/* Second half of the exit: once the toast is off-canvas its box shrinks to nothing, so the stack
   below closes the gap over these 300ms rather than jumping when the node is removed. The renderers
   pin an explicit height first - `height: auto` has nothing to transition from.
   The toast itself is long gone from view by now, so this curve is not about the shrink: the stack
   below is pushed by it, and its travel is the only thing anyone sees. Hence the entry's own
   expo-out, so toasts arrive and close ranks on the same curve. */
#fl-toast-container .fl-toast.collapsing {
  transition: height 300ms cubic-bezier(0.16, 1, 0.3, 1),
    margin-bottom 300ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 500ms cubic-bezier(0.7, 0, 0.84, 0);
}

/* !important because Bootstrap 3 is also on the page and its own `.show` is
   `display: block !important`, which would otherwise drop the flex row. */
#fl-toast-container .fl-toast.show {
  display: flex !important;
  transform: none;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fl-toast-success {
  --fl-toast-accent: #16ad24;
}
.fl-toast-danger {
  --fl-toast-accent: #ff0002;
}
.fl-toast-warning {
  --fl-toast-accent: #ffb700;
}

.fl-toast .left-bar {
  width: 10px;
  flex-shrink: 0;
  background-color: var(--fl-toast-accent);
}

/* On a self-closing toast the accent stripe doubles as the countdown: it empties from the top over
   exactly the delay the renderers schedule the dismissal with, which they pass in as
   --fl-toast-duration so the stripe cannot drift from the timer. A toast that waits to be closed
   keeps its stripe full. scaleY, not height, to stay on the compositor.
   Deliberately not scoped to .show: dismissal removes that class, which would drop the animation
   and snap the drained stripe back to full for the length of the exit. */
.fl-toast.auto-dismiss .left-bar {
  transform-origin: bottom;
  animation: fl-toast-drain var(--fl-toast-duration, 10000ms) linear forwards;
}

@keyframes fl-toast-drain {
  from {
    transform: scaleY(1);
  }
  to {
    transform: scaleY(0);
  }
}

.fl-toast-close-all {
  display: none;
  width: fit-content;
  background: white;
  border: none;
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0px 0px 6px -1px rgba(0, 0, 0, 0.5);
  font-size: 11px;
  /* Bootstrap's inherited 1.428 leaves descender space this label never uses, which reads as the
     text sitting high in the pill. */
  line-height: 1;
  cursor: pointer;
}

.fl-toast-close-all:hover {
  background-color: #f0f0f0;
}

.fl-toast .content {
  height: 100%;
  width: 100%;
  display: flex;
  gap: 12px;
}

.fl-toast .text {
  padding: 8px 0;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.fl-toast .text .title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  width: 100%;
  text-align: left;
  justify-content: space-between;
}

.fl-toast .text .message {
  font-size: 12px;
  text-align: left;
  margin-right: 12px;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#fl-toast-container.large .fl-toast .text .message,
.fl-toast .text .message.expanded {
  max-height: none;
  overflow: visible;
  display: block;
}

.fl-toast .expand-buttons {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

#fl-toast-container.large .fl-toast .expand-buttons {
  display: none;
}

.fl-toast .expand-buttons .read-less,
.fl-toast .expand-buttons .read-more {
  display: block;
  background: none;
  border: none;
  color: #5aabe2;
  cursor: pointer;
  font-size: 11px;
  margin-right: 12px;
}

.fl-toast .expand-buttons .read-less {
  display: none;
}

.fl-toast .fl-toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  margin-right: 12px;
}

.fl-toast .fl-toast-close img {
  filter: invert(41%) sepia(16%) saturate(11%) hue-rotate(34deg) brightness(91%)
    contrast(90%);
  width: 20px;
}
/* end components/_toast.scala.html */

/* components/_switch.scala.html */
.fl-switch {
  display: inline-block;
  width: 28px;
  height: 18px;
  margin-bottom: 0;
}

.fl-switch .fl-switch-checkbox {
  display: none;
}

.fl-switch .fl-switch-slider {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #d0d0d0;
  border-radius: 14px;
}

.fl-switch .fl-switch-slider:after {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 4px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 100%;
  transition: 0.4s;
}

.fl-switch .fl-switch-checkbox:checked + .fl-switch-slider {
  background-color: #40cac0;
}

.fl-switch .fl-switch-checkbox:checked + .fl-switch-slider:after {
  transform: translateX(8px);
}

.fl-switch .fl-switch-checkbox:disabled + .fl-switch-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hide Alpaca form buttons inside the PDF viewer drawer (the drawer has its own buttons) */
#drawer-data-view-content .alpaca-form-buttons-container,
#drawer-data-view-content .alpaca-wizard-buttons {
  display: none !important;
}

/* Bootstrap tooltips in the light theme.

   `[data-toggle="tooltip"]` is initialised on every page by javascripts/tooltip.js and is still
   spread across the legacy Twirl views, where Bootstrap styles it black-on-white. The new UI hints
   are tippy's `light` theme, so the same control looked like two different things depending on
   which page you found it on. Restyling here rather than migrating that markup keeps it to a paint
   change - the values are tippy's own light theme verbatim.

   Both layouts load this file after Bootstrap (View.scala and main_single_open_header), so source
   order settles it and none of this needs `!important`. */
.tooltip-inner {
  color: #26323d;
  background-color: #fff;
  box-shadow: 0 0 20px 4px rgba(154, 161, 177, 0.15), 0 4px 80px -8px rgba(36, 40, 47, 0.25),
    0 4px 4px -2px rgba(91, 94, 105, 0.15);
}

/* Bootstrap fades to .9; a white bubble needs the full value or it greys against the page. */
.tooltip.in {
  filter: alpha(opacity=100);
  opacity: 1;
}

.tooltip.top .tooltip-arrow,
.tooltip.top-left .tooltip-arrow,
.tooltip.top-right .tooltip-arrow {
  border-top-color: #fff;
}

.tooltip.bottom .tooltip-arrow,
.tooltip.bottom-left .tooltip-arrow,
.tooltip.bottom-right .tooltip-arrow {
  border-bottom-color: #fff;
}

.tooltip.right .tooltip-arrow {
  border-right-color: #fff;
}

.tooltip.left .tooltip-arrow {
  border-left-color: #fff;
}

/* Bootstrap 5 is on the page too (View.scala loads it from the CDN) and drives its own tooltip
   from these variables rather than the rules above. */
.tooltip {
  --bs-tooltip-bg: #fff;
  --bs-tooltip-color: #26323d;
  --bs-tooltip-opacity: 1;
}
