/* ==========================================================================
   BPX File Download - Frontend Styles
   ========================================================================== */

/* Single file display */
.bpx-file-single {
    display: inline-block;
    margin: 4px 0;
}

.bpx-file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e0e0e0;
    background: #fafafa;
}

.bpx-file-link:hover {
    background-color: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: #333;
    text-decoration: none;
}

.bpx-file-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.bpx-file-icon svg {
    width: 28px;
    height: 28px;
}

.bpx-file-title {
    font-weight: 500;
    font-size: 15px;
    line-height: 1.3;
}

.bpx-file-link:hover .bpx-file-title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Category table display */
.bpx-file-category {
    margin: 20px 0;
}

.bpx-file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.bpx-file-table thead th {
    background: #514e68;
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bpx-file-table thead th:last-child {
    text-align: right;
}

.bpx-file-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
}

.bpx-file-table tbody tr:hover {
    background-color: #f8f8f8;
}

.bpx-file-table .bpx-col-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bpx-file-table .bpx-col-title .bpx-file-icon svg {
    width: 22px;
    height: 22px;
}

.bpx-file-table .bpx-col-actions {
    text-align: right;
    white-space: nowrap;
}

/* Buttons */
.bpx-btn {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    border: none;
}

.bpx-btn:hover {
    opacity: 0.85;
    text-decoration: none;
}

.bpx-btn-preview {
    background: #514e68;
    color: #fff;
    margin-right: 8px;
}

.bpx-btn-preview:hover {
    color: #fff;
}

.bpx-btn-download {
    background: #2c7a2c;
    color: #fff;
}

.bpx-btn-download:hover {
    color: #fff;
}

/* Pagination */
.bpx-pagination {
    margin-top: 16px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.bpx-page-link,
.bpx-page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.bpx-page-link {
    background: #f0f0f0;
    color: #333;
}

.bpx-page-link:hover {
    background: #514e68;
    color: #fff;
    text-decoration: none;
}

.bpx-page-current {
    background: #514e68;
    color: #fff;
}

/* PDF Modal overlay */
.bpx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.bpx-modal-overlay.bpx-modal-active {
    opacity: 1;
    visibility: visible;
}

.bpx-modal {
    background: #fff;
    border-radius: 8px;
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.bpx-modal-overlay.bpx-modal-active .bpx-modal {
    transform: translateY(0);
}

.bpx-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #514e68;
    color: #fff;
    flex-shrink: 0;
}

.bpx-modal-title {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 20px;
}

.bpx-modal-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.bpx-modal-actions a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.2s;
}

.bpx-modal-actions a:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.bpx-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.bpx-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bpx-modal-body {
    flex: 1;
    overflow: hidden;
}

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

/* Responsive */
@media (max-width: 768px) {
    .bpx-modal {
        width: 98vw;
        height: 90vh;
        border-radius: 4px;
    }

    .bpx-file-table .bpx-col-actions {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .bpx-btn-preview {
        margin-right: 0;
    }

    .bpx-modal-title {
        font-size: 13px;
    }
}
