/*
 * Fachleiter PDF-Automatik
 * Modalfenster für den offiziellen PDF.js-Viewer
 */

.flpdf-auto-modal,
.flpdf-auto-modal * {
    box-sizing: border-box;
}

.flpdf-auto-modal {
    position: fixed;
    z-index: 999980;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(9, 18, 34, 0.78);
    backdrop-filter: blur(5px);
}

.flpdf-auto-modal.is-visible {
    display: flex;
}

.flpdf-auto-dialog {
    position: relative;
    width: min(1380px, 96vw);
    height: min(940px, 94vh);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    background: #eef1f5;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.42);
}

.flpdf-auto-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #eef1f5;
}

.flpdf-auto-close {
    position: absolute;
    z-index: 20;
    top: 10px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(23, 36, 58, 0.93);
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25);
}

.flpdf-auto-close:hover {
    background: #0f172a;
}

.flpdf-auto-loading {
    position: absolute;
    z-index: 10;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #eef1f5;
    color: #17243a;
    font-size: 15px;
    font-weight: 700;
}

.flpdf-auto-loading.is-hidden {
    display: none;
}

.flpdf-auto-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid #cbd5e1;
    border-top-color: #17243a;
    border-radius: 50%;
    animation: flpdf-auto-spin 0.8s linear infinite;
}

@keyframes flpdf-auto-spin {
    to {
        transform: rotate(360deg);
    }
}

/*
 * Automatisch umgewandelte direkte PDF-Einbettungen.
 */
.flpdf-auto-embedded {
    display: block;
    width: 100%;
    height: min(900px, 85vh);
    min-height: 600px;
    margin: 20px 0;
    border: 1px solid #d7dee8;
    border-radius: 13px;
    background: #eef1f5;
}

/*
 * Verhindert Scrollen der WordPress-Seite,
 * solange der PDF-Viewer geöffnet ist.
 */
body.flpdf-modal-open {
    overflow: hidden !important;
}

@media (max-width: 760px) {
    .flpdf-auto-modal {
        padding: 0;
        background: #eef1f5;
    }

    .flpdf-auto-dialog {
        width: 100vw;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .flpdf-auto-close {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
    }

    .flpdf-auto-embedded {
        height: 78dvh;
        min-height: 560px;
        border-radius: 0;
    }
}