/* ===== DOCUMENTS SIDEBAR STYLES ===== */

/* Layout principal */
.documents-layout {
    display: flex;
    min-height: calc(100vh - 200px);
    position: relative;
}

/* ===== SIDEBAR ===== */
.filters-sidebar {
    width: 300px;
    background: #ffffff;
    border-right: 1px solid #e8e9ea;
    position: fixed;
    top: 80px; /* Sous la navbar */
    left: 0;
    height: calc(100vh - 80px);
    z-index: 1000; /* Sous la navbar Bootstrap (1030) */
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
}

/* Sidebar active (mobile) */
.filters-sidebar.active {
    transform: translateX(0);
}

/* Desktop: sidebar toujours visible et sticky */
@media (min-width: 992px) {
    .filters-sidebar {
        position: sticky;
        top: 90px; /* Offset pour navbar + marge */
        transform: translateX(0);
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        box-shadow: none;
        border-right: 1px solid #e8e9ea;
    }
}

/* ===== SIDEBAR HEADER ===== */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e8e9ea;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: #e9ecef;
    color: #495057;
}

/* Desktop: masquer le bouton fermer */
@media (min-width: 992px) {
    .sidebar-close {
        display: none;
    }
}

/* ===== SIDEBAR CONTENT ===== */
.sidebar-content {
    padding: 1.25rem;
}

/* ===== FILTER GROUPS ===== */
.filter-group {
    margin-bottom: 1px;
}

.filter-label {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
}

.modern-input,
.modern-select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.modern-input:focus,
.modern-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
    outline: none;
}

.filter-group.focused .filter-label {
    color: #007bff;
}

/* ===== FILTER ACTIONS ===== */
.filters-actions {
    margin-top: 1rem;
    border-top: 1px solid #e8e9ea;
    padding-top: 0.75rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    position: fixed;
    top: 80px; /* Sous la navbar */
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(0, 0, 0, 0.4);
    z-index: 999; /* Sous la sidebar */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Desktop: masquer l'overlay */
@media (min-width: 992px) {
    .sidebar-overlay {
        display: none;
    }
}

/* ===== MAIN CONTENT ===== */
.documents-main {
    flex: 1;
    min-width: 0;
}

/* Desktop: ajouter marge pour la sidebar */
@media (min-width: 992px) {
    .documents-main {
        margin-left: 0;
    }
}

/* ===== DOCUMENTS HEADER SIMPLE ===== */
.documents-header-simple {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e8e9ea;
    padding: 2rem 0;
}

.documents-header-simple .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.documents-header-simple .header-info {
    flex: 1;
}

.documents-header-simple .header-title {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.documents-header-simple .header-subtitle {
    margin: 0;
    font-size: 1rem;
    color: #6c757d;
}

.documents-header-simple .header-actions {
    flex-shrink: 0;
}

/* ===== MOBILE FILTER TOGGLE ===== */
.mobile-filter-toggle {
    padding: 0 1rem;
}

#mobileFiltersToggle {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
}

/* ===== MOBILE FILTER TOGGLE ADDITIONAL STYLES ===== */
#mobileFiltersToggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Desktop: masquer le bouton mobile */
@media (min-width: 992px) {
    #mobileFiltersToggle {
        display: none !important;
    }
}

/* ===== CONTAINER ADJUSTMENTS ===== */
.container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 992px) {
    .container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 991px) {
    .documents-header-simple .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .documents-header-simple .header-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .sidebar-content {
        padding: 1rem;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .documents-header-simple .header-title {
        font-size: 1.5rem;
    }
    
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* ===== SCROLLBAR STYLING ===== */
.filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .filters-sidebar,
    .sidebar-overlay,
    .modern-input,
    .modern-select,
    .sidebar-close {
        transition: none;
    }
}
