/* ========== POPOVER DE FILTRES (Mode Dark) ========== */

/* ========== TRACK MASQUÉE PAR FILTRES ========== */
.track-hidden {
    display: none !important;
}


.popover-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popover-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.filters-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: #2c3034;
    border: 1px solid #495057;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.filters-popover.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #495057;
}

.filters-header h5 {
    margin: 0;
    font-weight: 600;
    color: #f8f9fa;
}

.btn-close-popover {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #adb5bd;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close-popover:hover {
    color: #f8f9fa;
}

.filters-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.filters-footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid #495057;
}

/* ========== SECTIONS DE FILTRES ========== */
.filter-section {
    margin-bottom: 2rem;
}


.bpm-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bpm-inputs input {
    flex: 1;
    background-color: #1a1d20;
    border-color: #495057;
    color: #f8f9fa;
}

.bpm-inputs input:focus {
    background-color: #1a1d20;
    border-color: #adb5bd;
    color: #f8f9fa;
    box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.25);
}

.bpm-inputs span {
    color: #adb5bd;
}

/* ========== BOUTONS FILTRES ========== */
.filter-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid #6c757d;
    background: #495057;
    color: #ffffff;
    line-height: 1.2;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.filter-tag:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
}

.filter-tag.active {
    background: #f8f9fa !important;
    border-color: #f8f9fa !important;
    color:#000000 !important;
}

/* Les couleurs par catégorie sont chargées dynamiquement via category_colors.js */

/* ========== FILTRES ACTIFS ========== */
.active-filters {
    background: #2c3034;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #495057;
    display: none;
}

.active-filters.show {
    display: block;
}

.active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.active-filters-title {
    font-weight: 600;
    color: #f8f9fa;
}

.btn-clear-all {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.btn-clear-all:hover {
    color: #bb2d3b;
}

.active-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: #353a3f;
    transition: all 0.2s;
        /* display: inline-block;
    background: #495057;
    border: 1px solid #6c757d;
    color: #ffffff;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    line-height: 1.2; */
}

.active-filter-tag:hover {
    background: #5f6770;
    border-color: rgba(255, 255, 255, 0.5);
}

.filter-label {
    opacity: 0.7;
    font-size: 0.7rem;
}

.filter-value {
    opacity: 0.95;
    font-weight: 600;
}

.filter-remove {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 0.15rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.filter-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* ========== BOUTONS DE LA FOOTER ========== */
/* Remplacer le bouton primary bleu par un bouton blanc/gris */
.filters-footer .btn-primary {
    background-color: #f8f9fa;
    border-color: #f8f9fa;
    color: #212529;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filters-footer .btn-primary:hover {
    background-color: #e9ecef;
    border-color: #e9ecef;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.filters-footer .btn-primary:active,
.filters-footer .btn-primary:focus {
    background-color: #dee2e6;
    border-color: #dee2e6;
    color: #000000;
    box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.5);
}

/* Bouton secondary reste inchangé */
.filters-footer .btn-secondary {
    transition: all 0.2s ease;
}

.filters-footer .btn-secondary:hover {
    transform: translateY(-2px);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .filters-popover {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        /* Position fixe au centre - ne pas utiliser right/left car on a déjà translate */
        top: 50%;
        left: 50%;
    }

    .filters-popover.show {
        transform: translate(-50%, -50%) scale(1);
    }

    .filters-header {
        padding: 1rem;
    }

    .filters-body {
        padding: 1rem;
    }

    .filters-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .filters-footer .btn {
        width: 100%;
    }
}