/* Custom file upload dropzone */

.file-upload {
    width: 100%;
}

.file-upload__native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-upload__dropzone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 10.5rem;
    padding: 1.25rem;
    border: 1px dashed color-mix(in oklab, var(--im-gold, #d4af37) 35%, var(--border));
    border-radius: 0.75rem;
    background: var(--im-darker, #141414);
    cursor: pointer;
    transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
    outline: none;
}

.file-upload__dropzone:hover,
.file-upload__dropzone:focus-visible {
    border-color: color-mix(in oklab, var(--im-gold, #d4af37) 55%, var(--border));
    background: color-mix(in oklab, var(--im-darker, #141414) 88%, var(--im-gold, #d4af37) 12%);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.12);
}

.file-upload__dropzone.is-dragover {
    border-color: var(--im-gold, #d4af37);
    background: rgba(212, 175, 55, 0.08);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.file-upload__dropzone.has-file {
    min-height: auto;
    padding: 0.75rem;
    cursor: default;
}

.file-upload__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    pointer-events: none;
}

.file-upload__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.28);
    color: var(--im-gold, #d4af37);
}

.file-upload__icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.file-upload__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
}

.file-upload__subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

.file-upload__subtitle strong {
    color: var(--im-gold, #d4af37);
    font-weight: 600;
}

.file-upload__types {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.file-upload__preview {
    width: 100%;
}

.file-upload__preview[hidden],
.file-upload__empty[hidden] {
    display: none !important;
}

.file-upload__img {
    display: block;
    width: 100%;
    max-height: 14rem;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: #0a0a0a;
}

.file-upload__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.file-upload__name {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    color: var(--foreground);
    word-break: break-all;
}

.file-upload__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.file-upload__btn {
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.file-upload__btn--change {
    border: 1px solid color-mix(in oklab, var(--im-gold, #d4af37) 45%, var(--border));
    background: rgba(212, 175, 55, 0.1);
    color: var(--im-gold, #d4af37);
}

.file-upload__btn--change:hover {
    background: rgba(212, 175, 55, 0.18);
}

.file-upload__btn--clear {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted-foreground);
}

.file-upload__btn--clear:hover {
    color: var(--foreground);
    border-color: color-mix(in oklab, var(--border) 70%, #c44a4a);
}

.file-upload.is-uploading .file-upload__dropzone {
    pointer-events: none;
    opacity: 0.72;
}

.file-upload__progress {
    margin-top: 0.75rem;
}

.file-upload__progress[hidden] {
    display: none !important;
}

.file-upload__progress-track {
    height: 0.375rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    border: 1px solid var(--border);
}

.file-upload__progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in oklab, var(--im-gold, #d4af37) 80%, #fff) 0%, var(--im-gold, #d4af37) 100%);
    transition: width 120ms ease;
}

.file-upload__progress-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-align: center;
}
