/**
 * FileManager CSS
 */

.filemanager-wrap {
    max-width: 100%;
}

.filemanager-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-top: 15px;
}

/* Toolbar */
.filemanager-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-right {
    display: flex;
    align-items: center;
}

#fm-search {
    width: 250px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Breadcrumb */
.filemanager-breadcrumb {
    padding: 12px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.breadcrumb-item {
    color: #0073aa;
    text-decoration: none;
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #333;
    font-weight: 600;
}

.breadcrumb-sep {
    margin: 0 8px;
    color: #999;
}

/* File List */
.filemanager-filelist {
    padding: 0;
}

.filemanager-filelist table {
    border: none;
}

.filemanager-filelist th {
    background: #f5f5f5;
    font-weight: 600;
}

.filemanager-filelist .col-icon {
    text-align: center;
    width: 40px;
}

.filemanager-filelist .col-name {
    min-width: 200px;
}

.filemanager-filelist .col-actions {
    text-align: right;
}

.filemanager-filelist .fm-item:hover {
    background: #f0f7ff;
}

.filemanager-filelist .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #666;
}

.filemanager-filelist .dashicons-folder {
    color: #f0c33c;
}

.filemanager-filelist .dashicons-media-default {
    color: #82878c;
}

.filemanager-filelist .dashicons-image {
    color: #3eb56a;
}

.filemanager-filelist .dashicons-video {
    color: #c054ad;
}

.filemanager-filelist .dashicons-audio {
    color: #9c5dbb;
}

.filemanager-filelist .dashicons-pdf {
    color: #d93f3f;
}

.filemanager-filelist .dashicons-doc {
    color: #2f7dd1;
}

.filemanager-filelist .dashicons-spreadsheet {
    color: #2f9e44;
}

.filemanager-filelist .dashicons-archive {
    color: #9c5dbb;
}

.filemanager-filelist .dashicons-code {
    color: #00749a;
}

.filemanager-filelist .dashicons-text {
    color: #666;
}

.filemanager-filelist .fm-folder-link {
    font-weight: 500;
}

.filemanager-filelist .col-actions .button {
    margin-left: 5px;
    margin-top: 3px;
    margin-bottom: 3px;
}

.col-actions {
    white-space: nowrap;
}

.col-actions .button-small {
    padding: 0 8px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
}

.button-danger {
    color: #a00 !important;
}

.button-danger:hover {
    background: #a00 !important;
    color: #fff !important;
    border-color: #a00 !important;
}

/* Storage Info */
.filemanager-storage {
    padding: 12px 15px;
    border-top: 1px solid #eee;
    background: #f5f5f5;
    font-size: 13px;
    color: #666;
}

.filemanager-storage .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
}

/* Modal Styles */
.fm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 450px;
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.fm-modal-large {
    width: 800px;
    height: 80vh;
}

.fm-modal-small {
    width: 400px;
}

.fm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f5f5f5;
}

.fm-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.fm-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.fm-modal-close:hover {
    color: #333;
}

.fm-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.fm-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f5f5f5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Upload Area */
.fm-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fm-upload-area:hover,
.fm-upload-area.dragover {
    border-color: #0073aa;
    background: #f0f7ff;
}

.fm-upload-area .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #999;
    margin-bottom: 15px;
}

.fm-upload-area p {
    color: #666;
    margin: 0;
}

/* Progress Bar */
.fm-upload-progress {
    margin-top: 20px;
}

.fm-progress-bar {
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.fm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    width: 0%;
    transition: width 0.3s ease;
}

.fm-progress-text {
    text-align: center;
    margin: 10px 0 0;
    font-weight: 600;
    color: #0073aa;
}

/* Edit Form */
.fm-edit-info {
    margin-bottom: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 13px;
}

#fm-file-content {
    width: 100%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

/* Form Elements */
.filemanager-container input[type="text"],
.filemanager-container input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filemanager-container input[type="text"]:focus,
.filemanager-container input[type="password"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.filemanager-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

/* Notices */
#fm-notices {
    position: fixed;
    top: 50px;
    right: 20px;
    z-index: 100001;
    width: 300px;
}

.fm-notice {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.fm-notice-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.fm-notice-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.fm-notice-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Empty State */
.text-center {
    text-align: center;
    color: #999;
    padding: 40px !important;
}

/* Loading State */
.filemanager-loading {
    position: relative;
    pointer-events: none;
}

.filemanager-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 782px) {
    .filemanager-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .toolbar-left {
        flex-wrap: wrap;
    }
    
    #fm-search {
        width: 100%;
    }
    
    .toolbar-right {
        width: 100%;
    }
    
    .filemanager-filelist .col-size,
    .filemanager-filelist .col-modified,
    .filemanager-filelist .col-permissions {
        display: none;
    }
    
    .fm-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .fm-modal-large {
        width: 95%;
        height: 90vh;
    }
}