/* file: assets/css/file-explorer.css */
/* ============================================
FILE EXPLORER STYLES
============================================ */

/* File Explorer Container */
.file-explorer-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f8f9fa;
}

.explorer-navbar {
    padding: 8px 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
}

.explorer-main {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

/* Sidebar */
.explorer-sidebar {
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 16px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-section {
    margin-bottom: 16px;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 8px;
}

/* Folder Tree */
.folder-tree {
    font-size: 14px;
}

.folder-tree-item {
    margin-bottom: 2px;
}

.folder-tree-row {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.folder-tree-row:hover {
    background-color: #e9ecef;
}

.folder-tree-row.active {
    background-color: #e7f1ff;
}

.tree-indent {
    width: 16px;
    flex-shrink: 0;
}

.tree-toggle {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    padding: 0;
    margin-right: 4px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tree-toggle-placeholder {
    width: 20px;
    margin-right: 4px;
}

.folder-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-tree-children {
    margin-left: 24px;
}

/* Main Content */
.explorer-content {
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 16px;
}

/* File Toolbar */
.file-toolbar {
    background: white;
    padding: 8px 16px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Address Bar */
.address-bar {
    background: white;
    padding: 8px 16px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Contents Grid */
.contents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

.file-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #4285f4;
}

.file-icon {
    margin-bottom: 8px;
}

.file-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    word-break: break-word;
}

.file-details {
    font-size: 12px;
    color: #6c757d;
}

.file-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-item:hover .file-actions {
    opacity: 1;
}

/* Context Menu */
.context-menu {
    position: fixed;
    z-index: 9999;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    display: none;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.context-menu-item:hover {
    background-color: #f8f9fa;
}

.context-menu-divider {
    height: 1px;
    background-color: #dee2e6;
    margin: 4px 0;
}

/* Color Picker */
.color-picker {
    margin: 8px 0;
}

.color-option {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.color-option:hover {
    background-color: #f8f9fa;
}

.color-option.selected {
    background-color: #e7f1ff;
    border: 2px solid #4285f4;
}

.color-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid #dee2e6;
}

.color-name {
    font-size: 11px;
    color: #6c757d;
}

/* Status Bar */
.status-bar {
    font-size: 12px;
    color: #6c757d;
    background: white;
    padding: 8px 16px;
    border-radius: 6px;
}

/* Cut/Copy Visual */
.cut-item {
    opacity: 0.6;
    position: relative;
}

.cut-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(220, 53, 69, 0.1) 10px,
        rgba(220, 53, 69, 0.1) 20px
    );
    pointer-events: none;
    border-radius: inherit;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    padding: 48px 16px;
}

/* Responsive */
@media (max-width: 992px) {
    .explorer-sidebar {
        position: fixed;
        left: -280px;
        top: 56px;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .explorer-sidebar.show {
        left: 0;
    }
    
    .explorer-content {
        margin-left: 0;
    }
    
    .contents-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    .contents-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .file-toolbar .btn-group {
        flex-wrap: wrap;
        margin-bottom: 4px;
    }
    
    .file-toolbar .btn-group .btn {
        margin-bottom: 4px;
    }
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 4px 0;
    min-width: 200px;
    z-index: 10000;
    display: none;
    font-size: 14px;
}

.context-menu-visible {
    display: block !important;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.context-menu-item:hover {
    background-color: #f8f9fa;
}

.context-menu-item.context-menu-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.context-menu-item.context-menu-disabled:hover {
    background-color: transparent;
}

.context-menu-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 4px 0;
}

/* Selection Styling */
.file-item.selected {
    background-color: rgba(0, 123, 255, 0.1) !important;
    border-color: rgba(0, 123, 255, 0.3) !important;
}

.file-item.cut-item {
    opacity: 0.6;
}

/* Rename Input */
.rename-input {
    border: 2px solid #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.loading-text {
    color: #6c757d;
    font-size: 14px;
}

/* Properties Modal */
.properties-container {
    max-height: 60vh;
    overflow-y: auto;
}

.property-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.property-section:last-child {
    border-bottom: none;
}

.property-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.property-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
}

.property-label {
    width: 120px;
    font-weight: 500;
    color: #6c757d;
    flex-shrink: 0;
}

.property-value {
    color: #212529;
    word-break: break-word;
}

.property-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Toast Container */
.toast-container {
    z-index: 9999;
}

/* Right-click preview */
.file-preview {
    cursor: pointer;
    transition: transform 0.2s;
}

.file-preview:hover {
    transform: scale(1.02);
}

/* Toolbar Styles */
.file-toolbar {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #e9ecef;
}

/* Address Bar */
.address-bar .form-control {
    font-family: monospace;
    font-size: 14px;
}

/* Status Bar */
.status-bar {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 8px 12px;
}

