/*
 * Document Manager Pro - Enhanced Frontend Styles
 * Additional modern enhancements for the interface
 * Version: 10.0.0
 */

/* === Additional Icon Styles for Stats === */
.stat-icon {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

/* === Enhanced Filter Groups === */
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--dmp-surface);
    border: 1px solid var(--dmp-border);
    border-radius: var(--dmp-radius);
    transition: var(--dmp-transition);
}

.filter-group:hover {
    border-color: var(--dmp-primary);
    box-shadow: var(--dmp-shadow-sm);
}

.filter-group select {
    border: none;
    background: transparent;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.filter-group select:focus {
    outline: none;
    box-shadow: none;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* === Enhanced Responsive Filters === */
@media (max-width: 1024px) {
    .controls-bar {
        gap: 1rem;
    }
    
    .filters {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .filter-group {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .filter-group {
        justify-content: space-between;
        min-width: auto;
    }
    
    .filter-actions {
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* === Enhanced Document Cards with Better Animations === */
.dmp-document-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dmp-document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.dmp-document-card:hover::before {
    opacity: 1;
}

.dmp-document-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* === Enhanced Status Indicators === */
.dmp-status-active {
    position: relative;
}

.dmp-status-active::before {
    content: '●';
    color: var(--dmp-success);
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

.dmp-status-expired::before {
    content: '●';
    color: var(--dmp-danger);
    margin-left: 0.5rem;
    animation: blink 1s infinite;
}

.dmp-status-expiring_soon::before {
    content: '●';
    color: var(--dmp-warning);
    margin-left: 0.5rem;
    animation: warning 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes warning {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* === Enhanced Table with Sticky Headers === */
.table-container {
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
}

.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--dmp-background-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--dmp-primary);
}

.table-container tbody tr {
    transition: var(--dmp-transition-fast);
}

.table-container tbody tr:hover {
    background: linear-gradient(90deg, var(--dmp-surface-hover), var(--dmp-background-secondary));
    transform: scale(1.005);
}

.table-container tbody tr.selected {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border-left: 4px solid var(--dmp-primary);
}

/* === Enhanced Loading States === */
.dmp-loading {
    position: relative;
    pointer-events: none;
}

.dmp-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(59, 130, 246, 0.2), 
        transparent
    );
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* === Enhanced Form Elements === */
.dmp-tracking-fields {
    grid-column: 1 / -1;
    padding: 1.5rem;
    background: var(--dmp-background-secondary);
    border-radius: var(--dmp-radius-lg);
    border: 2px dashed var(--dmp-border);
    margin-top: 1rem;
}

.dmp-tracking-fields h4 {
    margin: 0 0 1rem 0;
    color: var(--dmp-primary);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dmp-tracking-fields h4::before {
    content: '📋';
}

/* === Enhanced File Upload Area === */
.file-input-container {
    grid-column: 1 / -1;
    padding: 2rem;
    border: 2px dashed var(--dmp-border);
    border-radius: var(--dmp-radius-lg);
    text-align: center;
    transition: var(--dmp-transition);
    background: var(--dmp-background-secondary);
}

.file-input-container:hover {
    border-color: var(--dmp-primary);
    background: var(--dmp-surface);
}

.file-input-container input[type="file"] {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--dmp-border);
    border-radius: var(--dmp-radius);
    background: var(--dmp-surface);
    width: 100%;
}

.file-input-container #fileNote {
    color: var(--dmp-text-muted);
    font-style: italic;
}

/* === Enhanced Form Buttons === */
.form-buttons {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--dmp-border-light);
}

/* === Enhanced View Switcher === */
.dmp-view-switcher {
    display: flex;
    background: var(--dmp-background-secondary);
    border-radius: var(--dmp-radius-lg);
    padding: 0.25rem;
    gap: 0.25rem;
}

.dmp-view-switcher .action-btn {
    flex: 1;
    margin: 0;
    border-radius: var(--dmp-radius);
    transition: var(--dmp-transition);
}

.dmp-view-switcher .action-btn.active {
    background: var(--dmp-primary);
    color: white;
    box-shadow: var(--dmp-shadow);
}

.dmp-view-switcher .action-btn:not(.active):hover {
    background: var(--dmp-surface);
}

/* === Enhanced Import/Export Section === */
.import-export-container {
    background: linear-gradient(135deg, var(--dmp-surface) 0%, var(--dmp-background-secondary) 100%);
}

.import-export-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.export-btn {
    background: linear-gradient(135deg, var(--dmp-success), #10b981);
    color: white;
}

.import-btn {
    background: linear-gradient(135deg, var(--dmp-info), #0ea5e9);
    color: white;
}

.import-export-section {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--dmp-surface);
    border-radius: var(--dmp-radius);
    border: 1px solid var(--dmp-border);
}

/* === Enhanced Modals === */
.dmp-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dmp-modal[style*="flex"] {
    opacity: 1;
}

.dmp-modal-content {
    background: var(--dmp-surface);
    margin: 15% auto;
    padding: 2rem;
    border-radius: var(--dmp-radius-xl);
    box-shadow: var(--dmp-shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.dmp-modal[style*="flex"] .dmp-modal-content {
    transform: scale(1);
}

.dmp-modal-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--dmp-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--dmp-transition);
}

.dmp-modal-close:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

/* === Enhanced Settings Form === */
.settings-form {
    display: grid;
    gap: 1.5rem;
}

.settings-form > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-form label {
    font-weight: 600;
    color: var(--dmp-text-primary);
}

.settings-form input[type="checkbox"] {
    margin-left: 0.5rem;
}

/* === Enhanced Scroll to Top Button === */
#scrollToTopBtn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 99;
    border: none;
    outline: none;
    background: var(--dmp-primary);
    color: white;
    cursor: pointer;
    padding: 1rem;
    border-radius: 50%;
    font-size: 1.25rem;
    box-shadow: var(--dmp-shadow-lg);
    transition: var(--dmp-transition);
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scrollToTopBtn:hover {
    background: var(--dmp-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* === Enhanced Accessibility === */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* === Enhanced Focus States === */
*:focus-visible {
    outline: 2px solid var(--dmp-primary);
    outline-offset: 2px;
    border-radius: var(--dmp-radius);
}

/* === Enhanced Tooltip System === */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dmp-text-primary);
    color: var(--dmp-background);
    padding: 0.5rem 1rem;
    border-radius: var(--dmp-radius);
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.9;
    animation: fadeIn 0.2s ease-out;
}

[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    border: 4px solid transparent;
    border-top-color: var(--dmp-text-primary);
    z-index: 1000;
    pointer-events: none;
}

/* === Print Optimizations === */
@media print {
    .dmp-frontend-manager-wrapper {
        background: white !important;
        color: black !important;
    }
    
    .stat-item,
    .dmp-document-card,
    .section-container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .action-btn,
    .dmp-modal,
    #scrollToTopBtn {
        display: none !important;
    }
    
    .table-container {
        overflow: visible !important;
        max-height: none !important;
    }
}

/* === High Contrast Mode Support === */
@media (prefers-contrast: high) {
    :root {
        --dmp-border: #000000;
        --dmp-text-primary: #000000;
        --dmp-text-secondary: #333333;
    }
    
    [data-theme="dark"] {
        --dmp-border: #ffffff;
        --dmp-text-primary: #ffffff;
        --dmp-text-secondary: #cccccc;
    }
}

/* === Reduced Motion Support === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* === Enhanced Card Overlay and Interactions === */
.dmp-card-checkbox-container {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 5;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: var(--dmp-transition);
}

.dmp-card-checkbox-container:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.dmp-card-checkbox-container input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
}

.dmp-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--dmp-transition);
    cursor: pointer;
}

.dmp-card-thumbnail:hover .dmp-card-overlay {
    opacity: 1;
}

.dmp-quick-view-text {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* === Enhanced Card Meta Rows === */
.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--dmp-border-light);
}

