/**
 * File Manager Style List
 * 檔案管理器風格的列表樣式
 */

/* 視圖切換按鈕 */
.view-toggle {
    display: flex;
    gap: 5px;
    background: #f0f0f0;
    padding: 3px;
    border-radius: 6px;
}

.view-toggle button {
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.view-toggle button.active {
    background: white;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-toggle button:hover:not(.active) {
    background: rgba(255,255,255,0.5);
}

/* 資料夾網格 */
.folder-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    min-width: 120px;
}

.folder-item:hover {
    background: #e9ecef;
    border-color: #4a90d9;
    transform: translateY(-1px);
}

.folder-item.active {
    background: #e3f2fd;
    border-color: #4a90d9;
    color: #1976d2;
}

.folder-icon {
    font-size: 24px;
}

.folder-info {
    display: flex;
    flex-direction: column;
}

.folder-name {
    font-weight: 500;
    font-size: 14px;
}

.folder-count {
    font-size: 11px;
    color: #888;
}

/* 列表視圖 */
.file-list {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.file-list-header {
    display: grid;
    grid-template-columns: 1fr 120px 80px 100px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.file-list-header.admin {
    grid-template-columns: 1fr 120px 80px 80px 180px;
}

.file-item {
    display: grid;
    grid-template-columns: 1fr 120px 80px 100px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.file-item.admin {
    grid-template-columns: 1fr 120px 80px 80px 180px;
}

.file-item:hover {
    background: #f8f9fa;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.file-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.file-title {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-category {
    font-size: 12px;
    color: #666;
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    text-align: center;
}

.file-fields {
    font-size: 12px;
    color: #888;
    text-align: center;
}

.file-date {
    font-size: 12px;
    color: #888;
    text-align: center;
}

.file-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.file-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.file-actions .btn-fill {
    background: #4a90d9;
    color: white;
}

.file-actions .btn-fill:hover {
    background: #3a7bc8;
}

.file-actions .btn-icon {
    padding: 6px 8px;
    background: #f0f0f0;
    color: #666;
}

.file-actions .btn-icon:hover {
    background: #e0e0e0;
}

.file-actions .btn-icon.danger:hover {
    background: #fee;
    color: #c0392b;
}

/* 圖標視圖 */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.file-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    text-align: center;
}

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

.file-grid-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.file-grid-title {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    word-break: break-word;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-grid-meta {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

/* 空狀態 */
.file-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.file-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 徽章 */
.badge-hidden {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 8px;
}

.badge-public {
    background: #d4edda;
    color: #155724;
}

.badge-private {
    background: #f8d7da;
    color: #721c24;
}

/* 響應式 */
@media (max-width: 768px) {
    .file-list-header {
        display: none;
    }
    
    .file-item {
        grid-template-columns: 1fr auto;
        gap: 10px;
    }
    
    .file-item.admin {
        grid-template-columns: 1fr auto;
    }
    
    .file-category,
    .file-fields,
    .file-date {
        display: none;
    }
    
    .folder-grid {
        gap: 8px;
    }
    
    .folder-item {
        padding: 8px 12px;
        min-width: 100px;
    }
    
    .folder-icon {
        font-size: 20px;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .file-grid-item {
        padding: 12px 8px;
    }
    
    .file-grid-icon {
        font-size: 32px;
    }
}
