/* ========= Lishan PDF Filler — Frontend ========= */

.lpf-download-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: #2271b1;
    color: #fff !important;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 500;
    transition: background 0.2s;
    cursor: pointer;
}

.lpf-download-btn:hover {
    background: #135e96;
    color: #fff !important;
}

/* ========= Inline viewer ========= */

.lpf-inline-viewer {
    margin: 16px 0;
}

.lpf-inline-viewer iframe {
    display: block;
    width: 100%;
    background: #f5f5f5;
}

/* ========= Modale ========= */

.lpf-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lpf-modal.is-open {
    display: flex;
    animation: lpfFadeIn 0.2s ease-out;
}

@keyframes lpfFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lpf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.lpf-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 1000px;
    height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.lpf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #1f1f1f;
    color: #fff;
    flex-shrink: 0;
}

.lpf-modal-title {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

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

.lpf-modal-actions a,
.lpf-modal-actions button {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    text-decoration: none;
}

.lpf-modal-actions a:hover,
.lpf-modal-actions button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.lpf-modal-body {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #525659;
}

.lpf-modal-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #525659;
}

.lpf-modal-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    background: #525659;
    z-index: 1;
}

.lpf-modal-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lpfSpin 0.8s linear infinite;
}

@keyframes lpfSpin {
    to { transform: rotate(360deg); }
}

body.lpf-modal-open {
    overflow: hidden;
}

/* Mobile */
@media (max-width: 640px) {
    .lpf-modal {
        padding: 0;
    }
    .lpf-modal-content {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
}
