/* ============================================
   BULK CARDS V2 - Interface épurée moderne
   ============================================ */

/* Bouton d'ouverture */
.bulk-cards-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: 10px;
}

.bulk-cards-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.4);
}

/* Modal container */
#createBlockModal {
    display: none;
    align-items: center;
    justify-content: center;
}

#createBlockModal.show {
    display: flex !important;
}

.modal-bulk-v2 {
    max-width: 1100px;
    width: 96%;
    height: auto;
	min-height: 85vh;
    max-height: 92vh;
    margin: 0;
    background: linear-gradient(145deg, rgba(30, 32, 45, 0.98), rgba(20, 22, 35, 0.98));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-bulk-v2 .modal-body {
    padding: 0;
    position: relative;
    flex: 1;
    overflow-y: auto;
}

.modal-bulk-v2 .modal-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    padding: 20px 24px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.modal-bulk-v2 .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-bulk-v2 .modal-header h2 i {
    color: #a78bfa;
}

.modal-bulk-v2 .modal-body {
    padding: 0;
    position: relative;
}

/* ============================================
   ONGLETS V2
   ============================================ */
.bulk-tabs-v2 {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    gap: 8px;
}

.bulk-tab-v2 {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.bulk-tab-v2 i {
    font-size: 1.3rem;
}

.bulk-tab-v2:hover {
    background: rgba(99, 102, 241, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.bulk-tab-v2.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.2));
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
}

.bulk-tab-v2.active i {
    color: #a78bfa;
}

/* ============================================
   CONTENU DES PANELS
   ============================================ */
.bulk-content-v2 {
    padding: 24px;
}

.bulk-panel {
    display: none;
}

.bulk-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   ZONE D'UPLOAD V2
   ============================================ */
.upload-zone-v2 {
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(99, 102, 241, 0.03);
}

.upload-zone-v2:hover,
.upload-zone-v2.drag-over {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.08);
}

.upload-zone-v2.drag-over {
    transform: scale(1.01);
}

