
/*
 * UDAP File Uploader Stylesheet v2.1.1
 * Fix for "Move To" modal appearing on page load.
 */

body #udap-file-manager {
    background-color: #fdfdfd !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 0 !important;
    margin: 2em auto !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    overflow: hidden !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1) !important;
    display: flex !important;
    flex-direction: column !important;
    width: 90% !important;
    max-width: 900px !important;
    height: 90vh !important;
    max-height: 750px !important;
}

body .udap-fm-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 20px !important;
    border-bottom: 1px solid #ddd !important;
    flex-shrink: 0 !important;
}
body .udap-fm-header h3 { 
    margin: 0 !important; 
    padding: 0 !important;
    border: none !important;
    font-size: 1.2em !important;
    line-height: 1.4 !important;
    color: #000000 !important;
}
body #udap-upload-feedback {
    margin-top: 10px !important;
    font-style: italic !important;
    color: #555 !important;
    font-size: 0.9em !important;
}

body .udap-fm-body {
    display: flex !important;
    flex-grow: 1 !important;
    min-height: 0 !important;
}

/* Sidebar (Folders) */
body .udap-fm-sidebar {
    width: 28% !important;
    min-width: 220px !important;
    flex-shrink: 0 !important;
    border-right: 1px solid #ddd !important;
    background-color: #f9f9f9 !important;
    display: flex !important;
    flex-direction: column !important;
}
body .sidebar-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 15px !important;
    border-bottom: 1px solid #eee !important;
    flex-shrink: 0 !important;
}
body .sidebar-header h4 { 
    margin: 0 !important; 
    font-size: 1em !important; 
    color: #000000 !important;
}
body #udap-new-folder-btn {
    background: #0073aa !important; 
    color: white !important; 
    border: none !important; 
    border-radius: 4px !important;
    width: 24px !important; 
    height: 24px !important; 
    font-weight: bold !important; 
    cursor: pointer !important; 
    font-size: 20px !important;
    line-height: 1 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
body #udap-folder-tree { 
    list-style: none !important; 
    padding: 10px !important; 
    margin: 0 !important;
    flex-grow: 1 !important;
    overflow-y: auto !important;
}
body #udap-folder-tree ul {
    list-style: none !important; 
    padding: 0 !important; 
    margin: 0 0 0 15px !important; 
}
body #udap-folder-tree li {
    padding: 0 !important;
    margin: 0 !important;
    list-style-type: none !important;
}
body #udap-folder-tree li span {
    display: block !important; 
    padding: 8px 10px !important; 
    cursor: pointer !important; 
    border-radius: 4px !important;
    white-space: nowrap !important; 
    overflow: hidden !important; 
    text-overflow: ellipsis !important;
    color: #000000 !important;
}
body #udap-folder-tree li span:hover { 
    background-color: #e9e9e9 !important; 
}
body #udap-folder-tree li.active > span { 
    background-color: #0073aa !important; 
    color: white !important; 
}
body #udap-folder-tree li.udap-unsorted-files > span {
    font-weight: bold !important;
}
body #udap-folder-tree li.udap-unsorted-files {
    border-bottom: 1px solid #eee !important;
    margin-bottom: 5px !important;
    padding-bottom: 5px !important;
}
body .sidebar-footer {
    padding: 10px !important;
    border-top: 1px solid #ddd !important;
    margin-top: auto !important;
    flex-shrink: 0 !important;
}
body #udap-show-all-files-btn {
    width: 100% !important;
    padding: 10px !important;
    background-color: #6c757d !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    text-align: center !important;
    transition: background-color 0.2s !important;
}
body #udap-show-all-files-btn:hover {
    background-color: #5a6268 !important;
}

/* Main Content (Files) */
body #udap-fm-main {
    flex-grow: 1 !important;
    padding: 0 20px 20px 20px !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}
