/**
 * FILTRES PREMIUM - Design Moderne
 * Date: 2025-12-27
 * Gradient violet/or avec backdrop-filter
 */

/* === BOUTON TOGGLE === */
.filters-toggle-btn {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filters-toggle-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.filters-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Badge de compteur */
.filters-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #4a3a8c;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* === OVERLAY === */
.filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filters-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* === SIDEBAR FILTRES === */
.filters-sidebar {
    position: fixed;
    right: -420px;
    top: 0;
    width: 420px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.filters-sidebar.active {
    right: 0;
}

/* Scrollbar custom */
.filters-sidebar::-webkit-scrollbar {
    width: 8px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 10px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .filters-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* === HEADER FILTRES === */
.filters-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.filters-header h2 {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filters-header-actions {
    display: flex;
    gap: 0.5rem;
}

.reset-filters,
.close-sidebar {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reset-filters:hover,
.close-sidebar:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.close-sidebar {
    padding: 0.6rem;
    min-width: 40px;
    justify-content: center;
}

/* === BODY FILTRES === */
.filters-body {
    padding: 1.5rem 2rem 100px 2rem;
}

/* === SECTIONS FILTRES === */
.filter-section {
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.filter-section:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

.filter-title {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-title i {
    color: #ffd700;
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.3));
}

/* === OPTIONS FILTRES === */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid transparent;
    color: #fff;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #4a3a8c;
    border-color: #ffd700;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    transform: translateX(10px);
}

.filter-btn i {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.filter-btn .count {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.35rem 0.7rem;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 35px;
    text-align: center;
}

.filter-btn.active .count {
    background: rgba(74, 58, 140, 0.4);
    color: #4a3a8c;
}

/* Variante: Boutons grid pour options multiples */
.filter-options.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.filter-options.grid-2 .filter-btn {
    justify-content: center;
    text-align: center;
}

/* === CHECKBOX FILTRES (thèmes) === */
.filter-checkbox-group {
    gap: 0.85rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.filter-checkbox:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateX(5px);
}

.filter-checkbox.checked {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 237, 78, 0.2) 100%);
    border-color: #ffd700;
}

.filter-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #ffd700;
    border-radius: 6px;
}

.checkbox-label {
    flex: 1;
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.checkbox-label i {
    font-size: 1.15rem;
    color: #ffd700;
}

.filter-checkbox .count {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* === BADGES FILTRES === */
.filter-badge-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid transparent;
    color: #fff;
    padding: 0.7rem 1.2rem;
    border-radius: 24px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.filter-badge:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.filter-badge.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #4a3a8c;
    border-color: #ffd700;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.filter-badge i {
    font-size: 1.1rem;
}

/* === RANGE SLIDER (budget) === */
.filter-range {
    padding: 1.5rem 0.5rem;
}

.range-slider {
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 215, 0, 0.3));
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
    border: 3px solid #fff;
    transition: all 0.3s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.8);
}

.range-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 0.95rem;
    margin-top: 1rem;
    font-weight: 600;
}

.range-value {
    font-weight: 700;
    color: #ffd700;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* === ACTIONS BOTTOM (sticky) === */
.filter-actions {
    position: fixed;
    bottom: 0;
    right: -420px;
    width: 420px;
    background: linear-gradient(180deg, transparent 0%, rgba(102, 126, 234, 0.98) 20%, rgba(102, 126, 234, 1) 100%);
    padding: 1.5rem 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 20;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.filters-sidebar.active + .filter-actions,
.filters-sidebar.active .filter-actions {
    right: 0;
}

@media (max-width: 768px) {
    .filter-actions {
        width: 100%;
        right: -100%;
    }
}

.btn-apply-filters {
    width: 100%;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #4a3a8c;
    border: none;
    padding: 1.2rem;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-apply-filters:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.7);
}

.btn-apply-filters:active {
    transform: translateY(-2px);
}

/* === ANIMATIONS === */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.filter-section {
    animation: slideInRight 0.5s ease backwards;
}

.filter-section:nth-child(1) { animation-delay: 0.05s; }
.filter-section:nth-child(2) { animation-delay: 0.1s; }
.filter-section:nth-child(3) { animation-delay: 0.15s; }
.filter-section:nth-child(4) { animation-delay: 0.2s; }
.filter-section:nth-child(5) { animation-delay: 0.25s; }
.filter-section:nth-child(6) { animation-delay: 0.3s; }

/* === RÉSULTATS FILTRES (barre en haut) === */
.filter-results-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1.25rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.filter-results-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-results-count {
    font-weight: 700;
    color: #ffd700;
    font-size: 1.3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.active-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.active-filter-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.active-filter-tag:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.active-filter-tag i {
    color: #ffd700;
}

.active-filter-tag button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.3rem;
    opacity: 0.7;
    transition: all 0.3s;
    padding: 0;
    margin-left: 0.5rem;
    line-height: 1;
}

.active-filter-tag button:hover {
    opacity: 1;
    transform: rotate(90deg);
    color: #ff6b6b;
}

/* === BOUTON TOGGLE FILTRES (main page) === */
.btn-toggle-filters {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.btn-toggle-filters:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.7);
}

.btn-toggle-filters i {
    font-size: 1.2rem;
}

.btn-toggle-filters .filter-count-badge {
    background: #ffd700;
    color: #4a3a8c;
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 25px;
    text-align: center;
}

/* === OVERLAY === */
.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filters-overlay.active {
    opacity: 1;
    visibility: visible;
}
