/**
 * FileUpload.Dropzone
 */

.navds-dropzone__area {
  --__ac-dropzone-background: var(--a-surface-subtle);
  --__ac-dropzone-text-color: var(--a-text-default);
  --__ac-dropzone-padding: var(--a-spacing-6);
  --__ac-dropzone-icon-padding: var(--a-spacing-2);
  --__ac-dropzone-animation-length-long: 0.6s;
  --__ac-dropzone-animation-length-short: 250ms;
  --__ac-dropzone-animation-ease-out: cubic-bezier(0.3, 1, 0.3, 1);
  --__ac-dropzone-animation-over-under: cubic-bezier(0.3, 1.4, 0.3, 1);

  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--a-spacing-4);
  text-align: center;
  padding: var(--__ac-dropzone-padding);
  outline: 1px dashed var(--a-border-subtle);
  outline-offset: -1px;
  border-radius: var(--a-border-radius-large);
  background-color: var(--__ac-dropzone-background);
  color: var(--__ac-dropzone-text-color);
  transition: background-color var(--__ac-dropzone-animation-length-short) var(--__ac-dropzone-animation-ease-out);
  cursor: pointer;
}

.navds-dropzone__area:hover {
  box-shadow: inset 0 2px 4px 1px rgb(11 11 11/ 0.05);
  outline-color: var(--a-border-default);
}

.navds-dropzone--disabled > .navds-dropzone__area:hover {
  outline-color: var(--a-border-subtle);
  box-shadow: initial;
  cursor: default;
}

.navds-dropzone--dragging > .navds-dropzone__area {
  --__ac-dropzone-background: var(--a-surface-action-subtle-hover);
}

.navds-dropzone--dragging > .navds-dropzone__area::after {
  outline: 1px dashed var(--a-border-subtle);
  outline-offset: -1px;
  color: var(--a-text-action-selected);
  background-color: var(--a-surface-hover);
  content: "";
  inset: 0;
  position: absolute;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 2px 7px 3px rgb(11 11 11/ 0.1);
  border-radius: var(--a-border-radius-large);
  animation: akselDropzoneDragoverAnimation var(--__ac-dropzone-animation-length-short) var(--__ac-dropzone-animation-ease-out);
}

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

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

  100% {
    background-color: var(--a-surface-hover);
  }
}

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

.navds-dropzone--error:where(:not(.navds-dropzone--dragging)) > .navds-dropzone__area {
  outline-color: var(--a-surface-danger);
  outline-width: 2px;
}

.navds-dropzone__area:hover > .navds-dropzone__area-button {
  color: var(--ac-button-secondary-hover-text, var(--__ac-button-secondary-hover-text, var(--a-text-action-on-action-subtle)));
  background-color: var(
    --ac-button-secondary-hover-bg,
    var(--__ac-button-secondary-hover-bg, var(--a-surface-action-subtle-hover))
  );
}

.navds-dropzone__area:active .navds-dropzone__area-button {
  color: var(--ac-button-secondary-active-text, var(--__ac-button-secondary-active-text, var(--a-text-on-action)));
  background-color: var(--ac-button-secondary-active-bg, var(--__ac-button-secondary-active-bg, var(--a-surface-action-active)));
  box-shadow: none;
}

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

.navds-dropzone__area-release__icon {
  display: grid;
  padding: var(--__ac-dropzone-icon-padding);
  border-radius: var(--a-border-radius-full);
  background-color: var(--a-surface-neutral-subtle);
  transition:
    background-color 300ms var(--__ac-dropzone-animation-ease-out),
    font-size 300ms var(--__ac-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(--__ac-dropzone-animation-length-long) var(--__ac-dropzone-animation-over-under);
  visibility: visible;
}

.navds-dropzone--dragging .navds-dropzone__area-release {
  color: var(--a-text-action-selected);
  top: 50%;
  transform: translateY(-50%);
}

.navds-dropzone__area-disabled {
  color: var(--a-text-subtle);
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--a-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 {
  outline: 1px solid var(--a-border-subtle);
  outline-offset: -1px;
  transition: outline-color 250ms cubic-bezier(0, 0.3, 0.15, 1);
  border-radius: var(--a-border-radius-large);
  padding: var(--a-spacing-3);
  display: flex;
  gap: var(--a-spacing-3);
  align-items: flex-start;
}

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

.navds-file-item__icon {
  background-color: var(--a-surface-neutral-subtle);
  color: var(--a-icon-default);
  border-radius: var(--a-border-radius-full);
  min-height: 3rem;
  min-width: 3rem;
  display: grid;
  place-content: center;
  transition: background-color 250ms cubic-bezier(0, 0.3, 0.15, 1);
}

.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(--a-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 .navds-file-item__error {
  grid-template-rows: 1fr;
  padding-top: var(--a-spacing-1);
}

.navds-file-item__error-content > svg {
  flex-shrink: 0;
  height: 1rem;
  margin-top: 0.1rem;
}

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