/* Gallery with Right Sidebar CSS */

.gallery-page {
    padding-top: 60px;
    min-height: 100vh;
}

.gallery-content-wrapper {
    display: flex;
    position: relative;
    min-height: calc(100vh - 60px);
}

/* Main Gallery Area */
.gallery-main {
    flex: 1;
    padding: 2rem;
    margin-right: 320px; /* Space for sidebar */
    transition: margin-right 0.3s ease;
}

.gallery-main.full-width {
    margin-right: 60px; /* Just space for toggle button when sidebar is closed */
}

.container-fluid {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    animation: fade-in 0.8s ease;
}

/* Right Sidebar */
.gallery-sidebar {
    position: fixed;
    right: 0;
    top: 60px;
    height: calc(100vh - 60px);
    width: 320px;
    background: var(--white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    z-index: 100;
    overflow: hidden;
}

.gallery-sidebar.collapsed {
    transform: translateX(260px);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    left: -60px;
    top: 20px;
    width: 50px;
    height: 50px;
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 8px 0 0 8px;
    border-right: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:hover {
    background: var(--light-gray);
}

.toggle-icon {
    font-size: 1.25rem;
    color: var(--text-dark);
}

.toggle-text {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Sidebar Content */
.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-dark);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: color 0.2s ease;
}

.sidebar-close:hover {
    color: var(--text-dark);
}

/* Active Filters Display */
.active-filters {
    padding: 1rem 1.5rem;
    background: var(--light-gray);
    border-bottom: 1px solid var(--border-light);
    min-height: 50px;
}

.active-filters:empty {
    display: none;
}

.active-filter-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    background: var(--white);
    border: 1px solid #9ca3af;
    border-radius: 15px;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.active-filter-tag .remove {
    margin-left: 0.5rem;
    cursor: pointer;
    color: #9ca3af;
}

.active-filter-tag .remove:hover {
    color: var(--text-dark);
}

/* Filters Wrapper */
.filters-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

/* Filter Sections */
.filter-section {
    border-bottom: 1px solid var(--border-light);
}

.filter-section-header {
    width: 100%;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: left;
    transition: background 0.2s ease;
}

.filter-section-header:hover {
    background: var(--light-gray);
}

.filter-section-header .chevron {
    transition: transform 0.3s ease;
}

.filter-section-header.collapsed .chevron {
    transform: rotate(-90deg);
}

/* Filter Section Content */
.filter-section-content {
    padding: 0 1.5rem 1rem;
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-section-content.collapsed {
    max-height: 0;
    padding-bottom: 0;
}

/* Filter Buttons Container */
.filters-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Filter Buttons */
.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-btn:hover {
    border-color: #9ca3af;
    background: var(--light-gray);
}

.filter-btn.active {
    background: #6b7280;
    color: var(--white);
    border-color: #6b7280;
}

.filter-count {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Special Buttons */
.filter-all {
    background: #9ca3af;
    color: var(--white);
    border-color: #9ca3af;
    font-weight: 600;
}

.filter-clear {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid #ef4444;
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.filter-clear:hover {
    background: #ef4444;
    color: var(--white);
}

/* Color Filter Buttons with Indicators */
.filter-btn[data-type="color"] {
    padding-left: 2.5rem;
    position: relative;
}

.filter-btn[data-type="color"]::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.filter-btn[data-color="blue"]::before { background: #4682B4; }
.filter-btn[data-color="red"]::before { background: #DC143C; }
.filter-btn[data-color="yellow"]::before { background: #FFD700; }
.filter-btn[data-color="orange"]::before { background: #FF8C00; }
.filter-btn[data-color="green"]::before { background: #228B22; }
.filter-btn[data-color="purple"]::before { background: #8B008B; }
.filter-btn[data-color="brown"]::before { background: #8B4513; }
.filter-btn[data-color="black"]::before { background: #000000; }
.filter-btn[data-color="white"]::before { background: #FFFFFF; }
.filter-btn[data-color="gray"]::before { background: #808080; }
.filter-btn[data-color="pink"]::before { background: #FFC0CB; }

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-sidebar {
        width: 280px;
    }

    .gallery-main {
        margin-right: 280px;
    }

    .gallery-sidebar.collapsed {
        transform: translateX(220px);
    }
}

@media (max-width: 992px) {
    .gallery-sidebar {
        width: 100%;
        max-width: 320px;
        transform: translateX(100%);
    }

    .gallery-sidebar.expanded {
        transform: translateX(0);
    }

    .gallery-sidebar.collapsed {
        transform: translateX(100%);
    }

    .gallery-main {
        margin-right: 0;
    }

    .sidebar-toggle {
        left: auto;
        right: 10px;
        border-radius: 8px;
        border: 2px solid var(--border-light);
    }

    .sidebar-close {
        display: block;
    }

    /* Overlay for mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .gallery-main {
        padding: 1rem;
    }
}