/* Media File Manager Styles */
.media-file-manager {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.media-manager-container {
    display: flex;
    gap: 20px;
    min-height: 500px;
}

/* Left Side - Folder Structure */
.folder-structure {
    flex: 0 0 300px;
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.folder-structure h3 {
    margin: 0 0 15px 0;
    color: #000;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #0076BF;
}

.folder-tree {
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
}

.folder-tree ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.folder-tree .level-0 {
    padding-left: 0;
}

.folder-tree ul ul {
    padding-left: 20px;
    border-left: 1px solid #e1e5e9;
    margin-left: 10px;
}

.folder-item {
    margin: 2px 0;
}

.folder-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

.folder-label:hover {
    background-color: #f1f3f4;
}

.folder-item.active>.folder-label {
    background-color: #0076BF;
    color: white;
}

.folder-item .folder-icon {
    color: #0076BF;
}

.folder-item.active>.folder-label>.folder-icon {
    color: #fff;
}

#current-category-title .fa-folder-open,
#current-category-title .fa-folder-closed,
.no-files-message .fa-folder-open,
.no-files-message .fa-info-circle,
.folder-structure h3 .fa-folder-tree {
    color: #0274ba;
}

.folder-toggle {
    width: 16px;
    text-align: center;
    margin-right: 5px;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.folder-toggle.no-arrow {
    color: transparent;
}

.folder-icon {
    margin-right: 8px;
    font-size: 14px;
}

.folder-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.file-count {
    font-size: 12px;
    color: #666;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

.folder-item.active>.folder-label>.file-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.subfolder-container {
    overflow: hidden;
}

/* Right Side - Media Files */
.media-files-section {
    flex: 1;
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.media-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0076BF;
}

.media-files-header h3 {
    margin: 0;
    color: #000;
    font-size: 18px;
    font-weight: 600;
}

.selection-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.selection-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.download-btn {
    background: #0076BF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.download-btn:hover:not(:disabled) {
    background: #005a94;
    transform: translateY(-1px);
}

.download-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Media Files Grid */
.media-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.media-file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: #fafbfc;
    transition: all 0.2s ease;
}

.media-file-item:hover {
    border-color: #0076BF;
    background: #f8f9ff;
    box-shadow: 0 2px 8px rgba(0, 118, 191, 0.1);
}

.file-checkbox {
    margin-right: 12px;
}

.file-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.file-icon {
    font-size: 24px;
    margin-right: 12px;
    opacity: 0.8;
}

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.file-title {
    font-weight: 500;
    font-size: 14px;
    color: #000;
    margin-bottom: 4px;
    overflow-wrap: break-word;
    /* white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; */
}

.file-meta-action {
    display: flex;
    justify-content: space-between;
    height: 24px;
}

.file-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.file-meta-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.file-size {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
}

.file-extension {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.file-actions {
    margin-left: 0px;
}

.file-actions>a {
    color: #fff !important;
    font-size: 12px !important;
}

.download-single {
    background: #0076BF;
    color: white;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.download-single:hover {
    background: #005a94;
    text-decoration: none;
    font-weight: 500 !important;
    transform: translateY(-1px);
}

/* Loading and Messages */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.loading-spinner:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0076BF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.no-files-message {
    text-align: left;
    font-size: 16px;
    position: absolute;
    width: 100%;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
    font-size: 16px;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 9999;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease;
}

.notification-success {
    background-color: #0076BF;
}

.notification-error {
    background-color: #dc3545;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Custom Scrollbars */
.folder-tree::-webkit-scrollbar,
.media-files-grid::-webkit-scrollbar {
    width: 8px;
}

.folder-tree::-webkit-scrollbar-track,
.media-files-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.folder-tree::-webkit-scrollbar-thumb,
.media-files-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.folder-tree::-webkit-scrollbar-thumb:hover,
.media-files-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .media-manager-container {
        flex-direction: column;
        gap: 15px;
    }

    .folder-structure {
        flex: none;
        max-height: 300px;
        overflow-y: auto;
    }

    .media-files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .selection-controls {
        width: 100%;
        justify-content: space-between;
    }

    .media-files-grid {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .media-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .file-info {
        width: 100%;
    }

    .file-actions {
        margin-left: 0;
    }

    .download-single {
        padding: 3px 8px;
    }

    .no-files-message {
        position: relative;
    }
}

@media (max-width: 480px) {
    .media-file-manager {
        padding: 10px;
    }

    .folder-structure,
    .media-files-section {
        padding: 15px;
    }

    .folder-structure h3,
    .media-files-header h3 {
        font-size: 16px;
    }

    .download-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .media-file-manager {
        box-shadow: none;
        background: white;
    }

    .file-checkbox,
    .file-actions,
    .selection-controls,
    .download-btn {
        display: none;
    }

    .media-file-item {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}