/**
 * Entity Document Management Styles
 * أنماط إدارة وثائق الكيانات
 */

/* Entity Document Page Layout */
.entity-document-page {
    padding: 1rem;
    direction: rtl;
    text-align: right;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    margin-bottom: 1.5rem;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--bs-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--bs-secondary);
}

/* Entity Header */
.entity-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.entity-info-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.entity-avatar {
    width: 80px;
    height: 80px;
    background: var(--bs-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.entity-details h2 {
    margin: 0 0 0.5rem 0;
    color: var(--bs-dark);
}

.entity-type {
    color: var(--bs-secondary);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.entity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

.entity-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* File Management Container */
.file-management-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* File Toolbar */
.file-toolbar {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-toggle {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle .btn {
    border-radius: 0;
    border-left: none;
}

.view-toggle .btn:first-child {
    border-left: 1px solid #dee2e6;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bs-primary);
    color: white;
    border-radius: 6px;
}

.selected-count {
    font-weight: 600;
}

.search-filter-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-filter-group .input-group {
    min-width: 250px;
}

.search-filter-group .form-select {
    min-width: 150px;
}

/* File Upload Zone */
.file-upload-zone {
    padding: 2rem;
    border-bottom: 1px solid #dee2e6;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.05);
}

.upload-icon {
    color: var(--bs-primary);
    margin-bottom: 1rem;
}

.upload-area h4 {
    color: var(--bs-dark);
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--bs-secondary);
    margin-bottom: 1.5rem;
}

.upload-area input[type="file"] {
    display: none;
}

/* Upload Progress */
.upload-progress {
    margin-top: 2rem;
}

.upload-progress-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.file-name {
    font-weight: 600;
    color: var(--bs-dark);
}

.file-size {
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

.progress-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.progress-status.success {
    color: var(--bs-success);
}

.progress-status.error {
    color: var(--bs-danger);
}

/* Files Display Area */
.files-display-area {
    padding: 2rem;
    min-height: 400px;
}

/* Documents Grid View */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.document-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.document-card.selected {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.25);
}

.card-header {
    padding: 1rem;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-checkbox {
    margin-left: 0.5rem;
}

.card-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.document-card:hover .card-actions {
    opacity: 1;
}

.card-body {
    padding: 1.5rem;
    text-align: center;
}

.file-icon {
    margin-bottom: 1rem;
}

.file-name {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--bs-dark);
    line-height: 1.4;
}

.file-details {
    margin-bottom: 1rem;
}

.file-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.file-meta {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

/* Documents List View */
.documents-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.list-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.list-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.document-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.3s ease;
}

.document-list-item:hover {
    background: #f8f9fa;
}

.document-list-item.selected {
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.item-checkbox {
    margin-left: 1rem;
}

.item-icon {
    margin-left: 1rem;
    font-size: 1.5rem;
}

.item-info {
    flex: 1;
    margin-left: 1rem;
}

.item-name {
    font-weight: 600;
    color: var(--bs-dark);
    margin-bottom: 0.25rem;
}

.item-details {
    display: flex;
    gap: 1rem;
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

.detail-item {
    white-space: nowrap;
}

.item-status {
    margin-left: 1rem;
}

.item-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--bs-secondary);
}

.empty-icon {
    margin-bottom: 2rem;
}

.empty-state h4 {
    margin-bottom: 1rem;
    color: var(--bs-dark);
}

.empty-state p {
    margin-bottom: 2rem;
}

/* Loading and Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-text {
    margin-top: 1rem;
    color: var(--bs-secondary);
}

.error-state i {
    margin-bottom: 1rem;
}

.error-state h4 {
    color: var(--bs-danger);
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .entity-header {
        flex-direction: column;
        text-align: center;
    }
    
    .entity-info-header {
        flex-direction: column;
        text-align: center;
    }
    
    .entity-meta {
        justify-content: center;
    }
    
    .file-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        justify-content: center;
    }
    
    .search-filter-group {
        flex-direction: column;
    }
    
    .search-filter-group .input-group,
    .search-filter-group .form-select {
        min-width: auto;
        width: 100%;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .item-details {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .item-actions {
        flex-direction: column;
    }
}

/* RTL Enhancements */
.entity-document-page * {
    direction: rtl;
}

.entity-document-page .btn-group {
    direction: ltr;
}

.entity-document-page .progress {
    direction: ltr;
}
