/*
 * HumanProse files: import button, editor drop zone and Word export.
 * Scoped under body.hp-ui and built on the --hx-* tokens from hp-design.css,
 * so light, dark and right-to-left layouts follow the design layer.
 */

/* The import button matches its neighbour, "Try an example". */
body.hp-ui .hp-sheet #importFileBtn {
    background: var(--hx-surface) !important;
    color: var(--hx-ink) !important;
    border: 1px solid var(--hx-line-2) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
}
body.hp-ui .hp-sheet #importFileBtn:hover:not(:disabled) {
    border-color: var(--hx-royal) !important;
    color: var(--hx-royal-ink) !important;
}
body.hp-ui .hp-sheet #importFileBtn svg { color: currentColor !important; }
body.hp-ui #importFileBtn[aria-busy="true"] { cursor: progress; opacity: .7; }

/* The real file input stays in the page for the picker but is never seen. */
body.hp-ui .hp-files-input {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0;
}

/* Drop zone: the input editor panel. */
body.hp-ui .hp-files-dropzone { position: relative; }
body.hp-ui #workspace .hp-files-dropzone.is-dragging {
    border-color: var(--hx-royal) !important;
    box-shadow: 0 0 0 4px var(--hx-royal-soft) !important;
}
body.hp-ui .hp-files-dropzone.is-importing .text-editor-input { opacity: .6; }

body.hp-ui .hp-files-drop {
    position: absolute;
    inset: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-inline: 24px;
    border: 2px dashed var(--hx-royal);
    border-radius: 16px;
    background: color-mix(in srgb, var(--hx-surface) 90%, transparent);
    color: var(--hx-royal-ink);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    pointer-events: none;
}
body.hp-ui .hp-files-drop[hidden] { display: none !important; }
body.hp-ui .hp-files-drop svg { color: currentColor; }

html[data-hp-theme="dark"] body.hp-ui .hp-files-drop {
    border-color: var(--hx-cream);
    color: var(--hx-ink);
}

@media (prefers-reduced-motion: no-preference) {
    body.hp-ui .hp-files-drop { animation: hpFilesDropIn .16s ease both; }
    @keyframes hpFilesDropIn { from { opacity: 0; } to { opacity: 1; } }
}