.meta-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.meta-row strong {
    color: var(--dmp-text-primary);
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 0.5rem;
    font-size: 0.875rem;
}

.meta-row span {
    color: var(--dmp-text-secondary);
    text-align: left;
    font-size: 0.875rem;
}

.status-row .dmp-status-active,
.status-row .dmp-status-expired,
.status-row .dmp-status-expiring_soon {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--dmp-radius);
    font-size: 0.75rem;
}

.status-row .dmp-status-active {
    background: rgba(5, 150, 105, 0.1);
    color: var(--dmp-success);
}

.status-row .dmp-status-expired {
    background: rgba(220, 38, 38, 0.1);
    color: var(--dmp-danger);
}

.status-row .dmp-status-expiring_soon {
    background: rgba(217, 119, 6, 0.1);
    color: var(--dmp-warning);
}

/* === Enhanced File Download Link === */
.file-download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--dmp-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--dmp-transition);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-download-link:hover {
    color: var(--dmp-primary-dark);
    text-decoration: underline;
}

.file-download-link .dashicons {
    font-size: 1rem;
    flex-shrink: 0;
}

/* === Enhanced Card Actions === */
.dmp-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.dmp-card-actions .button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--dmp-radius);
    transition: var(--dmp-transition);
}

.edit-doc-btn {
    background: linear-gradient(135deg, var(--dmp-info), #0ea5e9);
    color: white;
    border: none;
}

.edit-doc-btn:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    transform: translateY(-1px);
}

