.custom-pdf-wrapper {
    position: relative;
    width: 100%;
    max-width: var(--mpdlux-max-width, 900px);
    margin: 0 auto;
    background: #525659;
    outline: none;
}

.custom-pdf-toolbar {
    position: absolute;
    top: 8px;
    right: 8px;
    left: 8px;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.custom-pdf-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    padding: 2px;
    pointer-events: auto;
}

.custom-pdf-toolbar button {
    background: transparent;
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.custom-pdf-toolbar button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.custom-pdf-toolbar button:disabled {
    opacity: 0.35;
    cursor: default;
}

.custom-pdf-zoom-label,
.custom-pdf-page-label {
    color: #fff;
    font-size: 12px;
    font-family: inherit;
    padding: 0 6px;
    white-space: nowrap;
    min-width: 42px;
    text-align: center;
}

.custom-pdf-fullscreen-btn {
    width: auto !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    gap: 6px;
}

.custom-pdf-pages {
    max-height: var(--mpdlux-max-height, 800px);
    overflow: auto;
    display: block;
    padding: 48px 8px 8px;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    scroll-behavior: auto; /* empeche le smooth-scroll herite du theme de decaler le zoom/glisser */
}

.custom-pdf-pages.is-dragging {
    cursor: grabbing;
}

.custom-pdf-pages-inner {
    transform-origin: 0 0;
}

.custom-pdf-page-placeholder {
    position: relative;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    margin: 0 auto 8px;
}

.custom-pdf-canvas {
    display: block;
    width: 100%;
    height: 100%;
    user-select: none;
    -webkit-user-drag: none;
}

.custom-pdf-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: #fff;
    background: #525659;
    z-index: 5;
    min-height: 200px;
}

.custom-pdf-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mpdlux-spin 0.8s linear infinite;
}

@keyframes mpdlux-spin {
    to { transform: rotate(360deg); }
}

/* Filigrane anti-fuite : superposition en diagonale, non selectionnable */
.custom-pdf-watermark {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-content: space-around;
    justify-content: space-around;
    transform: rotate(-30deg) scale(1.4);
    opacity: 0.12;
}

.custom-pdf-watermark span {
    color: #000;
    font-size: 13px;
    font-family: inherit;
    white-space: nowrap;
    margin: 24px 16px;
}

.custom-pdf-wrapper:fullscreen {
    max-width: none;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2b2d31;
}

.custom-pdf-wrapper:fullscreen .custom-pdf-pages {
    max-height: 100vh;
    width: 100%;
}

/* Mobile */
@media (max-width: 480px) {
    .custom-pdf-toolbar {
        top: 4px;
        left: 4px;
        right: 4px;
    }
    .custom-pdf-toolbar button {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    .custom-pdf-page-label {
        display: none;
    }
}
