/* ---------------------------------------------------------------------------
 * myfiles-controls.css
 *
 * Shared styles for the My Files tab on vr.php, ca.php and dl.php.
 * Drives the search input, items-per-page dropdown, drag handle, edit pencil
 * and pager rendered by js/myfiles-controls.js (KAN-7).
 * --------------------------------------------------------------------------- */

.my-files-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.files-search-input {
    flex: 1 1 220px;
    min-width: 180px;
    padding: 0.55rem 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.files-search-input::placeholder { color: rgba(255, 255, 255, 0.45); }
.files-search-input:focus {
    border-color: #4F46E5;
    background: rgba(79, 70, 229, 0.08);
}

.files-pagesize-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
}
.files-pagesize-select {
    padding: 0.45rem 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}
/* The native dropdown panel inherits OS styling (white background on most
 * platforms), so the white option text on the closed select would render
 * white-on-white when expanded. Force the option entries to black. */
.files-pagesize-select option {
    color: #000;
    background: #fff;
}

/* Drag handle on each file row */
.files-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    margin-right: 0.6rem;
    color: rgba(255, 255, 255, 0.45);
    cursor: grab;
    user-select: none;
    transition: color 0.2s ease;
}
.files-drag-handle:hover { color: #fff; }
.files-drag-handle:active { cursor: grabbing; }

.files-drag-ghost {
    opacity: 0.45;
    background: rgba(79, 70, 229, 0.18) !important;
}

/* Edit pencil + save/cancel buttons (sit alongside the existing .delete-btn) */
.files-edit-btn,
.files-save-btn,
.files-cancel-btn {
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 0.35rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.files-edit-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}
.files-save-btn {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}
.files-save-btn:hover { background: rgba(74, 222, 128, 0.12); }
.files-cancel-btn {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}
.files-cancel-btn:hover { background: rgba(248, 113, 113, 0.12); }
.files-save-btn:disabled,
.files-cancel-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Inline rename input replaces .file-name temporarily */
.files-edit-input {
    width: 100%;
    padding: 0.4rem 0.55rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #4F46E5;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
}

/* Pager */
.files-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.78);
}
.files-pager-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #fff;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.files-pager-btn:hover:not(:disabled) {
    background: rgba(79, 70, 229, 0.18);
    border-color: #4F46E5;
}
.files-pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.files-pager-info {
    font-size: 0.9rem;
}

/* Make .file-item flex-row aware of the drag handle (idempotent — pages that
 * already define .file-item layout in their own CSS keep their rules; this
 * only provides a sensible baseline if the row hasn't been styled.) */
.file-item {
    display: flex;
    align-items: center;
}