.delete-doc-btn {
    background: linear-gradient(135deg, var(--dmp-danger), #ef4444);
    color: white;
    border: none;
}

.delete-doc-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

.view-doc-btn {
    background: linear-gradient(135deg, var(--dmp-secondary), #6b7280);
    color: white;
    border: none;
}

.view-doc-btn:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-1px);
}

/* === Responsive Card Improvements === */
@media (max-width: 768px) {
    .meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .meta-row strong {
        margin-left: 0;
    }
    
    .dmp-card-actions {
        flex-direction: column;
    }
    
    .dmp-card-actions .button {
        justify-content: flex-start;
    }
}

/* === Card Focus States for Accessibility === */
.dmp-document-card:focus {
    outline: 2px solid var(--dmp-primary);
    outline-offset: 2px;
}

.dmp-document-card:focus-within {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* === Card Selection State === */
.dmp-document-card.selected {
    border-color: var(--dmp-primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0.02));
    transform: translateY(-2px);
    box-shadow: var(--dmp-shadow-md);
}

.dmp-document-card.selected .dmp-card-file-number-badge {
    background: var(--dmp-primary-light);
}

/* === Enhanced File Icons === */
.dmp-file-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: var(--dmp-transition);
}

.dmp-card-thumbnail:hover .dmp-file-icon {
    transform: scale(1.1);
}

.dmp-file-icon-pdf {
    color: #dc2626;
}

.dmp-file-icon-none {
    color: var(--dmp-text-muted);
    opacity: 0.6;
}

/* === Loading Lazy Images === */
.dmp-card-thumbnail img {
    transition: var(--dmp-transition);
    background: var(--dmp-background-secondary);
}

.dmp-card-thumbnail img[loading="lazy"] {
    opacity: 0;
}

.dmp-card-thumbnail img[loading="lazy"].loaded {
    opacity: 1;
}

/* === Enhanced Animations for Card Interactions === */
@keyframes cardPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1.02); }
}

.dmp-document-card:active {
    animation: cardPop 0.2s ease-out;
}

/* === Improved Print Styles for Cards === */
@media print {
    .dmp-document-card {
        break-inside: avoid;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        margin-bottom: 1rem;
        transform: none !important;
    }
    
    .dmp-card-overlay,
    .dmp-card-actions,
    .dmp-card-checkbox-container {
        display: none !important;
    }
    
    .dmp-card-content {
        padding: 1rem !important;
    }
    
    .meta-row {
        border-bottom: 1px solid #eee !important;
    }
}

