@extends('admin.admin_master')

@push('styles')
<link rel="stylesheet" href="{{ asset('assets/css/folder-management.css') }}">
@endpush

@section('admin')
<div class="page-content">
    <div class="container-fluid">
        <div class="row mb-4">
            <div class="col-12">
                <div class="page-header-card" style="background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%); border: 2px solid #e3f2fd; border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 102, 204, 0.1);">
                    <div class="page-header-content" style="padding: 20px;">
                        <div class="d-flex align-items-center justify-content-between">
                            <div class="d-flex align-items-center">
                                <div class="page-icon me-3">
                                    <div class="avatar-md">
                                        <div class="avatar-title bg-primary-subtle text-primary rounded-circle">
                                            <i class="ri-file-list-3-line font-size-24"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="flex-grow-1">
                                    <h4 class="page-title mb-1">File Management</h4>
                                    <nav aria-label="breadcrumb">
                                        <ol class="breadcrumb mb-0">
                                            <li class="breadcrumb-item">
                                                <i class="ri-file-list-3-line me-1"></i>File Mgt
                                            </li>
                                        </ol>
                                    </nav>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Add your file management UI and logic here, similar to my_folder.blade.php -->
        <div class="row mb-3">
            <div class="col-12">
                <div class="d-flex justify-content-between align-items-center">
                    <div class="d-flex gap-2">
                        <button type="button" class="btn btn-outline-secondary btn-sm" onclick="location.reload()" data-bs-toggle="tooltip" title="Refresh Files">
                            <i class="ri-refresh-line font-size-12"></i>
                        </button>
                        <button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#addFileModal">
                            <i class="ri-file-add-line font-size-12 me-1"></i>Add File
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <!-- Example: File Table (customize as needed) -->
        <div class="row">
            <div class="col-12">
                <div class="card shadow-sm border-0">
                    <div class="card-body p-4">
                        <div class="table-responsive">
                            <table class="table table-hover align-middle">
                                <thead class="table-light">
                                    <tr>
                                        <th>Name</th>
                                        <th>Type</th>
                                        <th>Size</th>
                                        <th>Modified</th>
                                        <th>Actions</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <!-- Example row, replace with dynamic data -->
                                    <tr>
                                        <td>Example.pdf</td>
                                        <td>PDF</td>
                                        <td>1.2 MB</td>
                                        <td>2026-03-10</td>
                                        <td>
                                            <button class="btn btn-info btn-sm">View</button>
                                            <button class="btn btn-warning btn-sm">Rename</button>
                                            <button class="btn btn-danger btn-sm">Delete</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Add File Modal (example, customize as needed) -->
        <div class="modal fade" id="addFileModal" tabindex="-1" aria-labelledby="addFileModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content border-0 shadow">
                    <div class="modal-header modal-header-primary d-flex justify-content-between align-items-center">
                        <h5 class="modal-title mb-0" id="addFileModalLabel">
                            <i class="ri-file-add-line me-2"></i>Upload File
                        </h5>
                        <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
                    </div>
                    <form id="addFileForm" enctype="multipart/form-data">
                        <div class="modal-body">
                            <div class="mb-3">
                                <label for="fileUpload" class="form-label">Select File <span class="text-danger">*</span></label>
                                <input type="file" class="form-control" id="fileUpload" name="file" required>
                            </div>
                        </div>
                        <div class="modal-footer border-top">
                            <button type="submit" class="btn btn-success px-4">
                                <i class="ri-upload-line me-1"></i>Upload
                            </button>
                            <button type="button" class="btn btn-secondary px-4" data-bs-dismiss="modal">Cancel</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
