/* ============================================
   Système d'Export de Données Unifié
   Design Amélioré et Moderne
   ============================================ */

/* Bouton d'export principal */
.data-export-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.data-export-btn:active {
    transform: translateY(0);
}

.data-export-btn .badge {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f7fbd 0%, #242525 100%);
    color: white;
    font-weight: 700;
    min-width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(15, 127, 189, 0.4);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Dropdown d'export */
.data-export-dropdown {
    min-width: 240px;
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 0.5rem;
}

.data-export-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.25rem;
    position: relative;
    overflow: hidden;
}

.data-export-dropdown .dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--bs-primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.data-export-dropdown .dropdown-item:hover::before {
    transform: scaleY(1);
}

.data-export-dropdown .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(15, 127, 189, 0.1) 0%, rgba(36, 37, 37, 0.1) 100%);
    color: var(--bs-primary);
    transform: translateX(4px);
    padding-left: 1.25rem;
}

.data-export-dropdown .dropdown-item i {
    width: 24px;
    text-align: center;
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.data-export-dropdown .dropdown-item:hover i {
    transform: scale(1.1);
}

.data-export-dropdown .dropdown-item .badge {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(15, 127, 189, 0.15) 0%, rgba(36, 37, 37, 0.15) 100%);
    color: var(--bs-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.data-export-dropdown .dropdown-item:hover .badge {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
}

/* Modal de configuration d'export */
.data-export-modal .modal-dialog {
    max-width: 900px;
}

.data-export-modal .modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.data-export-modal .modal-header {
    background: linear-gradient(135deg, #0f7fbd 0%, #242525 100%);
    color: white;
    border-bottom: none;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.data-export-modal .modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate-gradient 20s linear infinite;
}

@keyframes rotate-gradient {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.data-export-modal .modal-header .modal-title {
    position: relative;
    z-index: 1;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.data-export-modal .modal-header .modal-title i {
    font-size: 1.5rem;
    animation: bounce-icon 2s infinite;
}

@keyframes bounce-icon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.data-export-modal .modal-header .btn-close {
    filter: invert(1);
    opacity: 0.9;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.data-export-modal .modal-header .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.data-export-modal .modal-body {
    padding: 2rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

/* Badge de nombre d'éléments */
.data-export-count {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(15, 127, 189, 0.1) 0%, rgba(36, 37, 37, 0.1) 100%);
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(15, 127, 189, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    justify-content: center;
}

.data-export-count i {
    font-size: 1.25rem;
    color: var(--bs-primary);
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.data-export-count strong {
    color: var(--bs-primary);
    font-size: 1.125rem;
    font-weight: 700;
}

/* Section de sélection des colonnes */
.data-export-columns-section {
    margin-bottom: 2rem;
}

.data-export-columns-section h6 {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-export-columns-section h6 i {
    color: var(--bs-primary);
    font-size: 1.125rem;
}

.data-export-columns {
    max-height: 350px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    background: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Scrollbar personnalisée */
.data-export-columns::-webkit-scrollbar {
    width: 8px;
}

.data-export-columns::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.data-export-columns::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0f7fbd 0%, #242525 100%);
    border-radius: 4px;
}

.data-export-columns::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
}

.data-export-column-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 2px solid transparent;
    cursor: pointer;
}

.data-export-column-item:hover {
    background: linear-gradient(135deg, rgba(15, 127, 189, 0.05) 0%, rgba(36, 37, 37, 0.05) 100%);
    border-color: rgba(15, 127, 189, 0.2);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-export-column-item:last-child {
    margin-bottom: 0;
}

.data-export-column-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--bs-primary);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.data-export-column-item input[type="checkbox"]:checked {
    transform: scale(1.1);
}

.data-export-column-item label {
    flex: 1;
    margin: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #2d3748;
    user-select: none;
    transition: color 0.2s ease;
}

.data-export-column-item:hover label {
    color: var(--bs-primary);
}

.data-export-column-item .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(15, 127, 189, 0.1) 0%, rgba(36, 37, 37, 0.1) 100%);
    color: var(--bs-primary);
    border: 1px solid rgba(15, 127, 189, 0.2);
}

/* Options de formatage PDF */
.data-export-pdf-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(15, 127, 189, 0.05) 0%, rgba(36, 37, 37, 0.05) 100%);
    border-radius: 0.75rem;
    border: 2px solid rgba(15, 127, 189, 0.1);
}

.data-export-pdf-options .form-group {
    margin-bottom: 0;
}

.data-export-pdf-options label {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: #2d3748;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-export-pdf-options .form-select {
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background-color: white;
}

.data-export-pdf-options .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(15, 127, 189, 0.1);
}

/* Prévisualisation */
.data-export-preview {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.data-export-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #e2e8f0;
}

.data-export-preview-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--bs-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-export-preview-header h6 i {
    font-size: 1.125rem;
}

.data-export-preview-header .btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.data-export-preview-header .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.data-export-preview-content {
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    background: #f8f9fa;
    padding: 0.5rem;
}

.data-export-preview-content::-webkit-scrollbar {
    width: 8px;
}

.data-export-preview-content::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.data-export-preview-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0f7fbd 0%, #242525 100%);
    border-radius: 4px;
}

.data-export-preview-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.data-export-preview-table th,
.data-export-preview-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-export-preview-table th {
    background: linear-gradient(135deg, #0f7fbd 0%, #242525 100%);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    position: sticky;
    top: 0;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-export-preview-table td {
    background: white;
    color: #2d3748;
    font-weight: 500;
}

.data-export-preview-table tr:hover td {
    background: linear-gradient(135deg, rgba(15, 127, 189, 0.05) 0%, rgba(36, 37, 37, 0.05) 100%);
}

.data-export-preview-table tr:last-child td {
    border-bottom: none;
}

/* Actions du modal */
.data-export-modal .modal-footer {
    border-top: 2px solid #e2e8f0;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.data-export-modal .modal-footer .btn {
    min-width: 140px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.data-export-modal .modal-footer .btn-secondary {
    background: white;
    border: 2px solid #e2e8f0;
    color: #64748b;
}

.data-export-modal .modal-footer .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.data-export-modal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #0f7fbd 0%, #242525 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(15, 127, 189, 0.4);
}

.data-export-modal .modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 127, 189, 0.5);
}

.data-export-modal .modal-footer .btn-primary:active {
    transform: translateY(0);
}

/* Animation du modal */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.data-export-modal .modal-content {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Backdrop amélioré */
.data-export-modal.show .modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Responsive */
@media (max-width: 768px) {
    .data-export-modal .modal-dialog {
        margin: 1rem;
    }

    .data-export-modal .modal-body {
        padding: 1.5rem;
    }

    .data-export-pdf-options {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .data-export-columns {
        max-height: 250px;
    }

    .data-export-modal .modal-footer {
        flex-direction: column;
    }

    .data-export-modal .modal-footer .btn {
        width: 100%;
    }
}

/* États de chargement */
.data-export-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--bs-primary);
}

.data-export-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Message d'état vide */
.data-export-empty {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.data-export-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
