.background {
    position: fixed;
    inset: 0;
    z-index: -1; /* placer derrière tout le contenu */
    pointer-events: none; /* laisser les clics passer */
    height: 100%;
    padding: 0;
    margin: 0;
    background-image: url('../../../webassets/backgrounds/background-05.svg');
    background-size: cover;
    background-position: top;
}

.chargeur-pdf-section {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 40px 20px 60px;
}

.chargeur-pdf-container {
    width: 100%;
    max-width: 1000px;
    background: rgba(245, 245, 247, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chargeur-pdf-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.9);
    color: rgb(255, 255, 255);
}

.chargeur-pdf-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.chargeur-pdf-type {
    font-family: "Intertight";
    font-size: 1rem;
    text-transform: uppercase;;
    color: rgba(255, 255, 255, 0.9);
}

.chargeur-pdf-title-sep {
    font-weight: 600;
    color: rgb(255, 255, 255);
}

.chargeur-pdf-name {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 8px rgb(255, 255, 255);
}

.chargeur-pdf-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}


.chargeur-pdf-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px 18px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.chargeur-pdf-viewer {
    width: 100%;
    height: 100vh;
    min-height: 100px;
    background: rgba(255, 255, 255, 0.8);
    position: relative;
}

.chargeur-pdf-viewer iframe,
.chargeur-pdf-viewer object {
    width: 100%;
    height: 100%;
    border: none;
}

.chargeur-pdf-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.95rem;
}

.chargeur-pdf-error {
    padding: 0;
    color: rgb(255, 238, 238);
    text-shadow: 0 0 6px rgb(255, 13, 13);
    font-size: 0.9rem;
    flex: 1;
}

/* ===========================
   PDF.JS CONTAINER
   =========================== */

.chargeur-pdf-viewer {
    width: 100%;
    height: 80vh;
    min-height: 400px;
    background: rgba(255, 255, 255, 0.8);
    position: relative;
    display: flex;
    flex-direction: row;
}

.pdf-sidebar {
    display: none;
    width: 160px;
    min-width: 160px;
    background: rgba(30, 30, 30, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    flex-direction: column;
    overflow: hidden;
}

.pdf-sidebar.active {
    display: flex;
}

.pdf-sidebar-header {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.pdf-thumbnails {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pdf-thumbnail {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #fff;
    position: relative;
}

.pdf-thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
}

.pdf-thumbnail.active {
    border-color: #007aff;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.4);
}

.pdf-thumbnail canvas {
    width: 100%;
    height: auto;
    display: block;
}

.pdf-thumbnail-number {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
}

.pdfjs-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
}

.pdfjs-wrapper.active {
    display: block;
}

.pdfjs-container {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pdf-page-wrapper {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    position: relative;
}

.pdf-page-wrapper canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.pdf-page-number {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.5);
}

/* Navigation PDF */
.chargeur-pdf-navigation {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.pdf-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pdf-nav-btn svg {
    width: 20px;
    height: 20px;
}

.pdf-page-info {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

/* ===========================
   RESPONSIVE MOBILE
   =========================== */

@media (max-width: 800px) {
    .chargeur-pdf-section {
        padding: 20px 10px 40px;
    }

    .chargeur-pdf-container {
        border-radius: 8px;
    }

    .chargeur-pdf-header {
        padding: 14px 16px;
    }

    .chargeur-pdf-title {
        font-size: 0.95rem;
        gap: 6px;
    }

    .chargeur-pdf-type {
        font-size: 0.85rem;
    }

    .chargeur-pdf-name {
        font-size: 0.9rem;
    }

    .chargeur-pdf-viewer {
        height: auto;
        min-height: 60vh;
        flex-direction: column;
    }

    /* Masquer la sidebar sur mobile */
    .pdf-sidebar {
        display: none !important;
    }

    .pdfjs-wrapper {
        max-height: 70vh;
    }

    .pdfjs-container {
        padding: 10px;
        gap: 15px;
    }

    .chargeur-pdf-footer {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .chargeur-pdf-error {
        text-align: center;
    }
}