/* Project Files Page Styles */
.project-files-content {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Statistics Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-icon.files {
    background: linear-gradient(135deg, #22c55e 0%, #eab308 100%);
}

.stat-icon.storage {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.pdf {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.stat-icon.images {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.stat-icon.documents {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.stat-icon.spreadsheets {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.stat-icon.cad {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0 0 5px 0;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

/* View Toggle */
.view-toggle-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-toggle .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* Files Grid View */
.files-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.file-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.file-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.file-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.file-icon.pdf {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.file-icon.doc {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.file-icon.xls {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.file-icon.image {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.file-icon.cad {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
}

.file-icon.other {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
    line-height: 1.3;
}

.file-meta {
    font-size: 12px;
    color: #6c757d;
}

.tag-expense {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
    padding: 2px 6px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 6px;
}

.file-details {
    margin-bottom: 15px;
}

.file-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.file-detail-label {
    color: #6c757d;
    font-weight: 500;
}

.file-detail-value {
    color: #333;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.file-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.file-action-btn.preview {
    background: #17a2b8;
    color: white;
}

.file-action-btn.preview:hover {
    background: #138496;
}

.file-action-btn.edit {
    background: #ffc107;
    color: #212529;
}

.file-action-btn.edit:hover {
    background: #e0a800;
}

.file-action-btn.download {
    background: #28a745;
    color: white;
}

.file-action-btn.download:hover {
    background: #218838;
}

.file-action-btn.delete {
    background: #dc3545;
    color: white;
}

.file-action-btn.delete:hover {
    background: #c82333;
}

/* Files List View */
.files-list-view {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* DataTable Styles - Consistent with other tables */
.files-list-view .table-container {
    padding: 20px;
    overflow-x: auto;
}

.files-list-view .dataTables_wrapper {
    font-family: inherit;
    width: 100%;
}

.files-list-view .dataTables_wrapper .dataTable {
    width: 100% !important;
    min-width: 1200px;
    table-layout: fixed;
}

.files-list-view .dataTables_wrapper .dataTables_scroll {
    overflow-x: auto;
    overflow-y: visible;
}

.files-list-view .dataTables_wrapper .dataTables_scrollHead {
    overflow: visible;
}

.files-list-view .dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto;
    overflow-y: visible;
}

.files-list-view .dataTables_wrapper .dataTables_length,
.files-list-view .dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.files-list-view .dataTables_wrapper .dataTables_length select,
.files-list-view .dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 14px;
}

.files-list-view .dataTables_wrapper .dataTables_info {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

.files-list-view .dataTables_wrapper .dataTables_paginate {
    margin-top: 15px;
}

.files-list-view .dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    margin: 0 2px;
    cursor: pointer;
    background: white;
    color: #333;
}

.files-list-view .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.files-list-view .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.files-list-view .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #6c757d;
    cursor: not-allowed;
    background: #f8f9fa;
}

/* Table Styles */
.files-list-view table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.files-list-view table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 8px;
    font-weight: 600;
    color: #333;
    text-align: left;
    vertical-align: middle;
}

.files-list-view table tbody td {
    padding: 12px 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files-list-view table tbody td.text-center {
    text-align: center;
}

.files-list-view table thead th.text-center {
    text-align: center;
}

.files-list-view table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Action Buttons in Table */
.files-list-view .file-action-btn {
    padding: 4px 8px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.files-list-view .file-action-btn.preview {
    background: #17a2b8;
    color: white;
}

.files-list-view .file-action-btn.preview:hover {
    background: #138496;
}

.files-list-view .file-action-btn.edit {
    background: #ffc107;
    color: #212529;
}

.files-list-view .file-action-btn.edit:hover {
    background: #e0a800;
}

.files-list-view .file-action-btn.download {
    background: #28a745;
    color: white;
}

.files-list-view .file-action-btn.download:hover {
    background: #218838;
}

.files-list-view .file-action-btn.delete {
    background: #dc3545;
    color: white;
}

.files-list-view .file-action-btn.delete:hover {
    background: #c82333;
}

/* File Type Badges */
.file-type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.file-type-badge.pdf {
    background: #f8d7da;
    color: #721c24;
}

.file-type-badge.doc {
    background: #d1ecf1;
    color: #0c5460;
}

.file-type-badge.xls {
    background: #d4edda;
    color: #155724;
}

.file-type-badge.image {
    background: #fff3cd;
    color: #856404;
}

.file-type-badge.cad {
    background: #e2d9f3;
    color: #5a2d91;
}

.file-type-badge.other {
    background: #f8f9fa;
    color: #6c757d;
}

/* Visibility Badge */
.visibility-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.visibility-badge.public {
    background: #d4edda;
    color: #155724;
}

.visibility-badge.private {
    background: #f8d7da;
    color: #721c24;
}

/* Linked To Badge */
.linked-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}



.linked-badge.none {
    background: #f5f5f5;
    color: #757575;
}

/* File Upload Styles */
.file-upload-container {
    position: relative;
}

.file-upload-container input[type="file"] {
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    height: 55px !important;
}

.file-upload-container input[type="file"]:hover {
    border-color: #22c55e;
    background: #f0f9ff;
}

.file-upload-container input[type="file"]:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.25);
}

.file-upload-info {
    margin-top: 8px;
}

.file-upload-info small {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Checkbox Styles */
.checkbox-group {
    margin-top: 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #22c55e;
    border-color: #22c55e;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Required Field */
.required {
    color: #dc3545;
}

/* File Preview Modal */
.modal.large .modal-content {
    max-width: 90vw;
    max-height: 90vh;
}

#filePreviewContent {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

#filePreviewContent iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 8px;
}

#filePreviewContent img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Upload Progress */
.upload-progress {
    margin-top: 15px;
    display: none;
}

.progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #eab308 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    text-align: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.empty-state p {
    margin: 0;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .files-grid-view {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .project-files-content {
        padding: 10px;
    }
    
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .files-grid-view {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .file-card {
        padding: 15px;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .file-action-btn {
        width: 100%;
        justify-content: center;
    }
}
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .file-card {
        padding: 15px;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .file-action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation for new files */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-card {
    animation: slideIn 0.3s ease;
}

/* Focus states for accessibility */
.file-action-btn:focus,
.file-card:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}
