/* --- Page Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
}

#open-manager-btn {
    font-size: 16px;
    padding: 10px 15px;
    cursor: pointer;
}

/* --- Modal Styles --- */
#file-manager-modal, #help-dialog, #delete-confirm-dialog, #info-dialog {
    display: none; /* Hidden by default */
}

.ui-dialog .ui-dialog-titlebar {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.ui-dialog .ui-dialog-titlebar-close {
    display: none; /* Hide default X, we use our buttons */
}

.ui-dialog .ui-dialog-content {
    padding: 0;
}

/* --- Specific Modal Content Styling --- */
#help-dialog p {
    margin: 0 0 10px 0;
}

#help-dialog ul {
    margin: 0;
    padding-left: 20px;
}

#delete-confirm-dialog p, #info-dialog p {
    padding: 10px;
    margin: 0;
    line-height: 1.5;
}

.ui-dialog .ui-dialog-content#help-dialog {
    padding: 15px; /* Give help text some padding */
}

/* --- Toolbar --- */
.modal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.modal-toolbar button, .modal-toolbar .icon-btn {
    margin-right: 8px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #fff;
    padding: 5px 10px;
    border-radius: 4px;
}

.modal-toolbar .icon-btn {
    padding: 5px 8px;
}

.modal-toolbar button:hover, .modal-toolbar .icon-btn:hover {
    background: #f0f0f0;
}

.modal-toolbar .icon-btn {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    color: #6c757d;
}

.modal-toolbar .icon-btn:hover {
    color: #000;
}

/* --- Content List --- */
.modal-content-area {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
}

#folder-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.folder-container {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    background: #fafafa;
}

.folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #eee;
    border-bottom: 1px solid #ddd;
    cursor: move; /* Handle for dragging folders */
}

.folder-name-group {
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-width: 0;
}

.folder-name {
    font-weight: bold;
    cursor: text;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edit-folder-btn {
    font-size: 0.9rem;
    color: #6c757d;
    cursor: pointer;
    margin-left: 8px;
    flex-shrink: 0;
    display: none;
}

.folder-header:hover .edit-folder-btn {
    display: inline-block;
}

.edit-folder-btn:hover {
    color: #000;
}

.rename-input {
    font-weight: bold;
    padding: 2px 4px;
    flex-grow: 1;
    min-width: 0;
}

.delete-folder-btn {
    cursor: pointer;
    border: none;
    background: transparent;
    color: #dc3545;
    font-size: 1rem;
    flex-shrink: 0;
    margin-left: 8px;
}

.delete-folder-btn:hover {
    color: #a71d2a;
}

.file-list {
    list-style-type: none;
    padding: 5px;
    margin: 0 5px 5px 5px;
    min-height: 20px;
    background: #fff;
    border-radius: 0 0 4px 4px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 3px;
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 3px;
    cursor: grab;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-order {
    font-size: 0.8rem;
    color: #888;
    width: 25px;
    text-align: right;
    padding-right: 8px;
    font-family: monospace;
}

.hazard-icon {
    color: #e67e22;
    margin-right: 8px;
    width: 16px;
}

.hazard-icon.fa-triangle-exclamation {
    cursor: pointer;
}

.file-name {
    flex-grow: 1;
    margin-right: 8px;
}

/* Toggle Number Button Styles */
.toggle-number-btn {
    cursor: pointer;
    border: none;
    background: transparent;
    color: #6c757d;
    flex-shrink: 0;
    font-size: 0.9rem;
    padding: 0 5px;
}

.toggle-number-btn:hover {
    color: #000;
}

.toggle-number-btn.numbering-disabled {
    color: #ccc;
}

.toggle-number-btn.numbering-disabled .fa-solid {
    text-decoration: line-through;
}


/* jQuery UI Sortable Placeholder */
.folder-placeholder, .file-placeholder {
    border: 2px dashed #007bff;
    background: #e6f7ff;
    visibility: visible !important;
    height: 50px;
    margin-bottom: 10px;
}

.file-placeholder {
    height: 30px;
    margin-bottom: 3px;
}

/* --- Footer --- */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 15px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.modal-footer button {
    padding: 8px 15px;
    cursor: pointer;
    margin-left: 8px;
}

#ok-btn, .ok-btn {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
}

#cancel-btn, .cancel-btn {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

/* Custom style for the jQuery UI modal overlay */
.ui-widget-overlay {
    /* Set the background color to black */
    background: #000000;
    /* Set the opacity (0.0 is fully transparent, 1.0 is fully opaque) */
    opacity: 0.7;
    /* Ensure compatibility across browsers */
    filter: Alpha(Opacity=70); /* For IE8 and earlier */
}