/* Prisma Document Library Styles */

.hdv-library {
    margin: 30px 0;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Controls */
.hdv-library-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 15px;
}

.hdv-library-sort label {
    margin-right: 10px;
    font-weight: 600;
    color: #333;
}

.hdv-sort-select,
.hdv-search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.hdv-search-input {
    width: 250px;
}

/* Table */
.hdv-documents-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: auto;
}

.hdv-documents-table thead {
    background: #f8f9fa;
}

.hdv-documents-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.hdv-documents-table td {
    padding: 15px 10px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.hdv-document-row {
    transition: background 0.2s;
}

.hdv-document-row:hover {
    background: #f8f9fa;
}

/* Column widths */
.hdv-col-icon {
    width: 40px;
    text-align: center;
}

.hdv-col-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.hdv-col-title {
    min-width: 200px;
}

.hdv-col-title strong {
    display: block;
    word-break: break-word;
}

.hdv-col-description {
    min-width: 250px;
    color: #666;
    font-size: 14px;
}

.hdv-col-type {
    width: 100px;
    text-align: center;
}

.hdv-col-date {
    width: 120px;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.hdv-col-actions {
    width: 220px;
    text-align: right;
    white-space: nowrap;
}

/* Type badges */
.hdv-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.hdv-type-pdf {
    background: #ffe5e7;
    color: #d63638;
}

.hdv-type-doc,
.hdv-type-docx {
    background: #e0f2fe;
    color: #2271b1;
}

.hdv-type-xls,
.hdv-type-xlsx {
    background: #d4f4dd;
    color: #1e8449;
}

.hdv-type-ppt,
.hdv-type-pptx {
    background: #fff3cd;
    color: #d67500;
}

/* Buttons */
.hdv-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 5px;
}

.hdv-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.hdv-btn-view {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.hdv-btn-view:hover {
    background: #005a87;
    border-color: #005a87;
}

.hdv-btn-download {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.hdv-btn-download:hover {
    background: #135e96;
    border-color: #135e96;
}

.hdv-btn .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Modal */
.hdv-library-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

.hdv-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.hdv-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.hdv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.hdv-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.hdv-modal-actions {
    display: flex;
    gap: 10px;
}

.hdv-modal-close {
    background: #d63638;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.hdv-modal-close:hover {
    background: #b32d2e;
}

.hdv-modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.hdv-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Empty state */
.hdv-library-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 1200px) {
    .hdv-col-description {
        display: none;
    }
}

@media (max-width: 768px) {
    .hdv-library-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hdv-search-input {
        width: 100%;
    }
    
    .hdv-documents-table {
        font-size: 13px;
    }
    
    .hdv-col-date {
        display: none;
    }
    
    .hdv-col-title {
        min-width: 150px;
    }
    
    .hdv-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .hdv-modal-content {
        width: 95%;
        height: 95vh;
    }
    
    .hdv-col-actions {
        width: auto;
    }
}