.upload-icon-v2 {
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon-v2 i {
    font-size: 28px;
    color: #a78bfa;
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.upload-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.upload-browse {
    color: #a78bfa;
    text-decoration: underline;
    cursor: pointer;
}

.upload-formats {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}

/* File Preview */
.file-preview-v2 {
    display: none;
    margin-top: 16px;
}

.file-preview-v2.show {
    display: block;
}

.file-info-v2 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
}

.file-icon-v2 {
    font-size: 1.5rem;
    color: #10b981;
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
}

.file-size {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.file-remove {
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.2);
    border: none;
    border-radius: 8px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ============================================
   ZONE TEXTE V2 - Contenteditable avec images
   ============================================ */
.text-input-v2-wrapper {
    position: relative;
}

.text-input-v2.content-editable {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-y: auto;
    transition: all 0.2s ease;
}

.text-input-v2.content-editable:empty:before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.text-input-v2.content-editable:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.text-input-v2.content-editable img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
    display: block;
}

/* Textarea standard pour prompt */
textarea.text-input-v2 {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s ease;
}

.text-input-v2::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.text-input-v2:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================
   OPTIONS V2
   ============================================ */
.bulk-options-v2 {
    margin-top: 20px;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.option-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.option-row label i {
    color: #a78bfa;
}

.option-row select {
    padding: 8px 32px 8px 12px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a78bfa' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.option-row select:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
}

/* ============================================
   BOUTON GÉNÉRER V2
   ============================================ */
.btn-generate-v2 {
    width: 100%;
    margin-top: 24px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-generate-v2:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-generate-v2:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-generate-v2 i {
    font-size: 1.1rem;
}

/* ============================================
   LOADER AVEC CHRONOMÈTRE V2
   ============================================ */
.bulk-loader-v2 {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 40px;
}

.bulk-loader-v2.show {
    display: flex;
}

.loader-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 24px;
}

.loader-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.loader-ring .ring-bg {
    fill: none;
    stroke: rgba(99, 102, 241, 0.15);
    stroke-width: 6;
}

.loader-ring .ring-progress {
    fill: none;
    stroke: url(#bulkLoaderGradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 70;
    animation: ringProgress 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes ringProgress {
    0% { 
        stroke-dashoffset: 283;
        transform: rotate(0deg);
    }
    50% { 
        stroke-dashoffset: 70;
    }
    100% { 
        stroke-dashoffset: 283;
        transform: rotate(360deg);
    }
}

/* Gradient pour SVG */
.loader-ring svg defs {
    display: block;
}

.loader-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 2px;
}

.timer-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Courier New', monospace;
    min-width: 36px;
    text-align: center;
}

.timer-sep {
    font-size: 1.8rem;
    font-weight: 700;
    color: rgba(167, 139, 250, 0.7);
    animation: blink 1s ease infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.loader-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.loader-subtext {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   PRÉVISUALISATION V2
   ============================================ */
.bulk-preview-v2 {
    display: none;
    padding: 24px;
}

.bulk-preview-v2.show {
    display: block;
}

.preview-header-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.preview-header-v2 h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.preview-header-v2 h3 i {
    color: #10b981;
}

.btn-sm {
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: #a78bfa;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm:hover {
    background: rgba(99, 102, 241, 0.25);
}

.preview-grid-v2 {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding-right: 8px;
}

.preview-grid-v2::-webkit-scrollbar {
    width: 6px;
}

.preview-grid-v2::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.preview-grid-v2::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 3px;
}

/* Card preview item */
.preview-card-v2 {
    display: grid;
    grid-template-columns: 30px 1fr 1fr;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    align-items: start;
}

.preview-card-v2:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

.preview-card-v2 input[type="checkbox"] {
    margin-top: 8px;
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

.preview-card-v2 .card-question,
.preview-card-v2 .card-answer {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    max-height: 180px;
    overflow-y: auto;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.preview-card-v2 .card-question {
    border-left: 3px solid #6366f1;
}

.preview-card-v2 .card-answer {
    border-left: 3px solid #10b981;
    color: rgba(255, 255, 255, 0.75);
}

.preview-card-v2 .card-question:hover,
.preview-card-v2 .card-answer:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.preview-card-v2 .card-question.editing,
.preview-card-v2 .card-answer.editing {
    border-color: #6366f1 !important;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.preview-card-v2 .card-question img,
.preview-card-v2 .card-answer img {
    max-width: 300px;
    height: auto;
    border-radius: 6px;
    margin: 6px 0;
}

/* Textarea pour édition */
.preview-card-v2 .edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
}

.preview-card-v2 .edit-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.preview-edit-hint {
    grid-column: 2 / -1;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    padding-top: 4px;
}

/* Boutons d'édition TinyMCE */
.bulk-edit-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.bulk-edit-save {
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-edit-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.bulk-edit-cancel {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-edit-cancel:hover {
    background: rgba(239, 68, 68, 0.3);
}

.bulk-edit-hint {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-left: auto;
}

/* Agrandir la cellule en mode édition */
.preview-card-v2 .card-question.editing,
.preview-card-v2 .card-answer.editing {
    grid-column: 2 / -1;
    max-height: none;
    border-color: #6366f1;
}

/* Footer actions */
.preview-footer-v2 {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel-v2 {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-v2:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-save-v2 {
    padding: 12px 28px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-save-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .preview-card-v2 {
        grid-template-columns: 30px 1fr;
        grid-template-rows: auto auto;
    }
    
    .preview-card-v2 .card-question {
        grid-column: 2;
    }
    
    .preview-card-v2 .card-answer {
        grid-column: 2;
    }
}

/* ============================================
   BOUTON CAMÉRA V2
   ============================================ */
.btn-camera-v2 {
    width: 100%;
    margin-top: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
    border: 1px dashed rgba(16, 185, 129, 0.4);
    border-radius: 12px;
    color: #10b981;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-camera-v2:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.15));
    border-color: rgba(16, 185, 129, 0.6);
}

.btn-camera-v2 i {
    font-size: 1.2rem;
}

/* ============================================
   MOBILE OPTIMISÉ - PLEIN ÉCRAN
   ============================================ */
@media (max-width: 600px) {
    /* Container modal plein écran */
    #createBlockModal {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    
    /* Modal plein écran */
    .modal-bulk-v2 {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }
    
    /* Header compact - NE PAS GRANDIR */
    .modal-bulk-v2 .modal-header {
        padding: 10px 14px;
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    .modal-bulk-v2 .modal-header h2 {
        font-size: 0.95rem;
        gap: 8px;
    }
    
    .modal-bulk-v2 .modal-header h2 i {
        font-size: 1rem;
    }
    
    /* Bouton fermer repositionné */
    .modal-bulk-v2 .close,
    .modal-bulk-v2 #el_auto_bulk_close {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        top: 10px;
        right: 10px;
    }
    
    /* Body flexible - DOIT ÊTRE FLEX */
    .modal-bulk-v2 .modal-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0;
        min-height: 0;
    }
    
    /* Onglets ultra-compacts - NE PAS GRANDIR */
    .bulk-tabs-v2 {
        padding: 6px 8px;
        gap: 4px;
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    .bulk-tab-v2 {
        padding: 8px 6px;
        gap: 3px;
        border-radius: 8px;
    }
    
    .bulk-tab-v2 i {
        font-size: 1rem;
    }
    
    .bulk-tab-v2 span {
        font-size: 0.65rem;
    }
    
    /* Contenu - PREND TOUT L'ESPACE */
    .bulk-content-v2 {
        padding: 10px;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    
    /* Panel - PREND TOUT L'ESPACE */
    .bulk-panel {
        flex: 1;
        display: none;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    
    .bulk-panel.active {
        display: flex;
    }
    
    /* Zone upload compacte */
    .upload-zone-v2 {
        padding: 16px 12px;
        flex-shrink: 0;
    }
    
    .upload-icon-v2 {
        width: 45px;
        height: 45px;
        margin-bottom: 8px;
    }
    
    .upload-icon-v2 i {
        font-size: 20px;
    }
    
    .upload-title {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }
    
    .upload-subtitle {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }
    
    .upload-formats {
        font-size: 0.65rem;
    }
    
    /* Bouton caméra compact */
    .btn-camera-v2 {
        margin-top: 8px;
        padding: 12px 14px;
        font-size: 0.85rem;
        border-style: solid;
        border-width: 2px;
    }
    
    /* File preview compact */
    .file-preview-v2 {
        margin-top: 10px;
    }
    
    .file-info-v2 {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .file-icon-v2 {
        font-size: 1.2rem;
    }
    
    .file-name {
        font-size: 0.85rem;
    }
    
    .file-size {
        font-size: 0.7rem;
    }
    
    /* Champs texte - PREND TOUT L'ESPACE RESTANT */
    .text-input-v2.content-editable {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: 12px;
        font-size: 0.9rem;
        overflow-y: auto;
    }
    
    textarea.text-input-v2 {
        flex: 1 1 auto;
        min-height: 0;
        padding: 12px;
        font-size: 0.9rem;
        resize: none;
        overflow-y: auto;
    }
    
    /* Options compactes - NE PAS GRANDIR */
    .bulk-options-v2 {
        margin-top: 10px;
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    .option-row {
        padding: 8px 10px;
    }
    
    .option-row label {
        font-size: 0.75rem;
        gap: 6px;
    }
    
    .option-row select {
        padding: 5px 24px 5px 8px;
        font-size: 0.75rem;
    }
    
    /* Bouton générer - COMPACT, NE PAS GRANDIR */
    .btn-generate-v2 {
        margin-top: 10px;
        padding: 12px 16px;
        font-size: 0.9rem;
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    /* Loader adapté */
    .bulk-loader-v2 {
        padding: 30px 20px;
    }
    
    .loader-ring {
        width: 100px;
        height: 100px;
        margin-bottom: 16px;
    }
    
    .timer-value {
        font-size: 1.4rem;
        min-width: 28px;
    }
    
    .timer-sep {
        font-size: 1.4rem;
    }
    
    .loader-text {
        font-size: 0.95rem;
    }
    
    .loader-subtext {
        font-size: 0.8rem;
    }
    
    /* Preview adapté mobile - CACHÉ par défaut */
    .bulk-preview-v2 {
        display: none;
        padding: 12px;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
    
    .bulk-preview-v2.show {
        display: flex;
    }
    
    .preview-header-v2 {
        margin-bottom: 10px;
        flex-wrap: wrap;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .preview-header-v2 h3 {
        font-size: 0.9rem;
        gap: 8px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .preview-grid-v2 {
        flex: 1;
        max-height: none;
        overflow-y: auto;
        margin-bottom: 10px;
    }
    
    /* Cards preview en colonne */
    .preview-card-v2 {
        grid-template-columns: 24px 1fr;
        gap: 8px;
        padding: 10px;
        margin-bottom: 6px;
    }
    
    .preview-card-v2 input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin-top: 6px;
    }
    
    .preview-card-v2 .card-question,
    .preview-card-v2 .card-answer {
        padding: 8px 10px;
        font-size: 0.8rem;
        max-height: 120px;
    }
    
    .preview-footer-v2 {
        gap: 10px;
        flex-shrink: 0;
    }
    
    .btn-cancel-v2 {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .btn-save-v2 {
        padding: 10px 20px;
        font-size: 0.85rem;
        flex: 1;
    }
}

/* ============================================
   TRÈS PETITS ÉCRANS (iPhone SE, etc.)
   ============================================ */
@media (max-width: 380px) {
    .bulk-tabs-v2 {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .bulk-tab-v2 {
        padding: 8px 6px;
    }
    
    .bulk-tab-v2 i {
        font-size: 1rem;
    }
    
    .bulk-tab-v2 span {
        font-size: 0.65rem;
    }
    
    .bulk-content-v2 {
        padding: 10px;
    }
    
    .upload-zone-v2 {
        padding: 16px 12px;
    }
    
    .upload-icon-v2 {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }
    
    .upload-icon-v2 i {
        font-size: 18px;
    }
    
    .upload-title {
        font-size: 0.85rem;
    }
    
    .upload-subtitle {
        font-size: 0.75rem;
    }
    
    .btn-camera-v2 {
        padding: 12px 14px;
        font-size: 0.85rem;
    }
    
    .text-input-v2.content-editable,
    textarea.text-input-v2 {
        min-height: 100px;
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .btn-generate-v2 {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* ============================================
   MODE SPECTATEUR - Slideshow pendant génération
   ============================================ */

.bulk-spectator {
    display: none;
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(15, 15, 30, 0.98), rgba(10, 10, 25, 0.98));
    backdrop-filter: blur(15px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px 30px;
    gap: 12px;
}

.bulk-spectator.show {
    display: flex;
}

/* Robot animé */
.spectator-robot {
    width: 120px;
    height: 140px;
    margin-bottom: 10px;
}

.spectator-robot svg {
    width: 100%;
    height: 100%;
}

/* Barre de progression */
.spectator-progress-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* Message de status */
.spectator-status {
    font-size: 0.9rem;
    color: rgba(167, 139, 250, 0.9);
    margin-bottom: 5px;
    min-height: 1.2em;
    text-align: center;
}

.spectator-progress-bar {
    height: 8px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.spectator-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
    border-radius: 4px;
    transition: width 0.4s ease;
    position: relative;
}

.spectator-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.spectator-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.spectator-percent {
    font-weight: 700;
    font-size: 1.1rem;
    color: #a78bfa;
}

/* Timer spectateur */
.spectator-timer {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.spectator-timer-sep {
    animation: blink 1s ease infinite;
}

/* Carte slideshow */
.spectator-card-container {
    width: 100%;
    max-width: 500px;
    min-height: 200px;
    perspective: 1000px;
}

.spectator-card {
    background: rgba(30, 32, 50, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 15px 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

.spectator-card.card-enter {
    animation: cardSlideIn 0.4s ease forwards;
}

.spectator-card.card-exit {
    animation: cardSlideOut 0.3s ease forwards;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes cardSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
}

.spectator-card-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spectator-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6366f1;
}

.spectator-card-label.answer {
    color: #10b981;
}

.spectator-card-front {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #fff;
    padding: 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    border-left: 3px solid #6366f1;
    max-height: 120px;
    overflow-y: auto;
}

.spectator-card-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    margin: 5px 0;
}

.spectator-card-back {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    border-left: 3px solid #10b981;
    max-height: 120px;
    overflow-y: auto;
}

.spectator-card-front img,
.spectator-card-back img {
    max-width: 100%;
    max-height: 80px;
    border-radius: 6px;
    margin: 5px 0;
}

/* État d'attente */
.spectator-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

.spectator-waiting i {
    font-size: 2rem;
    color: #a78bfa;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* Dots indicateurs */
.spectator-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.spectator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.spectator-dot.active {
    background: #a78bfa;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

/* Mobile spectateur */
@media (max-width: 600px) {
    .bulk-spectator {
        padding: 20px 15px;
        gap: 15px;
    }
    
    .spectator-robot {
        width: 80px;
        height: 90px;
    }
    
    .spectator-card-container {
        max-width: 100%;
    }
    
    .spectator-card {
        padding: 15px;
    }
    
    .spectator-card-front,
    .spectator-card-back {
        font-size: 0.85rem;
        padding: 10px;
        max-height: 100px;
    }
    
    .spectator-progress-container {
        max-width: 100%;
    }
}

/* Cacher les anciens éléments */
#tab-document,
#tab-qa,
.bulk-tabs:not(.bulk-tabs-v2),
#bulkProgress,
#uploadedFileInfo:not(.file-preview-v2) {
    display: none !important;
}


/* ============================================
   ANIMATIONS SCI-FI POUR LE GÉNÉRATEUR IA
   ============================================ */

/* Robot - bien descendu */
.spectator-robot {
    width: 70px;
    height: 85px;
    margin-bottom: -15px;
    margin-top: 0;
}

/* Carte preview - taille fixe */
.spectator-card-container {
    width: 100%;
    max-width: 480px;
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    perspective: 1000px;
    overflow: hidden;
}

.spectator-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.spectator-card-inner.sci-fi {
    position: relative;
    height: 100%;
    overflow: hidden;
}

/* Ligne de scan sci-fi */
.card-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00f7ff, #a78bfa, #00f7ff, transparent);
    animation: scanLine 2s ease-in-out infinite;
    z-index: 10;
    opacity: 0.8;
}

@keyframes scanLine {
    0% { top: 0; opacity: 0.8; }
    50% { top: 100%; opacity: 0.4; }
    100% { top: 0; opacity: 0.8; }
}

/* Labels sci-fi */
.spectator-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: #00f7ff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
}

.spectator-card-label.answer {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.label-icon {
    animation: pulseIcon 1.5s ease infinite;
}

@keyframes pulseIcon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Contenu texte - 2 lignes visibles */
.spectator-card-front,
.spectator-card-back {
    font-size: 0.85rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.9);
    min-height: 40px;
    max-height: 40px;
    overflow: hidden;
    position: relative;
}

/* Curseur typing */
.typing-active::after {
    content: '▋';
    animation: blink 0.5s step-end infinite;
    color: #00f7ff;
    margin-left: 2px;
}

.typing-complete::after {
    content: '';
}

/* Divider avec glow */
.spectator-card-divider {
    height: 1px;
    margin: 8px 0;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
    position: relative;
}

.divider-glow {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 8px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.4), transparent);
    animation: dividerPulse 2s ease infinite;
}

@keyframes dividerPulse {
    0%, 100% { opacity: 0.5; width: 60px; }
    50% { opacity: 1; width: 100px; }
}

/* Animation de matérialisation */
.spectator-card.card-materialize {
    animation: materialize 0.5s ease forwards;
}

@keyframes materialize {
    0% {
        opacity: 0;
        transform: scale(0.9);
        filter: blur(10px) brightness(2);
    }
    50% {
        filter: blur(2px) brightness(1.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0) brightness(1);
    }
}

/* Animation de sortie glitch */
.spectator-card.card-glitch-out {
    animation: glitchOut 0.2s ease forwards;
}

@keyframes glitchOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    20% {
        transform: translateX(-5px);
        filter: hue-rotate(90deg);
    }
    40% {
        transform: translateX(5px);
        filter: hue-rotate(-90deg);
    }
    100% {
        opacity: 0;
        transform: translateX(20px);
        filter: blur(5px);
    }
}

/* Animation d'attente - cercles IA */
.spectator-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

.ai-thinking {
    position: relative;
    width: 80px;
    height: 80px;
}

.ai-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #00f7ff, #a78bfa);
    border-radius: 50%;
    animation: aiPulse 1.5s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.7; }
}

.ai-rings {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.ai-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(0, 247, 255, 0.3);
    border-radius: 50%;
    animation: ringExpand 2s ease-out infinite;
}

.ai-ring:nth-child(1) {
    animation-delay: 0s;
}

.ai-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.ai-ring:nth-child(3) {
    animation-delay: 1s;
}

@keyframes ringExpand {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
        border-color: rgba(0, 247, 255, 0.8);
    }
    100% {
        width: 80px;
        height: 80px;
        opacity: 0;
        border-color: rgba(167, 139, 250, 0);
    }
}

.waiting-text {
    font-size: 0.85rem;
    color: rgba(167, 139, 250, 0.8);
    letter-spacing: 1px;
    animation: textPulse 2s ease infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Particules de fond (optionnel) */
.spectator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 247, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 16px;
}
