/* Artwork Filters Styles */

/* Smooth transitions for filter changes */
.masonry-item {
    transition: all 0.3s ease-in-out;
}

.masonry-item[style*="display: none"] {
    opacity: 0;
    transform: scale(0.8);
}

.masonry-item:not([style*="display: none"]) {
    opacity: 1;
    transform: scale(1);
}

/* Ensure proper grid layout */
.masonry-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
}

.masonry-item {
    /* Override Bootstrap grid classes */
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
}

@media (max-width: 991px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 575px) {
    .masonry-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* Active filter indicator */
.nav-link.active {
    background-color: #007bff;
    color: white !important;
    border-radius: 20px;
    padding: 8px 16px;
}

.nav-link:not(.active) {
    transition: all 0.2s ease;
}

.nav-link:not(.active):hover {
    background-color: #f8f9fa;
    border-radius: 20px;
    padding: 8px 16px;
}



/* Filter dropdown improvements */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    min-width: 280px !important;
}

.dropdown-menu .card {
    border: none;
    border-radius: 12px;
}

/* Checkbox styling */
.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Search input styling */
.search {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.search:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Search button styling */
.input-group-append .btn {
    border-radius: 0 8px 8px 0 !important;
    border: 1px solid #dee2e6 !important;
    border-left: none !important;
    background-color: transparent !important;
    min-width: 36px !important;
    padding: 0.375rem 0.5rem !important;
}

.input-group-append .btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.input-group-append .btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    border-color: #007bff;
}

/* Filter button improvements */
.btn-outline-border {
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.btn-outline-border:hover {
    border-color: #007bff;
    color: #007bff;
}

/* Show Results button styling */
.btn-dark {
    background-color: #007bff;
    border-color: #007bff;
    transition: all 0.2s ease;
}

.btn-dark:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

/* Clear button styling */
.btn-outline-dark {
    transition: all 0.2s ease;
}

.btn-outline-dark:hover {
    background-color: #343a40;
    border-color: #343a40;
    color: white;
}

/* Results counter styling */
#resultsCount {
    color: #007bff;
    font-weight: bold;
}

#filterStatus {
    font-style: italic;
}

/* Reset button styling */
#resetFilters {
    transition: all 0.2s ease;
}

#resetFilters:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Filter group improvements */
.form-group-overflow {
    max-height: 300px;
    overflow-y: auto;
}

.form-group-overflow::-webkit-scrollbar {
    width: 6px;
}

.form-group-overflow::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.form-group-overflow::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.form-group-overflow::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading state for filters */
.filtering {
    pointer-events: none;
    opacity: 0.7;
}

.filtering::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast message styling */
.alert {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    border-radius: 8px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .nav-overflow {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .nav-overflow::-webkit-scrollbar {
        height: 4px;
    }
    
    .nav-overflow::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .nav-overflow::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
    
    /* Keep buttons in a row on small devices */
    .col-md-auto {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    /* Ensure buttons don't stack vertically */
    .col-md-auto > * {
        margin: 0.25rem !important;
        white-space: nowrap !important;
    }
    
    #resetFilters {
        margin: 0.25rem !important;
        width: auto !important;
    }
    
    /* Make dropdown more compact */
    .dropdown {
        margin: 0.25rem !important;
    }
}

/* Sort button styling */
.dropdown-toggle[data-bs-toggle="dropdown"] {
    transition: all 0.2s ease;
}

.dropdown-toggle[data-bs-toggle="dropdown"]:hover {
    background-color: #f8f9fa;
}

/* Sort dropdown improvements */
.dropdown-menu .form-check-text {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.dropdown-menu .form-check-text:hover {
    background-color: #f8f9fa;
}

.dropdown-menu .form-check-input:checked + .form-check-label {
    color: #007bff;
    font-weight: 500;
}

/* Filter Chips Styling */
.filter-chip {
    display: inline-flex;
    align-items: center;
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.filter-chip:hover {
    background-color: #bbdefb;
    border-color: #90caf9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-chip .remove-chip {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #1976d2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.filter-chip .remove-chip:hover {
    background-color: #1565c0;
    transform: scale(1.1);
}

.filter-chip .remove-chip:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.3);
}

/* Filter chips container */
#filterChipsContainer {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

#filterChips {
    min-height: 40px;
}

/* Responsive filter chips */
@media (max-width: 768px) {
    .filter-chip {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    .filter-chip .remove-chip {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
}