/* === PDF Preview Modal === */
.dmp-pdf-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--dmp-transition);
}

.dmp-pdf-preview-modal.show {
    opacity: 1;
    visibility: visible;
}

.dmp-pdf-preview-container {
    width: 90%;
    height: 90%;
    max-width: 1200px;
    background: var(--dmp-surface);
    border-radius: var(--dmp-radius-lg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--dmp-shadow-lg);
}

.dmp-pdf-preview-header {
    padding: 1rem 1.5rem;
    background: var(--dmp-background-secondary);
    border-bottom: 1px solid var(--dmp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dmp-pdf-preview-title {
    font-weight: 600;
    color: var(--dmp-text-primary);
    margin: 0;
    font-size: 1.125rem;
}

.dmp-pdf-preview-close {
    background: var(--dmp-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--dmp-transition);
}

.dmp-pdf-preview-close:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.dmp-pdf-preview-content {
    flex: 1;
    padding: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dmp-pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--dmp-radius);
    background: #f5f5f5;
}

.dmp-pdf-fallback {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--dmp-text-secondary);
}

.dmp-pdf-fallback .dashicons {
    font-size: 4rem;
    color: var(--dmp-danger);
    margin-bottom: 1rem;
}

.dmp-pdf-download-link {
    background: var(--dmp-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--dmp-radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    transition: var(--dmp-transition);
}

.dmp-pdf-download-link:hover {
    background: var(--dmp-primary-dark);
    transform: translateY(-1px);
}

/* === Enhanced Card Thumbnail for PDF Preview === */
.dmp-card-thumbnail.has-pdf {
    cursor: pointer;
    position: relative;
}

.dmp-card-thumbnail.has-pdf::after {
    content: '👁️ معاينة';
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--dmp-radius);
    font-size: 0.75rem;
    opacity: 0;
    transition: var(--dmp-transition);
    pointer-events: none;
}

.dmp-card-thumbnail.has-pdf:hover::after {
    opacity: 1;
}

/* === Loading State for PDF Viewer === */
.dmp-pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dmp-text-secondary);
    font-size: 1.125rem;
}

