/* ============================================================================
   Filter Drawer/Sidebar Component
   Similar to Amazon/eBay/Etsy filter panels
   ============================================================================ */

/* Filter Toggle Button */
.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    color: #111;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-toggle-btn:hover {
    background: #f7fafa;
    border-color: #007bff;
    color: #007bff;
}

.filter-toggle-btn i {
    font-size: 16px;
}

.filter-toggle-btn .filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #007bff;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

/* Filter Drawer Overlay */
.filter-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.filter-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Filter Drawer Panel */
.filter-drawer {
    position: fixed;
    top: 0;
    left: -400px; /* Hidden by default */
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: left 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.filter-drawer.active {
    left: 0;
}

/* Filter Drawer Header */
.filter-drawer-header {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 2px solid #f0f0f0;
    padding: 2px 20px !important; /* FURTHER REDUCED vertical padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.filter-drawer-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important; /* LARGER and more noticeable */
    font-weight: 700 !important; /* BOLDER */
    color: #007bff !important; /* BLUE color to stand out */
    line-height: 1.2 !important; /* TIGHT line height */
    letter-spacing: 0.3px !important; /* Slight letter spacing for prominence */
}

.filter-drawer-close {
    background: none;
    border: none;
    font-size: 18px !important; /* SMALLER X icon */
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 24px !important; /* SMALLER button size */
    height: 24px !important; /* SMALLER button size */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important; /* CIRCULAR button */
    transition: all 0.3s ease !important; /* SMOOTH transitions */
}

.filter-drawer-close:hover {
    background: #ff4444 !important; /* RED background on hover */
    color: #fff !important; /* WHITE X on hover */
    transform: rotate(90deg) scale(1.1) !important; /* ROTATE and SCALE on hover */
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3) !important; /* SHADOW effect */
}

.filter-drawer-close:active {
    transform: rotate(90deg) scale(0.95) !important; /* Slight shrink on click */
}

/* Filter Drawer Content */
.filter-drawer-content {
    padding: 0;
}

/* Header modal MUST use grid layout - override everything */
#headerFilterDrawerContent,
#headerFilterDrawerContent.filter-drawer-content {
    display: grid !important;
    grid-template-columns: repeat(8, 1fr) !important; /* 8 columns total */
    gap: 6px !important;
    padding: 8px 12px !important; /* Increased padding for more room */
    align-items: start !important;
    min-height: 280px !important; /* Increased from 200px to give filters more room */
    max-height: 400px !important; /* Allow filters to expand */
    overflow-y: auto !important;
}

/* Filter Group (Collapsible Section) */
.filter-group {
    border-bottom: 1px solid #f0f0f0;
}

.filter-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.filter-group-header:hover {
    background: #f8f9fa;
}

.filter-group-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group-header i {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s;
}

.filter-group.active .filter-group-header i {
    transform: rotate(90deg);
}

.filter-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-group.active .filter-group-content {
    max-height: 2000px; /* Large enough for content */
}

.filter-group-inner {
    padding: 0 20px 20px 20px;
}

/* Category Filter (within drawer) */
.filter-group .category-filter {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* Hide the category filter's own header since drawer group has one */
.filter-group .category-filter .filter-header {
    display: none !important;
}

.filter-group .category-levels {
    grid-template-columns: 1fr;
    gap: 12px;
}

.filter-group .category-level {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group .category-level label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
}

.filter-group .category-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.filter-group .category-path {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    font-size: 13px;
}

/* Clear Filters Button */
.filter-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 2px solid #f0f0f0;
    padding: 8px 20px;
    display: flex;
    gap: 8px;
    justify-content: center !important; /* Center buttons */
    align-items: center;
}

.btn-clear-all-filters {
    flex: none !important; /* Don't stretch - keep small */
    padding: 3px 12px !important; /* REDUCED height - almost half of original */
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px !important; /* Smaller border radius for compact look */
    color: #6c757d;
    font-size: 12px !important;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: auto !important;
    width: auto !important; /* Don't stretch to full width */
    height: auto !important;
    line-height: 1.2 !important; /* TIGHT line height */
}

.btn-clear-all-filters:hover {
    background: #e9ecef;
    color: #495057;
}

.btn-apply-filters {
    flex: none !important; /* Don't stretch - keep small */
    padding: 3px 12px !important; /* REDUCED height - almost half of original */
    background: #007bff;
    border: 1px solid #007bff;
    border-radius: 4px !important; /* Smaller border radius for compact look */
    color: #fff;
    font-size: 12px !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: auto !important;
    width: auto !important; /* Don't stretch to full width */
    height: auto !important;
    line-height: 1.2 !important; /* TIGHT line height */
}

.btn-apply-filters:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* Category dropdown styling - compact */
.category-dropdown-container {
    width: 100%;
}

.category-dropdown {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.category-dropdown:hover {
    border-color: #007bff;
}

.category-dropdown:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.category-dropdown:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

/* Gallery-specific filter options styling */
.duration-options, .quality-options, .date-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.duration-options label,
.quality-options label,
.date-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    padding: 6px 0;
}

.duration-options input[type="checkbox"],
.quality-options input[type="checkbox"],
.date-options input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .filter-drawer {
        width: 85vw;
        left: -85vw;
    }
    
    .filter-group-header {
        padding: 14px 16px;
    }
    
    .filter-group-inner {
        padding: 0 16px 16px 16px;
    }
}

@media (max-width: 480px) {
    .filter-drawer {
        width: 100vw;
        left: -100vw;
    }
}

