/* Styled file upload — paired with static/js/file-upload.js.
   The native <input type=file> + Django's "Currently: …" link + Clear
   checkbox get hidden via .kp-fu-native; the .kp-fu-card sits above
   them and drives the UI. */

input[type="file"].kp-fu-native,
.kp-fu-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.kp-fu-card {
    margin-top: 0.25rem;
    border: 1px solid #d1fae5;
    background: #f0fdf4;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    transition: border-color 0.15s, background 0.15s;
}
.kp-fu-card:focus-within { border-color: #6ee7b7; }

/* ----- filled state (has file) ----- */
.kp-fu-card-body {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.kp-fu-icon {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: #10b981;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.kp-fu-meta {
    flex: 1;
    min-width: 0;
}
.kp-fu-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #064e3b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kp-fu-sub {
    font-size: 0.75rem;
    color: #047857;
    margin-top: 0.1rem;
}
.kp-fu-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.kp-fu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.4rem;
    background: #fff;
    color: #047857;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #a7f3d0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.kp-fu-btn:hover {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
    text-decoration: none;
}
.kp-fu-btn-icon { width: 1rem; height: 1rem; }

.kp-fu-btn-danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff;
    padding: 0.4rem 0.55rem;
}
.kp-fu-btn-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.kp-fu-btn-ghost { /* default already */ }

/* ----- empty state (no file) ----- */
.kp-fu-empty {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 0.4rem;
    border: 1.5px dashed #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.kp-fu-empty:hover {
    border-color: #1c685e;
    background: #f0fdf4;
    color: #1c685e;
}
.kp-fu-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: #ecfdf5;
    color: #1c685e;
    font-size: 0.9rem;
}

/* ----- pending-remove ----- */
.kp-fu-card:has(.kp-fu-pending:not([style*="display:none"])) {
    border-color: #fecaca;
    background: #fef2f2;
}
.kp-fu-pending {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #991b1b;
    font-size: 0.8125rem;
    font-weight: 500;
}
.kp-fu-link {
    background: transparent;
    border: 0;
    padding: 0;
    color: #1c685e;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.kp-fu-link:hover { color: #064e3b; }

/* Mobile: stack vertically. */
@media (max-width: 640px) {
    .kp-fu-card-body {
        flex-wrap: wrap;
    }
    .kp-fu-meta { flex-basis: calc(100% - 3.1rem); }
    .kp-fu-actions {
        flex-basis: 100%;
        margin-top: 0.5rem;
        justify-content: flex-end;
    }
}
