/* ===== PDF Card information - Activité Connexe ===== */
.alert-modern {
    background: linear-gradient(135deg, #fcf0b4 0%, #fff3b5 100%);
    border-left: 4px solid #F5D021;
    border-radius: 10px;
    padding: 1.5rem;
}

.alert-modern .alert-icon i {
    color: #F5D021;
    opacity: 0.8;
}

.alert-modern .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

.alert-modern .alert-download {
    border-top-color: rgba(245, 208, 33, 0.2) !important;
}

.alert-modern .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.alert-modern .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 208, 33, 0.3);
}

/* ===== STYLES GÉNÉRAUX PDF ===== */
.pdf-viewer-container {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.pdf-viewer-container:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.pdf-viewer-wrapper {
    padding: 20px;
}

/* ===== BARRE D'OUTILS PDF ===== */
.pdf-toolbar {
    background: white;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.pdf-toolbar:hover {
    border-color: #adb5bd;
}

.pdf-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-info .badge {
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.pdf-info small {
    color: #6c757d;
    font-size: 0.85rem;
}

.pdf-actions {
    display: flex;
    gap: 8px;
}

.pdf-actions .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #ced4da;
    background: white;
    color: #495057;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.pdf-actions .btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pdf-actions .btn:active {
    transform: translateY(0);
}

.pdf-actions .btn i {
    font-size: 0.9rem;
}

/* ===== CONTENEUR PRINCIPAL PDF ===== */
.pdf-frame-container {
    position: relative;
    min-height: 550px;
    background: white;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* ===== LOADER PDF ===== */
.pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.pdf-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

.pdf-loading p {
    color: #6c757d;
    font-size: 1rem;
    margin-top: 15px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.pdf-canvas-wrapper {
    flex: 1;
    overflow: auto;
    max-height: 500px;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin: 10px;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f1f1f1;
}

.pdf-canvas-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.pdf-canvas-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.pdf-canvas-wrapper::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.pdf-canvas-wrapper::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* ===== MESSAGE D'ERREUR ===== */
.pdf-error-alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    width: 85%;
    max-width: 500px;
    padding: 25px;
    border-radius: 10px;
    border: none;
    background: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.pdf-error-alert i {
    font-size: 2rem;
    color: #dc3545;
    margin-bottom: 15px;
}

.pdf-error-alert .alert-link {
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid #0d6efd;
    padding-bottom: 2px;
}

.pdf-error-alert .alert-link:hover {
    color: #0a58ca;
    border-color: #0a58ca;
}

/* ===== PIED DE PAGE PDF ===== */
.pdf-footer {
    background: white;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    margin-top: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.pdf-footer small {
    color: #6c757d;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pdf-footer small i {
    color: #2E7D32;
}

.pdf-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-navigation .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #ced4da;
    background: white;
    color: #495057;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.pdf-navigation .btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pdf-navigation .btn:active:not(:disabled) {
    transform: translateY(0);
}

.pdf-navigation .btn i {
    font-size: 0.9rem;
}

/* ===== BOUTONS DÉSACTIVÉS ===== */
.pdf-navigation .btn:disabled,
.pdf-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

:fullscreen .pdf-canvas-wrapper,
:-webkit-full-screen .pdf-canvas-wrapper,
:-moz-full-screen .pdf-canvas-wrapper,
:-ms-fullscreen .pdf-canvas-wrapper {
    max-height: none;
    height: 100vh;
    padding: 40px;
    background: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .pdf-viewer-wrapper {
        padding: 15px;
    }

    .pdf-frame-container {
        min-height: 500px;
    }

    .pdf-canvas-wrapper {
        max-height: 450px;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .pdf-frame-container {
        min-height: 450px;
    }

    .pdf-canvas-wrapper {
        max-height: 400px;
        padding: 12px;
    }

    .pdf-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 15px;
    }

    .pdf-info {
        justify-content: center;
    }

    .pdf-actions {
        justify-content: center;
    }

    .pdf-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 15px;
    }

    .pdf-footer small {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .pdf-frame-container {
        min-height: 400px;
    }

    .pdf-canvas-wrapper {
        max-height: 350px;
        padding: 10px;
        margin: 5px;
    }

    .pdf-viewer-wrapper {
        padding: 12px;
    }

    .pdf-toolbar,
    .pdf-footer {
        padding: 12px;
    }

    .pdf-actions .btn,
    .pdf-navigation .btn {
        padding: 5px 10px;
        font-size: 0.8rem;
        min-width: 36px;
    }

    .pdf-info .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .pdf-info small {
        font-size: 0.8rem;
    }

    .pdf-loading p {
        font-size: 0.9rem;
    }

    .pdf-error-alert {
        width: 90%;
        padding: 20px;
    }
}

@media (max-width: 400px) {
    .pdf-frame-container {
        min-height: 350px;
    }

    .pdf-canvas-wrapper {
        max-height: 300px;
    }

    .pdf-navigation {
        width: 100%;
        justify-content: center;
    }
}

/* ===== ACCESSIBILITÉ ===== */
.pdf-actions .btn:focus,
.pdf-navigation .btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}


/* ===== TRANSITIONS SMOOTH ===== */
.pdf-viewer-container * {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* ===== MODE SOMBRE (optionnel) ===== */
@media (prefers-color-scheme: dark) {
    .pdf-viewer-container {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
    }

    .pdf-toolbar,
    .pdf-footer {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .pdf-frame-container {
        background: #2d3748;
        border-color: #4a5568;
    }

    .pdf-canvas-wrapper {
        background: #1a202c;
    }

    

    .pdf-loading {
        background: rgba(45, 55, 72, 0.95);
    }

    .pdf-error-alert {
        background: #2d3748;
        color: #e2e8f0;
    }

    .pdf-info small {
        color: #a0aec0;
    }

    .pdf-actions .btn,
    .pdf-navigation .btn {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }

    .pdf-actions .btn:hover:not(:disabled),
    .pdf-navigation .btn:hover:not(:disabled) {
        background: #718096;
        border-color: #a0aec0;
        color: #f7fafc;
    }
}