/* ==================== CONTAINER PRINCIPAL ==================== */
.pdfmp-container {
    max-width: 1400px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==================== EN-TÊTE ==================== */
.pdfmp-header {
    background: linear-gradient(135deg, #8B0000, #4a0000);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pdfmp-header h2 {
    color: #ffffff !important;
    margin: 0 0 20px 0 !important;
    font-size: 28px;
    font-weight: 600;
}

/* ==================== CONTROLES ==================== */
.pdfmp-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
}

.pdfmp-group-buttons {
    display: flex;
    gap: 5px;
    background: rgba(255,255,255,0.15);
    padding: 4px;
    border-radius: 40px;
}

.pdfmp-group-btn {
    padding: 8px 20px;
    border-radius: 30px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.pdfmp-group-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.pdfmp-group-btn.active {
    background: white;
    color: #8B0000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pdfmp-view-buttons {
    display: flex;
    gap: 5px;
    background: rgba(255,255,255,0.15);
    padding: 4px;
    border-radius: 40px;
}

.pdfmp-view-btn {
    padding: 8px 20px;
    border-radius: 30px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.pdfmp-view-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.pdfmp-view-btn.active {
    background: white;
    color: #8B0000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pdfmp-search-wrapper {
    flex: 1;
    max-width: 320px;
}

.pdfmp-search {
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    outline: none;
    background: white;
}

.pdfmp-filter-wrapper {
    background: rgba(255,255,255,0.15);
    border-radius: 30px;
    padding: 4px 15px;
}

.pdfmp-filter {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
    outline: none;
}

.pdfmp-filter option {
    color: #333;
    background: white;
}

.pdfmp-stats {
    display: flex;
    gap: 15px;
}

.pdfmp-stat {
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
    font-size: 13px;
}

/* ==================== GROUPES ==================== */
.pdfmp-group {
    margin-bottom: 15px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pdfmp-group-header {
    background: #f8f9fa;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #8B0000;
    transition: background 0.2s;
}

.pdfmp-group-header:hover {
    background: #eef2f5;
}

.pdfmp-arrow {
    font-size: 12px;
    color: #8B0000;
    font-weight: bold;
}

.pdfmp-group-icon {
    font-size: 20px;
}

.pdfmp-group-title {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
    color: #2c3e33;
}

.pdfmp-group-badge {
    background: #8B0000;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.pdfmp-group-content {
    padding: 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: none;
}

/* ==================== GRILLE ==================== */
.pdfmp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ==================== LISTE ==================== */
.pdfmp-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pdfmp-list .pdfmp-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.pdfmp-list .pdfmp-card-preview {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.pdfmp-list .pdfmp-view-button {
    width: auto;
    border-radius: 8px;
    margin: 10px;
    padding: 8px 20px;
}

/* ==================== CARTES ==================== */
.pdfmp-card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdfmp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    background: white;
    border-color: #ddd;
}

.pdfmp-card-preview {
    padding: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.pdfmp-card-icon svg {
    width: 48px;
    height: 48px;
    transition: transform 0.2s;
}

.pdfmp-card-preview:hover .pdfmp-card-icon svg {
    transform: scale(1.05);
}

.pdfmp-card-info {
    flex: 1;
}

.pdfmp-card-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
    color: #1a2a3a;
}

.pdfmp-card-meta {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: #888;
}

.pdfmp-view-button {
    background: #8B0000;
    color: white;
    border: none;
    padding: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    width: 100%;
    text-align: center;
}

.pdfmp-view-button:hover {
    background: #6b0000;
}

/* ==================== MODAL ==================== */
.pdfmp-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 999999;
    display: none;
    align-items: center !important;
    justify-content: center !important;
}

.pdfmp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(3px);
    z-index: 1;
}

.pdfmp-modal-container {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    z-index: 2;
    animation: pdfmpSlideIn 0.3s ease;
    margin: auto;
}

@keyframes pdfmpSlideIn {
    from {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.pdfmp-modal-header {
    padding: 20px 25px;
    background-color: black !important;
    padding: 15px 20px !important;
    color: white !important;
    position: relative;
    border-bottom: 1px solid #eaeaea;
    border-radius: 14px 14px 0 0;
}

.pdfmp-modal-header h3 {
    margin: 0;
    color: white !important;
    font-size: 15px;
    text-align: center;
}

.pdfmp-modal-close {
    margin: 5px 5px 0 0;
    position: absolute;
    right: 4px;
    top: 2px;
    background-color: #dc3545 !important;
    border: none;
    color: white !important;
    cursor: pointer;
    border-radius: 4px;
    padding: 6px 12px;
}

.pdfmp-modal-close:hover {
    background-color: #c82333 !important;
}

.pdfmp-modal-body {
    padding: 25px;
    text-align: center;
    flex: 1;
    overflow: auto;
}

.pdfmp-toolbar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 5px 0;
}

.pdfmp-toolbar button {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pdfmp-toolbar button:hover:not(:disabled) {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.pdfmp-toolbar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdfmp-viewer {
    text-align: center;
    overflow: auto;
    max-height: 65vh;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 10px;
}

.pdfmp-canvas {
    margin: 0 auto;
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.pdfmp-loading {
    text-align: center;
    padding: 40px;
}

.pdfmp-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8B0000;
    border-radius: 50%;
    animation: pdfmpSpin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes pdfmpSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pdfmp-error, .pdfmp-empty {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .pdfmp-header { padding: 20px; }
    .pdfmp-header h2 { font-size: 22px; }
    .pdfmp-controls { flex-direction: column; align-items: stretch; }
    .pdfmp-group-buttons, .pdfmp-view-buttons { justify-content: center; }
    .pdfmp-search-wrapper { max-width: 100%; }
    .pdfmp-grid { grid-template-columns: 1fr; }
    .pdfmp-toolbar button { padding: 6px 12px; font-size: 12px; }
    .pdfmp-modal-container { width: 95%; }
    .pdfmp-modal-header { padding: 12px 18px; }
    .pdfmp-modal-body { padding: 15px; }
    .pdfmp-viewer { max-height: 55vh; }
    .pdfmp-modal-close { width: 32px; height: 32px; font-size: 18px; }
}

@media (max-width: 480px) {
    .pdfmp-stats { gap: 8px; }
    .pdfmp-stat { padding: 3px 10px; font-size: 11px; }
    .pdfmp-card-preview { padding: 12px; gap: 10px; }
    .pdfmp-card-meta { gap: 8px; font-size: 10px; }
    .pdfmp-view-button { padding: 8px; font-size: 12px; }
}