/* Filter Section */
.filter-section {
    background-color: var(--bg-light);
    padding: 2rem 0;
    position: sticky;
    top: 70px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background-color: white;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.filter-btn:hover::before {
    width: 100%;
    height: 100%;
}

.filter-btn:hover {
    color: white;
    border-color: var(--primary-color);
    z-index: 1;
}

.filter-btn span {
    position: relative;
    z-index: 2;
}

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

/* Projects Gallery */
.projects-gallery {
    padding: 5rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    opacity: 1;
    transform: scale(1);
}

.project-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    pointer-events: none;
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

/* Before/After Container */
.before-after-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    cursor: ew-resize;
}

.before-img,
.after-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.after-img {
    clip-path: inset(0 0 0 50%);
}

.before-after-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    background-color: white;
    transform: translateX(-50%);
    cursor: ew-resize;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-handle::before,
.slider-handle::after {
    content: '<';
    position: absolute;
    font-size: 12px;
    color: var(--primary-color);
}

.slider-handle::before {
    left: 8px;
}

.slider-handle::after {
    content: '>';
    right: 8px;
}

/* Project Info */
.project-info {
    padding: 2rem;
}

.project-info h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.view-details {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.view-details:hover {
    background-color: var(--secondary-color);
    transform: translateX(5px);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    gap: 2rem;
    align-items: center;
    animation: lightboxZoom 0.3s ease;
}

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

.lightbox-content img {
    max-width: 60%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-info {
    flex: 1;
    color: white;
    padding: 2rem;
}

.lightbox-info h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.lightbox-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.lightbox-details {
    display: grid;
    gap: 1rem;
}

.lightbox-details p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
    .filter-buttons {
        padding: 0 1rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-content {
        flex-direction: column;
        padding: 1rem;
    }

    .lightbox-content img {
        max-width: 100%;
        max-height: 50vh;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }
}

/* Performance optimizations */
.project-card {
    will-change: transform, opacity;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card {
    animation: slideIn 0.6s ease backwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }