:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Filter Sidebar */
.filter-sidebar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.filter-sidebar:hover {
    box-shadow: var(--shadow-md);
}

.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

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

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.813rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.filter-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-chip .remove {
    cursor: pointer;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter-chip .remove:hover {
    opacity: 1;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.4s ease-in;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section-title {
    font-size: 0.813rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #334155;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    letter-spacing: 0.5px;
}

.filter-section-title svg {
    color: var(--primary-color);
}

/* Form Controls */
.form-select-sm {
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
    transition: var(--transition);
    font-size: 0.875rem;
}

.form-select-sm:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: #0f172a;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\203A";
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* Results Summary */
.results-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: var(--shadow-lg);
}

.results-summary h1 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    line-height: 1.2;
}

.results-summary p {
    margin: 0;
    opacity: 0.95;
    font-size: 0.938rem;
}

.results-summary .text-muted {
    color: white !important;
    opacity: 0.95;
}

.results-summary .form-select-sm {
    background: white;
    border: none;
    font-weight: 500;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    min-width: 150px;
}

.results-summary label {
    color: white;
    font-weight: 500;
    margin: 0;
}

/* Gallery Grid Enhancement */
#gallery-content {
    transition: opacity 0.3s ease;
}

#gallery-content.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 250px;
    margin-bottom: 1rem;
}

/* Loading Indicator */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    backdrop-filter: blur(4px);
}

#loader .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
    color: var(--primary-color);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: var(--radius-lg);
    animation: fadeIn 0.5s ease-in;
}

.no-results-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.no-results h2 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.no-results p {
    color: var(--secondary-color);
    font-size: 1.063rem;
}

.no-results .btn {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: var(--radius-md);
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#clear-all-filters {
    color: var(--primary-color);
    font-size: 0.813rem;
    font-weight: 600;
    transition: var(--transition);
}

#clear-all-filters:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Toggle Button */
.toggle-filters-mobile {
    display: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Pagination */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    font-weight: 500;
    transition: var(--transition);
    margin: 0 0.125rem;
}

.page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 991px) {
    .filter-sidebar {
        position: static;
        margin-bottom: 2rem;
        display: none;
    }

    .filter-sidebar.show {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-20px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .toggle-filters-mobile {
        display: block;
    }

    .results-summary {
        padding: 1.25rem;
    }

    .results-summary h1 {
        font-size: 1.375rem;
    }
}

@media (max-width: 767px) {
    .results-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .results-summary .d-flex {
        width: 100%;
    }

    .results-summary .form-select-sm {
        width: 100%;
    }
}

/* Smooth Transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    transition: var(--transition);
}

/* Focus States */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modern Gallery Cards Enhancement */
.item-list-box {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.item-list-box:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    z-index: 100;
    overflow: visible;
}

.item-list-box img.img-responsive {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-list-box:hover img.img-responsive {
    transform: scale(1.05);
}

.item-list-box .inner-text {
    padding: 1rem;
    flex-grow: 1;
}

.item-list-box .inner-text p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.item-list-box .inner-text p:last-child {
    margin-bottom: 0;
}

.item-list-box .inner-text strong {
    color: #1e293b;
    font-size: 0.938rem;
    display: block;
    margin-bottom: 0.25rem;
}

.item-list-box .inner-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.item-list-box .inner-text a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Mouse Hover Modal Overlay - ORIGINAL COMPLETE VERSION */
.item-list-box:hover .mouse-hover {
    visibility: visible;
    opacity: 1;
}

.item-list-box .mouse-hover {
    transition: opacity 0.3s, visibility 0.3s;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: -5px;
    left: -5px;
    background-color: #FFF;
    padding: 15px;
    box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
    z-index: 99;
    width: 600px;
}

.item-list-box .mouse-hover::after {
    content: "";
    display: table;
    clear: both;
}

/* Smart positioning: right-align modal for items in the last column (every 3rd item on desktop) */
@media (min-width: 992px) {
    .col-lg-4:nth-child(3n) .mouse-hover {
        left: auto;
        right: -5px;
    }
}

/* Smart positioning: right-align modal for items in the last column (every 2nd item on tablet) */
@media (min-width: 768px) and (max-width: 991px) {
    .col-md-6:nth-child(2n) .mouse-hover {
        left: auto;
        right: -5px;
    }
}

.item-list-box .mouse-hover p {
    border-bottom: 1px solid #f5f5f5;
    padding: 0px 0 5px 0;
}

.item-list-box .mouse-hover .image-holder {
    width: 50%;
    float: left;
    opacity: 1;
    padding-right: 10px;
}

.item-list-box .mouse-hover .image-holder img {
    width: 100%;
    height: auto;
    max-height: 100%;
}

.item-list-box .mouse-hover a {
    color: #000;
}

.item-list-box .mouse-hover .inner-text {
    width: 50%;
    float: left;
}

/* Responsive adjustments for mouse-hover */
@media(max-width: 1200px) {
    .item-list-box .mouse-hover .inner-text {
        font-size: 11px;
    }

    .item-list-box .mouse-hover {
        width: 500px;
    }
}

@media(max-width: 991px) {
    .item-list-box .mouse-hover {
        width: 698px;
    }
}

@media(max-width: 767px) {
    .item-list-box:hover .mouse-hover {
        width: auto !important;
        right: -5px !important;
    }

    .item-list-box .mouse-hover .image-holder,
    .item-list-box .mouse-hover .inner-text {
        width: 100%;
        float: none;
    }
}

/* Image Loading Animation */
.gallery-image {
    animation: fadeInImage 0.5s ease-in;
}

@keyframes fadeInImage {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Add subtle hover effect on images */
.image-holder {
    position: relative;
    overflow: hidden;
}

.image-holder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.1) 0%, rgba(26, 32, 44, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-list-box:hover .image-holder::after {
    opacity: 1;
}

/* Grid spacing and alignment */
#gallery-content > .col-lg-4,
#gallery-content > .col-md-6,
#gallery-content > .col-sm-12 {
    display: flex;
}

/* Search area enhancement */
.search-area {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    box-shadow: var(--shadow-lg);
}

/* Custom scrollbar for the page */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1a202c 0%, #0f1419 100%);
}

/* Filter Hide/Show Animation (Desktop Only) */
@media (min-width: 992px) {
    #filter-sidebar-container {
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #filter-sidebar-container.filters-hidden {
        display: none;
    }

    #filter-sidebar-container.filters-visible {
        display: block;
    }

    #main-content-area {
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Select2 Custom Dropdown Styling */
.select2-dropdown-custom {
    z-index: 10050 !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color) !important;
}

.select2-container--default .select2-selection--single {
    border-color: var(--border-color);
    border-radius: var(--radius-sm);
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Desktop toggle button */
#toggle-filters-desktop {
    transition: var(--transition);
}

#toggle-filters-desktop:hover {
    transform: translateX(2px);
}
