/* Custom CSS pour EasyPanel - Invoice Processor */

/* === TABLEAUX AVANCÉS === */
.sort-header {
    cursor: pointer;
    user-select: none;
}

.sort-header:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.sort-indicator {
    font-size: 0.8em;
    color: #6c757d;
    transition: all 0.2s ease;
}

.sorted-asc .sort-indicator,
.sorted-desc .sort-indicator {
    color: #007bff;
    font-weight: bold;
}

.filter-row {
    background-color: #f8f9fa;
}

.filter-cell {
    padding: 0.25rem !important;
    border-top: 1px solid #dee2e6;
}

.filter-cell input,
.filter-cell select {
    font-size: 0.875rem;
    min-height: 30px;
}

/* Indicateurs visuels pour colonnes triées */
th.sorted-asc {
    background-color: rgba(40, 167, 69, 0.1);
}

th.sorted-desc {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Amélioration responsive des tableaux */
@media (max-width: 768px) {
    .filter-cell input,
    .filter-cell select {
        font-size: 0.75rem;
        min-height: 25px;
    }
    
    .sort-indicator {
        font-size: 0.7em;
    }
}

/* Animation pour les changements de tri */
.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Styles pour les filtres actifs */
.filter-cell input:not([value=""]),
.filter-cell select:not([value=""]) {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* === RACCOURCIS DE PÉRIODE === */
.period-shortcuts-container {
    padding: 0.5rem 0;
}

.period-label {
    font-size: 0.9rem;
    color: #495057;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.period-group {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.period-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: white;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.period-shortcut:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.period-shortcut i {
    font-size: 0.875rem;
}

/* Styles par type de raccourci */
.period-recent {
    border-color: #28a745;
    color: #28a745;
}

.period-recent:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.period-week {
    border-color: #007bff;
    color: #007bff;
}

.period-week:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.period-month {
    border-color: #6f42c1;
    color: #6f42c1;
}

.period-month:hover {
    background: #6f42c1;
    color: white;
    border-color: #6f42c1;
}

.period-extended {
    border-color: #fd7e14;
    color: #fd7e14;
}

.period-extended:hover {
    background: #fd7e14;
    color: white;
    border-color: #fd7e14;
}

.period-clear {
    border-color: #dc3545;
    color: #dc3545;
}

.period-clear:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* État actif */
.period-shortcut.active {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.period-recent.active {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.period-week.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.period-month.active {
    background: #6f42c1;
    color: white;
    border-color: #6f42c1;
}

.period-extended.active {
    background: #fd7e14;
    color: white;
    border-color: #fd7e14;
}

/* Animation de pulsation pour le bouton actif */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 3px 16px rgba(0, 123, 255, 0.4);
    }
    100% {
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    }
}

.period-shortcut.active {
    animation: pulse-glow 2s infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    .period-shortcuts-container {
        padding: 0.75rem;
    }
    
    .period-shortcut {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }
    
    .period-shortcut span {
        display: none;
    }
    
    .period-shortcut i {
        margin: 0;
    }
    
    .period-group {
        gap: 0.125rem;
    }
}

/* Séparateurs visuels entre groupes */
.period-group:not(:last-child)::after {
    content: "";
    width: 1px;
    height: 20px;
    background: #dee2e6;
    margin: 0 0.5rem;
}

@media (max-width: 768px) {
    .period-group:not(:last-child)::after {
        display: none;
    }
}

/* Styles pour l'upload de fichiers */
.upload-progress {
    transition: all 0.3s ease;
}

.file-upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.15s ease-in-out;
}

.file-upload-zone:hover {
    border-color: #0d6efd;
}

.file-upload-zone.dragover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

/* Styles pour les chunks de progression */
.chunk-progress {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.chunk-progress.error {
    background: linear-gradient(90deg, #dc3545 0%, #fd7e14 100%);
}

/* Badges de fichiers */
.file-count-badge {
    animation: pulse 2s infinite;
}

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

/* Optimisations pour mobile */
@media (max-width: 768px) {
    .file-upload-zone {
        padding: 1rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
}

/* Styles pour les alertes de progression */
.progress-alert {
    border-left: 4px solid #0d6efd;
}

.progress-alert.success {
    border-left-color: #28a745;
}

.progress-alert.error {
    border-left-color: #dc3545;
}

/* Amélioration des listes de fichiers */
.file-list-item {
    transition: background-color 0.15s ease-in-out;
}

.file-list-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Styles pour les statistiques */
.stat-card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.stat-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}