/* ==========================================================================
   militants-export.css — Styles for Trombinoscope Poster Export (PNG & PDF)
   CFE-CGC Automotive — Fidelité au document officiel
   ========================================================================== */

/* ---------- Modal Wrapper & Backdrop ---------- */
.militants-export-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.militants-export-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.militants-export-modal {
    background: #ffffff;
    width: 100%;
    max-width: 1180px;
    max-height: 95vh;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.militants-export-modal-backdrop.active .militants-export-modal {
    transform: scale(1);
}

/* Modal Header */
.militants-export-header {
    padding: 18px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.militants-export-header h2 {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.militants-export-header .badge-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #e6f4ea;
    color: #006b3f;
    padding: 3px 10px;
    border-radius: 9999px;
    border: 1px solid #34a853;
}

.militants-export-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 6px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.militants-export-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Toolbar Controls */
.militants-export-toolbar {
    padding: 14px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}

.export-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.export-control-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.export-pill-selector {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
}

.export-pill-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 9999px;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.export-pill-btn.active {
    background: #006b3f;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 107, 63, 0.35);
}

.export-select {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 6px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    height: 36px;
}

.export-select:focus {
    border-color: #006b3f;
    box-shadow: 0 0 0 2px rgba(0, 107, 63, 0.15);
}

.export-action-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #006b3f 0%, #008751 100%);
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    border-radius: 9999px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 107, 63, 0.28);
    transition: all 0.2s ease;
}

.export-action-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 107, 63, 0.38);
    transform: translateY(-1px);
}

.export-action-btn:active {
    transform: scale(0.98);
}

.export-action-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Modal Body / Preview Area */
.militants-export-body {
    flex: 1;
    overflow-y: auto;
    background: #cbd5e1;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.export-preview-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.export-preview-scale-wrapper {
    transform-origin: top center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    background: #f1f5f9;
}

/* Status / Progress Indicator */
.export-status-banner {
    padding: 8px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1e40af;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   POSTER CANVAS STYLES
   ========================================================================== */
.trombi-poster {
    background: #f1f5f9;
    color: #0f172a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
    padding: 30px;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.trombi-poster * {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   MODE 1: PORTRAIT (Exactement comme le document en PJ)
   8 colonnes de visages par ligne pour les grands pôles, 4 pour le bureau
   -------------------------------------------------------------------------- */
.trombi-poster.portrait {
    width: 2000px;
    min-width: 2000px;
}

.trombi-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    width: 100%;
}

.trombi-poster.portrait .trombi-cards-grid {
    gap: 12px;
}

.trombi-poster.portrait .trombi-card {
    width: calc((100% - 7 * 12px) / 8 - 0.1px);
    max-width: calc((100% - 7 * 12px) / 8 - 0.1px);
    flex: 0 0 calc((100% - 7 * 12px) / 8 - 0.1px);
}

.trombi-poster.portrait .trombi-card-photo-wrap {
    width: 100%;
    height: 280px;
    border-radius: 9px;
    overflow: hidden;
    background: #e2e8f0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trombi-poster.portrait .trombi-card-name {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 13px;
    color: #0f172a;
    text-align: center;
    margin: 0 0 6px 0;
    line-height: 1.2;
    width: 100%;
}

.trombi-poster.portrait .trombi-badge {
    font-size: 8.5px;
    height: 18px;
    line-height: 1;
    padding: 0 10px;
}

.trombi-poster.portrait .trombi-badge-txt {
    top: -2.5px;
}


/* --------------------------------------------------------------------------
   MODE 2: PAYSAGE (Format très large avec plus de visages par ligne)
   12 colonnes de visages par ligne pour étaler en largeur
   -------------------------------------------------------------------------- */
.trombi-poster.paysage {
    width: 2700px;
    min-width: 2700px;
}

.trombi-poster.paysage .trombi-cards-grid {
    gap: 10px;
}

.trombi-poster.paysage .trombi-card {
    width: calc((100% - 11 * 10px) / 12 - 0.1px);
    max-width: calc((100% - 11 * 10px) / 12 - 0.1px);
    flex: 0 0 calc((100% - 11 * 10px) / 12 - 0.1px);
    padding: 8px 8px 12px 8px;
}

.trombi-poster.paysage .trombi-card-photo-wrap {
    width: 100%;
    height: 258px;
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trombi-poster.paysage .trombi-card-name {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 12px;
    color: #0f172a;
    text-align: center;
    margin: 0 0 5px 0;
    line-height: 1.2;
    width: 100%;
}

.trombi-poster.paysage .trombi-badge {
    font-size: 8px;
    height: 17px;
    line-height: 1;
    padding: 0 8px;
}

.trombi-poster.paysage .trombi-badge-txt {
    top: -2px;
}



/* Header */
.trombi-header {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 22px;
}

.trombi-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.trombi-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
}

.trombi-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: -0.5px;
    color: #114232;
    margin: 0;
    text-transform: uppercase;
}

.trombi-header-right {
    display: flex;
    align-items: center;
}

.trombi-site-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1.5px solid #006b3f;
    border-radius: 9999px;
    background: #ffffff;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 13px;
    color: #006b3f;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Group Sections */
.trombi-group-section {
    margin-bottom: 22px;
    background: transparent;
}

.trombi-group-header {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.trombi-group-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trombi-group-indicator {
    width: 5px;
    height: 18px;
    border-radius: 3px;
    background: #006b3f;
}

.trombi-group-name {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 13.5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #0f172a;
}

.trombi-group-count {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    background: #e2e8f0;
    color: #1e3a8a;
    padding: 3px 10px;
    border-radius: 9999px;
}

/* Militant Card */
.trombi-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 10px 10px 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 2px solid #006b3f;
    overflow: hidden;
}

/* Photo */
.trombi-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.trombi-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #475569;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 26px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
}

/* Badges / Roles container */
.trombi-card-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Individual Pill Badges */
.trombi-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 95%;
    border-radius: 9999px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    border: 1px solid #cbd5e1;
    white-space: nowrap;
    box-sizing: border-box;
    vertical-align: middle;
}

.trombi-badge-txt {
    display: inline-block;
    position: relative;
    line-height: 1;
    white-space: nowrap;
}


/* Badge Color Themes (conformes à la PJ) */
.trombi-badge-green {
    background: #e6f4ea;
    border-color: #34a853;
    color: #137333;
}

.trombi-badge-teal {
    background: #e0f2f1;
    border-color: #26a69a;
    color: #004d40;
}

.trombi-badge-blue {
    background: #e8eaf6;
    border-color: #5c6bc0;
    color: #1a237e;
}

.trombi-badge-cyan {
    background: #e0f7fa;
    border-color: #26c6da;
    color: #006064;
}

.trombi-badge-purple {
    background: #ede7f6;
    border-color: #7e57c2;
    color: #311b92;
}

.trombi-badge-amber {
    background: #fef7e0;
    border-color: #fbbc04;
    color: #b06000;
}

.trombi-badge-red {
    background: #fce8e6;
    border-color: #ea4335;
    color: #c5221f;
}

.trombi-badge-neutral {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}

/* Footer */
.trombi-footer {
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.trombi-footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #334155;
}
