/* umai — attachment picker (file-drop.js).
 *
 * Shared by the panel's support pages and the account area on umai.media, the
 * same way the script is. Every colour here comes from a token, and each site
 * maps its own palette onto them, so the component looks native in both
 * without either stylesheet holding a copy of these rules.
 *
 * Tokens expected: --fd-surface, --fd-surface-muted, --fd-border, --fd-text,
 * --fd-text-muted, --fd-accent, --fd-accent-soft, --fd-danger,
 * --fd-danger-soft, --fd-radius, --fd-radius-sm.
 */

.file-drop {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* The real input still holds the files and still submits; it is only hidden
   from view, never disabled or detached. */
.file-drop__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.file-drop__zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    padding: 1.5rem 1rem;
    background-color: var(--fd-surface-muted);
    border: 2px dashed var(--fd-border);
    border-radius: var(--fd-radius);
    color: var(--fd-text);
    font-family: inherit;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.file-drop__zone:hover,
.file-drop__zone:focus-visible {
    background-color: var(--fd-accent-soft);
    border-color: var(--fd-accent);
    outline: none;
}

.file-drop--over .file-drop__zone {
    background-color: var(--fd-accent-soft);
    border-color: var(--fd-accent);
    border-style: solid;
}

.file-drop__zone-icon {
    width: 28px;
    height: 28px;
}

.file-drop__zone-text {
    font-weight: 700;
}

.file-drop__zone-hint {
    font-size: 0.8125rem;
    color: var(--fd-text-muted);
}

.file-drop__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.file-drop__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background-color: var(--fd-surface);
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-sm);
}

.file-drop__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    overflow: hidden;
    background-color: var(--fd-surface-muted);
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-sm);
    color: var(--fd-text-muted);
}

.file-drop__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-drop__thumb svg {
    width: 20px;
    height: 20px;
}

.file-drop__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.file-drop__name {
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-drop__size {
    font-size: 0.75rem;
    color: var(--fd-text-muted);
}

.file-drop__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-sm);
    color: var(--fd-text-muted);
    cursor: pointer;
}

.file-drop__remove:hover {
    background-color: var(--fd-danger-soft);
    border-color: var(--fd-danger);
    color: var(--fd-danger);
}

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

.file-drop__errors {
    margin: 0;
    padding: 0 0 0 1.125rem;
    list-style: disc;
    font-size: 0.8125rem;
    color: var(--fd-danger);
}

.file-drop__errors:empty {
    display: none;
}

.file-drop__progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-drop__bar {
    flex: 1 1 auto;
    height: 10px;
    overflow: hidden;
    background-color: var(--fd-surface-muted);
    border: 1px solid var(--fd-border);
    border-radius: 999px;
}

.file-drop__bar-fill {
    width: 0;
    height: 100%;
    background-color: var(--fd-accent);
    transition: width 0.2s ease;
}

.file-drop__progress-text {
    flex: 0 0 auto;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    color: var(--fd-text-muted);
}
