/* ── PDF preview modal ───────────────────────────────────── */

.pdf-preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 14, 35, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10100;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.pdf-preview-modal.is-open {
    display: flex;
    opacity: 1;
}

body.pdf-preview-open {
    overflow: hidden;
}

.pdf-preview-modal__panel {
    width: min(1100px, 96vw);
    height: min(900px, 92vh);
    background: var(--neutrals-0, #fff);
    border-radius: var(--radius-lg, 8px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(8px);
    transition: transform 0.18s ease;
}

.pdf-preview-modal.is-open .pdf-preview-modal__panel {
    transform: translateY(0);
}

.pdf-preview-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--neutrals-10, var(--surface-border-light));
    background: var(--neutrals-0, #fff);
    flex-shrink: 0;
}

.pdf-preview-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--textcolor-fullcontrast);
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-preview-modal__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pdf-preview-modal__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md, 6px);
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pdf-preview-modal__btn--download,
.pdf-preview-modal__btn--download:link,
.pdf-preview-modal__btn--download:visited {
    background: var(--primary-color);
    color: #fff !important;
    border-color: var(--primary-color);
}

.pdf-preview-modal__btn--download:hover,
.pdf-preview-modal__btn--download:focus,
.pdf-preview-modal__btn--download:active {
    background: var(--hoverprimary-color);
    border-color: var(--hoverprimary-color);
    color: #fff !important;
    text-decoration: none;
}

.pdf-preview-modal__btn--download svg,
.pdf-preview-modal__btn--download span {
    color: #fff !important;
    fill: currentColor;
}

.pdf-preview-modal__btn--close {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    color: var(--textcolor-50contrast, var(--textcolor-50contrast));
    font-size: 1.6rem;
    border-radius: var(--radius-md, 6px);
    justify-content: center;
}

.pdf-preview-modal__btn--close:hover {
    background: var(--neutrals-10, var(--surface-border-light));
    color: var(--textcolor-fullcontrast);
}

.pdf-preview-modal__body {
    flex: 1 1 auto;
    background: #525659; /* Mirrors browser PDF viewer chrome */
    overflow: hidden;
}

.pdf-preview-modal__iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 600px) {
    .pdf-preview-modal { padding: 0; }
    .pdf-preview-modal__panel {
        width: 100vw;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }
    .pdf-preview-modal__btn--download span { display: none; }
    .pdf-preview-modal__btn--download { padding: 0.45rem 0.6rem; }
}
