﻿/* ============================================================================
   FILE MANAGER - Finder/Explorer Style
   Integrated with xDocket Design Language
   ============================================================================ */

/* Toolbar (like Finder/Explorer top bar) */
.file-manager-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem 0.75rem 0 0;
    gap: 1rem;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .toolbar-btn:hover:not(:disabled) {
        background: #e9ecef;
        border-color: #ced4da;
    }

    .toolbar-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.toolbar-btn-primary {
    background: #007AFF;
    border-color: #007AFF;
    color: #fff;
}

    .toolbar-btn-primary:hover {
        background: #0056b3;
        border-color: #0056b3;
    }

.toolbar-btn i {
    font-size: 18px;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #dee2e6;
    margin: 0 0.25rem;
}

/* Folder Path Bar (like address bar) */
.folder-path-bar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    min-width: 250px;
    max-width: 500px;
    overflow-x: auto;
    white-space: nowrap;
}

    .folder-path-bar::-webkit-scrollbar {
        height: 4px;
    }

    .folder-path-bar::-webkit-scrollbar-thumb {
        background: #cbd5e0;
        border-radius: 2px;
    }

.path-segment {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

    .path-segment:hover {
        background: #e9ecef;
    }

    .path-segment.root {
        font-weight: 600;
        color: #212529;
    }

    .path-segment i {
        font-size: 16px;
    }

.path-separator {
    color: #adb5bd;
    font-size: 12px;
    margin: 0 0.125rem;
}

.view-toggle-group {
    display: flex;
    gap: 2px;
}

    .view-toggle-group .btn-check {
        display: none;
    }

        .view-toggle-group .btn-check:checked + .toolbar-btn {
            background: #007AFF;
            border-color: #007AFF;
            color: #fff;
        }

/* File Manager Content Area */
.file-manager-content {
    background: #fff;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    padding: 1rem;
}

/* Grid View */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.document-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .document-item:hover {
        background: #f8f9fa;
    }

    .document-item.dragging {
        opacity: 0.5;
        cursor: grabbing;
    }

    .document-item.drag-over {
        background: #e7f3ff;
        border: 2px dashed #007AFF;
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
        transition: all 0.2s ease;
    }

        .document-item.drag-over .folder-icon {
            color: #007AFF;
            animation: pulse 0.6s ease-in-out infinite;
        }

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.document-icon-wrapper {
    margin-bottom: 0.5rem;
}

.folder-icon {
    font-size: 48px;
    color: #007AFF;
}

.file-icon {
    font-size: 48px;
    color: #6c757d;
}

.document-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    gap: 0.25rem;
}

.document-name {
    font-size: 13px;
    font-weight: 500;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.document-size {
    font-size: 11px;
    color: #6c757d;
}

.document-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.document-item:hover .document-actions {
    opacity: 1;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .action-btn:hover {
        background: #fff;
        color: #007AFF;
        border-color: #007AFF;
    }

    .action-btn i {
        font-size: 14px;
    }

/* List View */
.documents-list {
    width: 100%;
}

.documents-table {
    width: 100%;
    font-size: 13px;
}

    .documents-table thead {
        background: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
    }

    .documents-table th {
        padding: 0.75rem 1rem;
        text-align: left;
        font-weight: 600;
        color: #495057;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .documents-table tbody tr {
        border-bottom: 1px solid #f0f2f5;
        transition: background 0.15s ease;
    }

        .documents-table tbody tr:hover {
            background: #f8f9fa;
        }

    .documents-table td {
        padding: 0.75rem 1rem;
    }

.col-name {
    width: 50%;
}

.col-size {
    width: 15%;
}

.col-date {
    width: 20%;
}

.col-actions {
    width: 15%;
    text-align: right;
}

.folder-icon-sm,
.file-icon-sm {
    font-size: 20px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.action-btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    margin-left: 0.25rem;
}

    .action-btn-sm:hover {
        background: #e9ecef;
        color: #007AFF;
    }

/* Status Bar (like Finder/Explorer bottom bar) */
.file-manager-statusbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    font-size: 12px;
    color: #6c757d;
}

.statusbar-text {
    font-weight: 500;
}

.statusbar-separator {
    color: #dee2e6;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

    .empty-state i {
        font-size: 64px;
        color: #dee2e6;
        margin-bottom: 1rem;
    }

    .empty-state p {
        color: #6c757d;
        font-size: 15px;
        margin-bottom: 1.5rem;
    }

/* Responsive */
@media (max-width: 768px) {
    .file-manager-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .folder-path-bar {
        order: 3;
        flex-basis: 100%;
    }

    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }

    .document-name {
        font-size: 12px;
    }

    .folder-icon,
    .file-icon {
        font-size: 40px;
    }
}

@media (max-width: 576px) {
    .toolbar-btn span {
        display: none;
    }

    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
