/* --------------------------- FileUpload Dropzone -------------------------- */
.navds-dropzone__area {
  --__axc-dropzone-background: var(--ax-bg-input);
  --__axc-dropzone-icon-padding: var(--ax-spacing-2);
  --__axc-dropzone-animation-length-long: 400ms;
  --__axc-dropzone-animation-length-short: 250ms;
  --__axc-dropzone-animation-ease-out: cubic-bezier(0.3, 1, 0.3, 1);
  --__axc-dropzone-animation-over-under: cubic-bezier(0.3, 1, 0.3, 1);

  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--ax-spacing-4);
  text-align: center;
  padding: var(--ax-spacing-4) var(--ax-spacing-5);
  border: 1px dashed var(--ax-border-default);
  border-radius: var(--ax-border-radius-xlarge);
  background-color: var(--__axc-dropzone-background);
  color: var(--ax-text-default);
  transition: background-color var(--__axc-dropzone-animation-length-short) var(--__axc-dropzone-animation-ease-out);
  cursor: pointer;

  &:hover:not([data-disabled="true"]) {
    border-color: var(--ax-border-accent-strong);

    & > .navds-dropzone__area-button {
      color: var(--ax-text-accent-strong);
      background-color: var(--ax-bg-accent-moderate-hover);
      box-shadow: inset 0 0 0 2px var(--ax-bg-accent-strong-hover);
    }
  }

  &:active .navds-dropzone__area-button {
    background-color: var(--ax-bg-accent-strong-pressed);
    color: var(--ax-text-accent-contrast);
    box-shadow: none;
  }

  &[data-disabled="true"] {
    cursor: default;
  }
}

.navds-dropzone--dragging {
  & > .navds-dropzone__area {
    --__axc-dropzone-background: var(--ax-bg-input);
  }

  & > .navds-dropzone__area::after {
    color: var(--ax-text-accent-strong);
    background-color: var(--ax-bg-accent-moderateA);
    content: "";
    inset: 0;
    margin: -1px;
    border: 1px dashed var(--ax-border-accent-strong);
    position: absolute;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: var(--ax-border-radius-xlarge);
    animation: akselDropzoneDragoverAnimation var(--__axc-dropzone-animation-length-short)
      var(--__axc-dropzone-animation-ease-out);
  }
}

@keyframes akselDropzoneDragoverAnimation {
  0% {
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
    background-color: transparent;
  }

  70% {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  100% {
    background-color: var(--ax-bg-accent-moderateA);
  }
}

.navds-dropzone__area-icon {
  display: grid;
  padding: var(--__axc-dropzone-icon-padding);
  visibility: hidden;
}

.navds-dropzone--error > .navds-dropzone__area {
  border-color: transparent;
  outline: 2px solid var(--ax-border-danger);
  outline-offset: -1px;
}

.navds-dropzone__area-release {
  top: var(--ax-spacing-4);
  display: grid;
  position: absolute;
  z-index: 1;
  pointer-events: none;
  transition:
    top var(--__axc-dropzone-animation-length-long) var(--__axc-dropzone-animation-over-under),
    transform var(--__axc-dropzone-animation-length-long) var(--__axc-dropzone-animation-over-under);
}

.navds-dropzone__area-release__icon {
  display: grid;
  padding: var(--__axc-dropzone-icon-padding);
  border-radius: var(--ax-border-radius-full);
  background-color: var(--ax-bg-neutral-moderateA);
  transition:
    background-color 300ms var(--__axc-dropzone-animation-ease-out),
    font-size 300ms var(--__axc-dropzone-animation-ease-out);
  font-size: 1.5rem;
}

.navds-dropzone--dragging .navds-dropzone__area-release > .navds-dropzone__area-release__icon {
  background-color: transparent;
  font-size: 2rem;
}

.navds-dropzone__area-release__text {
  visibility: hidden;
}

.navds-dropzone--dragging .navds-dropzone__area-release > .navds-dropzone__area-release__text {
  transition: visibility var(--__axc-dropzone-animation-length-long) var(--__axc-dropzone-animation-over-under);
  visibility: visible;
}

.navds-dropzone--dragging .navds-dropzone__area-release {
  color: var(--ax-text-accent-strong);
  top: 50%;
  transform: translateY(-50%);
}

.navds-dropzone__area-disabled {
  color: var(--ax-text-subtle);
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--ax-spacing-2);
}

/* ----------------------------- FileUpload Item ---------------------------- */
.navds-file-upload :is(ul, li),
ul:has(> li.navds-file-item),
li.navds-file-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.navds-file-item__inner {
  background-color: var(--ax-bg-raised);
  border: 1px solid var(--ax-border-subtleA);
  outline-offset: -1px;
  transition: outline-color 250ms cubic-bezier(0, 0.3, 0.15, 1);
  border-radius: var(--ax-border-radius-xlarge);
  padding: var(--ax-spacing-3) var(--ax-spacing-4);
  display: flex;
  gap: var(--ax-spacing-3);
  align-items: flex-start;
}

.navds-file-item--error > .navds-file-item__inner {
  outline: 2px solid var(--ax-border-danger);
}

.navds-file-item__icon {
  background-color: var(--ax-bg-neutral-moderateA);
  color: var(--ax-text-default);
  border-radius: var(--ax-border-radius-full);
  min-height: 2.5rem;
  min-width: 2.5rem;
  margin-top: var(--ax-spacing-05);
  display: grid;
  place-content: center;
  transition: background-color 250ms cubic-bezier(0, 0.3, 0.15, 1);

  & > svg {
    height: 1.5rem;
    width: 1.5rem;
  }
}

.navds-file-item__icon--loading {
  background-color: transparent;
}

.navds-file-item__file-info {
  word-break: break-word;
}

.navds-file-item__button {
  margin-left: auto;
}

.navds-file-item__error {
  color: var(--ax-text-danger);
  display: grid;
  transition-property: grid-template-rows, padding-top;
  transition-duration: 250ms;
  transition-timing-function: cubic-bezier(0, 0.3, 0.15, 1);
  overflow: hidden;
  grid-template-rows: 0fr;

  & .navds-file-item__error {
    grid-template-rows: 1fr;
    padding-top: var(--ax-spacing-1);
  }
}

.navds-file-item__error-content {
  min-height: 0;
  display: flex;
  gap: var(--ax-spacing-1);

  & > svg {
    flex-shrink: 0;
    height: 1rem;
    margin-top: 0.1rem;
  }
}
