/* batch.css - Styles pour le module Batch Processing */

/* ═══════════════════════════════════════════════════════════════ */
/* STYLES D'INTÉGRATION UI (pour index.html) */
/* ═══════════════════════════════════════════════════════════════ */

/* Bouton d'accès au batch */
.btn-batch {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-batch:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-batch i {
    margin-right: 8px;
}

/* Badge NEW */
.badge-new {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Stats card batch sur le dashboard */
.batch-stats {
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ebff 100%);
    border: 2px solid #667eea;
}

.batch-stats .stats-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Tooltip pour le bouton */
.btn-batch[data-tooltip] {
    position: relative;
}

.btn-batch[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10000;
}

.btn-batch[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-batch:hover[data-tooltip]::after,
.btn-batch:hover[data-tooltip]::before {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════ */
/* STYLES DU MODAL BATCH */
/* ═══════════════════════════════════════════════════════════════ */

/* Modal principal */
.batch-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.batch-content {
    position: relative;
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: batchModalSlideIn 0.3s ease-out;
}

@keyframes batchModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.batch-header h3 {
    margin: 0;
    font-size: 1.4em;
}

.batch-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.batch-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Body */
.batch-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

/* Drop Zone */
.drop-zone {
    position: relative;
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.drop-zone-content i {
    font-size: 64px;
    color: #667eea;
    margin-bottom: 20px;
    opacity: 0.8;
}

.drop-zone-content h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.drop-zone-content p {
    margin: 5px 0;
    color: #666;
}

.drop-zone-info {
    font-size: 0.9em;
    color: #999;
    margin-top: 15px;
}

.drop-zone-hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.95);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.drop-zone.drag-over .drop-zone-hover {
    display: flex;
}

.drop-zone-hover i {
    font-size: 64px;
    margin-bottom: 15px;
}

/* Files List */
.files-list {
    margin-top: 20px;
}

.files-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.files-list-header h5 {
    margin: 0;
    color: #333;
}

.files-list-content {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    background: #f8f9fa;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

.file-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-preview {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview i {
    font-size: 24px;
    color: #999;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 0.85em;
    color: #666;
}

.file-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.2s;
}

.file-remove:hover {
    background: #dc3545;
    color: white;
}

/* Processing Section */
.processing-header {
    margin-bottom: 25px;
}

.processing-header h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.processing-stats {
    display: flex;
    gap: 20px;
}

/* Batch-specific stat items only */
.processing-stats .stat-item,
.batch-processor .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 0.9em;
}

.processing-stats .stat-item i,
.batch-processor .stat-item i {
    color: #667eea;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-text {
    color: white;
    font-weight: 600;
    font-size: 0.9em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-details {
    margin-top: 10px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* Processing Log */
.processing-log {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9em;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry i {
    width: 20px;
    text-align: center;
}

.log-entry.log-info i { color: #17a2b8; }
.log-entry.log-success i { color: #28a745; }
.log-entry.log-warning i { color: #ffc107; }
.log-entry.log-error i { color: #dc3545; }

.log-time {
    margin-left: auto;
    color: #999;
    font-size: 0.85em;
}

/* Validation Section */
.validation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.validation-header h4 {
    margin: 0;
    color: #333;
}

.validation-actions {
    display: flex;
    gap: 10px;
}

.validation-actions .btn {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Validation Filters */
.validation-filters {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
}

.filter-group select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
}

.filter-stats {
    margin-left: auto;
    display: flex;
    gap: 15px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
}

.stat-badge i {
    font-size: 0.9em;
}

.stat-validated {
    background: #d4edda;
    color: #155724;
}

.stat-rejected {
    background: #f8d7da;
    color: #721c24;
}

.stat-pending {
    background: #fff3cd;
    color: #856404;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.result-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-card.validated {
    border-color: #28a745;
}

.result-card.rejected {
    border-color: #dc3545;
    opacity: 0.7;
}

.result-card.highlight-review {
    animation: pulseHighlight 2s ease-in-out infinite;
}

@keyframes pulseHighlight {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
    50% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0.3); }
}

.result-image {
    position: relative;
    aspect-ratio: 0.714; /* Ratio carte Pokemon */
    overflow: hidden;
    background: #f0f0f0;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.confidence-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.8em;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.confidence-high { background: linear-gradient(135deg, #28a745, #20c997); }
.confidence-medium { background: linear-gradient(135deg, #ffc107, #fd7e14); }
.confidence-low { background: linear-gradient(135deg, #dc3545, #c82333); }

.status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.status-validated { background: rgba(40, 167, 69, 0.8); }
.status-rejected { background: rgba(220, 53, 69, 0.8); }

.result-info {
    padding: 12px;
}

.result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-series {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-file {
    font-size: 0.75em;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-actions {
    display: flex;
    gap: 5px;
    padding: 0 12px 12px;
}

.result-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-validate {
    background: #28a745;
    color: white;
}

.btn-validate:hover {
    background: #218838;
}

.btn-correct {
    background: #ffc107;
    color: #333;
}

.btn-correct:hover {
    background: #e0a800;
}

.btn-reject {
    background: #dc3545;
    color: white;
}

.btn-reject:hover {
    background: #c82333;
}

.btn-undo {
    background: #6c757d;
    color: white;
}

.btn-undo:hover {
    background: #5a6268;
}

/* Footer */
.batch-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

.footer-info {
    color: #666;
    font-size: 0.9em;
}

.footer-actions {
    display: flex;
    gap: 15px;
}

.batch-footer .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.batch-footer .btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* États vides */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* Scrollbar personnalisée */
.files-list-content::-webkit-scrollbar,
.processing-log::-webkit-scrollbar,
.results-grid::-webkit-scrollbar {
    width: 8px;
}

.files-list-content::-webkit-scrollbar-track,
.processing-log::-webkit-scrollbar-track,
.results-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.files-list-content::-webkit-scrollbar-thumb,
.processing-log::-webkit-scrollbar-thumb,
.results-grid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.files-list-content::-webkit-scrollbar-thumb:hover,
.processing-log::-webkit-scrollbar-thumb:hover,
.results-grid::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* Responsive */
@media (max-width: 768px) {
    .batch-content {
        width: 95%;
        margin: 10px;
    }
    
    .drop-zone {
        padding: 40px 20px;
    }
    
    .validation-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .validation-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-stats {
        margin-left: 0;
        margin-top: 15px;
        justify-content: center;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .batch-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .footer-actions .btn {
        width: 100%;
    }
}