body .main-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 0 !important;
    flex-shrink: 0 !important;
}
body #udap-breadcrumbs {
    font-size: 1.1em !important;
    font-weight: 600 !important;
    color: #000000 !important;
}
body #udap-breadcrumbs a {
    color: #0073aa !important;
    text-decoration: none !important;
}
body #udap-breadcrumbs a:hover {
    text-decoration: underline !important;
}
body #udap-breadcrumbs span.separator {
    color: #777 !important;
    margin: 0 8px !important;
    font-weight: normal !important;
}
body #udap-breadcrumbs > span {
    color: #000000 !important;
}
body .folder-actions button {
    background-color: #212529 !important; 
    color: #ffffff !important;
    border: 1px solid #212529 !important; 
    border-radius: 4px !important;
    padding: 5px 10px !important; 
    cursor: pointer !important; 
    margin-left: 5px !important;
    transition: background-color 0.2s, border-color 0.2s !important;
}
body .folder-actions button:hover {
    background-color: #495057 !important;
    border-color: #495057 !important;
}
body #udap-file-list { 
    list-style: none !important; 
    margin: 0 !important; 
    padding: 0 10px 0 0 !important; 
    flex-grow: 1 !important;
    overflow-y: auto !important;
}
body #udap-file-list .no-files {
    text-align: center !important; 
    color: #888 !important; 
    padding: 40px 20px !important; 
    background: #f9f9f9 !important; 
    border-radius: 4px !important;
}
body .udap-file-list-header {
    padding: 0 8px 8px 8px !important;
    border-bottom: 2px solid #eee !important;
    margin-bottom: 8px !important;
    list-style-type: none !important;
}
body .udap-file-item {
    background-color: #fff !important;
    border: 1px solid #e0e0e0 !important;
    padding: 8px !important;
    border-radius: 4px !important;
    margin: 0 0 8px 0 !important;
    list-style-type: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    cursor: grab !important;
}
body .udap-file-item.is-selected {
    background-color: #e7f5ff !important;
    border-color: #90caff !important;
}
body .udap-file-checkbox {
    margin-right: 12px !important;
    flex-shrink: 0 !important;
}
body #udap-file-list .udap-file-item:active { cursor: grabbing !important; box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important; }
body .file-icon { flex-shrink: 0 !important; width: 40px !important; height: 40px !important; }
body .file-icon img, body .file-icon .wp-post-image { width: 100% !important; height: 100% !important; object-fit: cover !important; border-radius: 3px !important; display: block !important; background-color: #f0f0f0 !important; }
body .file-info { flex-grow: 1 !important; min-width: 0 !important; }
body .file-info a { font-weight: 500 !important; text-decoration: none !important; color: #0073aa !important; display: block !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
body .file-info .file-meta { font-size: 0.85em !important; color: #777 !important; margin: 0 !important; padding: 0 !important; }
body .file-status { order: 2; flex-shrink: 0 !important; font-size: 0.8em !important; font-weight: bold !important; padding: 3px 8px !important; border-radius: 10px !important; color: #fff !important; white-space: nowrap !important; }
.status-completed { background-color: #28a745 !important; }
.status-in_progress { background-color: #ffc107 !important; color: #333 !important; }
.status-pending { background-color: #6c757d !important; }
.status-failed, .status-unsupported { background-color: #dc3545 !important; }
body button.udap-delete-file { order: 3; flex-shrink: 0 !important; background: #f1f1f1 !important; color: #777 !important; border: 1px solid #ccc !important; border-radius: 50% !important; width: 24px !important; height: 24px !important; font-weight: bold !important; cursor: pointer !important; line-height: 22px !important; padding: 0 !important; margin-left: 5px !important; }
body button.udap-delete-file:hover { background: #dc3545 !important; color: white !important; border-color: #c82333 !important; }
body .ui-droppable-hover { background-color: #d4edda !important; }
body #udap-folder-tree li.not-indexed > span { color: #888 !important; font-style: italic !important; }
body #udap-folder-tree li.not-indexed > span::after { content: '🚫'; font-size: 11px; margin-left: 6px; display: inline-block; opacity: 0.7; }
body .folder-actions button#udap-toggle-index-btn { background-color: #6c757d !important; border-color: #6c757d !important; color: #fff !important; }
body .folder-actions button#udap-toggle-index-btn:hover { background-color: #5a6268 !important; border-color: #545b62 !important; }
body .do-not-index-indicator { font-size: 16px !important; margin: 0 8px 0 auto !important; order: 1; flex-shrink: 0; }

/* Bulk Actions Bar */
body .main-header { gap: 15px !important; }
body #udap-breadcrumbs { flex-grow: 1 !important; }
body #udap-bulk-actions { display: flex !important; align-items: center !important; gap: 10px !important; flex-shrink: 0 !important; }
body #udap-selection-count { font-size: 0.9em !important; font-weight: bold !important; color: #555 !important; }
body #udap-move-selected-btn { background-color: #0073aa !important; color: #fff !important; border: none !important; padding: 5px 10px !important; border-radius: 4px !important; cursor: pointer !important; }

/* Move To... Modal */
body #udap-move-modal-backdrop {
    display: none; /* CORRECTED: Set to none by default. JS will toggle it. */
    position: fixed !important;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5) !important;
    z-index: 99998 !important;
    align-items: center !important;
    justify-content: center !important;
}
body #udap-move-modal { background: #fff !important; padding: 20px !important; border-radius: 8px !important; width: 90% !important; max-width: 400px !important; box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important; }
body #udap-move-modal h4 { margin-top: 0 !important; border-bottom: 1px solid #eee !important; padding-bottom: 10px !important; }
body #udap-modal-folder-tree { max-height: 250px !important; overflow-y: auto !important; border: 1px solid #ddd !important; padding: 10px !important; border-radius: 4px !important; margin-bottom: 20px !important; }
body #udap-modal-folder-tree ul,
body #udap-modal-folder-tree li { list-style: none !important; padding: 0 !important; margin: 0 !important; }
body #udap-modal-folder-tree li span { display: block !important; padding: 8px !important; border-radius: 4px !important; cursor: pointer !important; }
body #udap-modal-folder-tree li span:hover { background-color: #f0f0f0 !important; }
body #udap-modal-folder-tree li.selected > span { background-color: #0073aa !important; color: #fff !important; }
body #udap-modal-folder-tree li ul { margin-left: 15px !important; }
body .modal-actions { display: flex !important; justify-content: flex-end !important; gap: 10px !important; }

/* Multi-Drag Helper */
.udap-drag-helper { border: 1px solid #999 !important; background: #fff !important; border-radius: 8px !important; padding: 10px !important; box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important; display: flex !important; align-items: center !important; gap: 8px !important; font-weight: bold !important; }
.udap-drag-helper-count { background: #0073aa !important; color: #fff !important; border-radius: 50% !important; width: 24px !important; height: 24px !important; display: flex !important; align-items: center !important; justify-content: center !important; font-size: 12px !important; }

/* Responsive Styles */
@media (max-width: 768px) {
    body #udap-file-manager {
        width: 100% !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        height: auto !important;
        max-height: none !important;
    }
    body .udap-fm-body { flex-direction: column !important; }
    body .udap-fm-sidebar { width: 100% !important; min-width: 100% !important; border-right: none !important; border-bottom: 1px solid #ddd !important; }
    body #udap-folder-tree { max-height: 200px !important; flex-grow: 0 !important; }
    body #udap-fm-main { min-height: 50vh !important; }
}