/* Drop areas from partials/dropzone and assets/js/dropzone.js, and the drag state of other fields that take files. */

.dropzone {
    align-items: center;
    background: var(--bg-hover);
    border: 1.5px dashed var(--t-light);
    border-radius: 12px;
    box-sizing: border-box;
    color: var(--t-base);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 28px 20px;
    position: relative;
    text-align: center;
    transition: background-color .15s ease, border-color .15s ease;
    width: 100%;
}

.dropzone-input {
    cursor: pointer;
    height: 100%;
    inset: 0;
    margin: 0;
    opacity: 0;
    padding: 0;
    position: absolute;
    width: 100%;
    z-index: 1;
}

.dropzone:hover,
.dropzone:focus-within {
    border-color: var(--primary);
}

.dropzone:focus-within {
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.dropzone.is-over {
    background: var(--primary-soft);
    border-color: var(--primary);
    border-style: solid;
}

.dropzone.is-invalid {
    border-color: var(--danger);
}

.dropzone.is-busy {
    opacity: .6;
    pointer-events: none;
}

.dropzone-icon {
    align-items: center;
    background: var(--primary-soft);
    border-radius: 50%;
    color: var(--primary);
    display: flex;
    height: 44px;
    justify-content: center;
    margin-bottom: 8px;
    transition: transform .15s ease;
    width: 44px;
}

.dropzone.is-over .dropzone-icon {
    background: var(--bg-card);
    transform: translateY(-3px);
}

.dropzone-icon svg,
.dropzone-file-remove svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 20px;
}

.dropzone-title {
    font-size: 14px;
    font-weight: 600;
}

.dropzone-browse {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dropzone-help {
    color: var(--t-muted);
    font-size: 12px;
}

.dropzone-files {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    width: 100%;
}

.dropzone-files[hidden],
.dropzone-error[hidden],
[data-dropzone-submit][hidden] {
    display: none;
}

.dropzone-file {
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--t-base);
    display: flex;
    font-size: 13px;
    gap: 10px;
    min-width: 0;
    padding-block: 6px;
    padding-inline: 8px 6px;
}

.dropzone-file-type {
    background: var(--bg-muted);
    border-radius: 6px;
    color: var(--t-muted);
    flex: none;
    font-size: 10px;
    font-weight: 700;
    line-height: 28px;
    min-width: 36px;
    padding-inline: 4px;
    text-align: center;
    text-transform: uppercase;
}

.dropzone-file-name {
    flex: 1 1 auto;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropzone-file-size {
    color: var(--t-muted);
    flex: none;
    font-size: 12px;
}

.dropzone-file-remove {
    align-items: center;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--t-muted);
    cursor: pointer;
    display: flex;
    flex: none;
    height: 28px;
    justify-content: center;
    padding: 0;
    width: 28px;
}

.dropzone-file-remove svg {
    height: 14px;
    width: 14px;
}

.dropzone-file-remove:hover {
    background: var(--bg-hover);
    color: var(--danger);
}

.dropzone-file-remove:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* The media field and the image list take a drop too. */
.media-field {
    transition: background-color .15s ease, border-color .15s ease;
}

.media-field.is-empty {
    border-style: dashed;
}

.media-field.is-over {
    background: var(--primary-soft);
    border-color: var(--primary);
    border-style: solid;
}

.image-list.is-over {
    background: var(--primary-soft);
    border-radius: 10px;
    outline: 2px dashed var(--primary);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .dropzone,
    .dropzone-icon,
    .media-field {
        transition: none;
    }

    .dropzone.is-over .dropzone-icon {
        transform: none;
    }
}
