/* Document Viewer Modal Styles */

/* Ensure modal appears on top of everything */
#documentViewModal {
    z-index: 9999 !important;
}

#documentViewModal .modal-backdrop {
    z-index: 9998 !important;
}

/* Modal content styling */
#documentViewModal .modal-content {
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#documentViewModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#documentViewModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

#documentViewModal .modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Document content styling */
#documentViewModalBody pre {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 20px;
    margin: 0;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #212529;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Image viewer styling */
#documentViewModalBody img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* PDF viewer styling */
#documentViewModalBody iframe {
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

/* Alert styling for unsupported formats */
#documentViewModalBody .alert {
    border-radius: 5px;
    padding: 30px;
}

#documentViewModalBody .alert i.fa-3x {
    color: #667eea;
}

/* Modal footer */
#documentViewModal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #documentViewModal .modal-dialog {
        margin: 10px;
    }
    
    #documentViewModalBody {
        max-height: 60vh;
    }
    
    #documentViewModalBody pre {
        font-size: 12px;
        padding: 15px;
    }
}

/* Loading spinner */
.document-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.document-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