.dmp-pdf-loading .dashicons {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === Responsive PDF Preview === */
@media (max-width: 768px) {
    .dmp-pdf-preview-container {
        width: 95%;
        height: 95%;
    }
    
    .dmp-pdf-preview-header {
        padding: 0.75rem 1rem;
    }
    
    .dmp-pdf-preview-title {
        font-size: 1rem;
        max-width: 70%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .dmp-pdf-preview-close {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
}

/* نموذج معاينة PDF */
.pdf-preview-modal .dmp-modal-content {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--dmp-border-color, #ddd);
    background: var(--dmp-bg-secondary, #f8f9fa);
}

.pdf-modal-header h3 {
    margin: 0;
    color: var(--dmp-text-color, #333);
    font-size: 1.2em;
}

.pdf-modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pdf-preview-container {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: #f5f5f5;
}

.pdf-preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--dmp-text-secondary, #666);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--dmp-border-color, #ddd);
    border-top: 4px solid var(--dmp-primary-color, #007acc);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pdf-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--dmp-text-secondary, #666);
}

.pdf-error .error-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.pdf-error h4 {
    margin: 0 0 10px 0;
    color: var(--dmp-error-color, #dc3545);
}

.pdf-error p {
    margin: 0 0 20px 0;
    color: var(--dmp-text-secondary, #666);
}

/* تحسينات responsive لنموذج PDF */
@media (max-width: 768px) {
    .pdf-preview-modal .dmp-modal-content {
        width: 98%;
        height: 95vh;
        margin: 2.5vh auto;
    }
    
    .pdf-modal-header {
        padding: 15px;
    }
    
    .pdf-modal-header h3 {
        font-size: 1.1em;
    }
    
    .pdf-error {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .pdf-preview-modal .dmp-modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .pdf-modal-header {
        padding: 10px 15px;
    }
}

/* تحسينات عرض الملفات في الجدول */
.file-actions-table {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.file-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--dmp-border-color, #ccc);
    background: var(--dmp-bg-color, #fff);
    color: var(--dmp-text-color, #333);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 14px;
}

.file-action-btn:hover {
    background: var(--dmp-primary-color, #007acc);
    color: #fff;
    border-color: var(--dmp-primary-color, #007acc);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-action-btn .dashicons {
    font-size: 16px;
    line-height: 1;
}

.pdf-preview-btn {
    color: #d63031;
    border-color: #d63031;
}

.pdf-preview-btn:hover {
    background: #d63031;
    color: #fff;
}

.download-btn {
    color: var(--dmp-success-color, #00a65a);
    border-color: var(--dmp-success-color, #00a65a);
}

.download-btn:hover {
    background: var(--dmp-success-color, #00a65a);
    color: #fff;
}

/* تحسينات responsive للجدول */
@media (max-width: 768px) {
    .file-actions-table {
        flex-direction: column;
        gap: 3px;
    }
    
    .file-action-btn {
        width: 28px;
        height: 28px;
    }
    
    .file-action-btn .dashicons {
        font-size: 14px;
    }
}

/* تصميم رسالة عدم وجود مستندات */
.dmp-no-documents-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--dmp-bg-color, #fff);
    border-radius: var(--dmp-radius, 8px);
    border: 2px dashed var(--dmp-border-color, #ddd);
    margin: 20px 0;
}

.no-docs-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.dmp-no-documents-message h3 {
    color: var(--dmp-text-secondary, #666);
    margin: 0 0 20px 0;
    font-size: 1.2em;
    font-weight: 500;
}

.debug-info {
    background: var(--dmp-bg-secondary, #f8f9fa);
    border: 1px solid var(--dmp-border-color, #ddd);
    border-radius: var(--dmp-radius, 6px);
    padding: 15px;
    margin: 20px 0;
    text-align: right;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.debug-info p {
    margin: 0 0 10px 0;
    color: var(--dmp-text-color, #333);
    font-size: 0.9em;
}

.debug-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.debug-info li {
    padding: 5px 0;
    color: var(--dmp-text-secondary, #666);
    font-size: 0.85em;
    border-bottom: 1px solid var(--dmp-border-light, #eee);
}

.debug-info li:last-child {
    border-bottom: none;
}

.no-docs-actions {
    margin: 30px 0 20px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.no-docs-actions .action-btn {
    padding: 12px 20px;
    border-radius: var(--dmp-radius, 6px);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.no-docs-actions .action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-hint {
    margin-top: 20px;
    padding: 15px;
    background: var(--dmp-warning-bg, #fff3cd);
    border: 1px solid var(--dmp-warning-border, #ffeaa7);
    border-radius: var(--dmp-radius, 6px);
    color: var(--dmp-warning-text, #856404);
    font-size: 0.9em;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.stats-hint p {
    margin: 0;
    line-height: 1.4;
}

/* تحسينات responsive */
@media (max-width: 768px) {
    .dmp-no-documents-message {
        padding: 40px 15px;
        margin: 15px 0;
    }
    
    .no-docs-icon {
        font-size: 3em;
        margin-bottom: 15px;
    }
    
    .no-docs-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .no-docs-actions .action-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .debug-info {
        margin: 15px 0;
        padding: 12px;
        max-width: 100%;
    }
}

/* تصميم رسالة عدم وجود مستندات في الجدول */
.table-no-documents {
    padding: 40px 20px;
}

.table-no-documents .no-docs-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.table-no-documents h4 {
    color: var(--dmp-text-secondary, #666);
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 500;
}

.table-no-documents p {
    margin: 10px 0;
    font-size: 0.9em;
}

.table-no-documents .button {
    margin-top: 15px;
    padding: 8px 16px;
    border-radius: var(--dmp-radius, 4px);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
