/* =========================================
   PREMIUM PORTFOLIO REDESIGN
   ========================================= */

:root {
    --p-glow: rgba(0, 71, 255, 0.5);
    --p-card-bg: rgba(20, 20, 20, 0.4);
    --p-accent: #0047ff;
    --p-glass: rgba(255, 255, 255, 0.03);
    --p-blackmark: #ffffffb3;
}

.portfolio {
    padding: 110px 0 110px;
    background: #000;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Background Decorative Elements */
.portfolio::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 40%;
    height: 60%;
    background: radial-gradient(circle, var(--p-glow) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
}

.portfolio::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50%;
    height: 70%;
    background: radial-gradient(circle, rgba(125, 0, 255, 0.2) 0%, transparent 70%);
    opacity: 0.1;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

.portfolio-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 2;
}

/* Header Styling */
.portfolio-header {
    text-align: center;
    margin-bottom: 80px;
}

/* Premium Filter Buttons */
.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 80px;
}

.filter-btn {
    padding: 14px 28px;
    background: var(--p-glass);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    /* Structured feel */
    color: rgba(255, 255, 255, 0.6);
    font-family: "Source Code Pro", monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--p-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.filter-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.filter-btn.active {
    color: #fff;
    background: rgba(0, 71, 255, 0.1);
    border-color: var(--p-accent);
}

.filter-btn.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Grid Design - Masonry Feel */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 30px;
}

.portfolio-item {
    position: relative;
    background: #0a0a0a;
    border-radius: 8px;
    overflow: hidden;
    height: 500px;
    /* Fixed height for consistency or adjust as needed */
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.portfolio-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    border-radius: inherit;
    background: linear-gradient(45deg, var(--p-accent), transparent 40%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.portfolio-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 71, 255, 0.1);
}

.portfolio-item:hover::before {
    opacity: 0.5;
}

.portfolio-item img {
    width: 100%;
    height: auto;
    /* Allow image to be long */
    object-fit: cover;
    display: block;
    transition: transform 6s cubic-bezier(0.4, 0, 0.2, 1);
    /* Slower for elegant scroll */
}

.portfolio-item:hover img {
    /* Scrolls the image up to the bottom, showing the full mockup */
    transform: translateY(calc(-100% + 500px));
}

/* Modern Overlay */
.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-cat {
    font-family: "Source Code Pro", monospace;
    font-size: 15px;
    color: var(--p-blackmark);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
    display: block;
}

.portfolio-proj-title {
    font-family: "Manrope", sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
}

.view-more {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.portfolio-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    font-weight: 500;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.portfolio-link:hover {
    opacity: 1;
}

.portfolio-link i {
    font-size: 14px;
    color: var(--p-accent);
}

/* =========================================
2. Lightbox Overlay Styles (NO BORDERS) - COMMENTED OUT
=========================================
#custom-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#custom-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content-wrapper {
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    max-width: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#custom-lightbox.active .lightbox-content-wrapper {
    transform: scale(1);
}

.img-zoom-container.zoomed {
    transform: scale(1);
    width: 95vw;
    height: 85vh;
}

.img-zoom-container {
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: default;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transition: width 0.3s ease, height 0.3s ease;
}

.img-zoom-container.is-zoomable {
    cursor: zoom-in;
}

.img-zoom-container.is-zoomable.zoomed {
    cursor: zoom-out;
}

#custom-lightbox img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    transform-origin: center center;
    background: transparent;
}

#custom-lightbox img.zoomed-img {
    transform: scale(2.5);
}

.lightbox-caption {
    margin-top: 15px;
    color: #ffffff;
    font-family: sans-serif;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.5px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    user-select: none;
    padding: 20px;
    transition: color 0.2s;
}

.lightbox-nav:hover {
    color: white;
}

.lightbox-prev {
    left: 2%;
}

.lightbox-next {
    right: 2%;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: white;
}
*/

/* Responsive */
@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .portfolio {
        padding: 60px 0;
    }

    .portfolio-container {
        padding: 0 16px;
    }

    .portfolio-filters {
        gap: 8px;
        margin-bottom: 40px;
    }

    .filter-btn {
        padding: 10px 16px;
        font-size: 11px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .portfolio-item {
        height: 280px;
    }

    .portfolio-overlay {
        padding: 16px;
    }

    .portfolio-cat {
        font-size: 11px;
        letter-spacing: 1px;
        margin-bottom: 6px;
    }

    .portfolio-proj-title {
        font-size: 16px;
        margin-bottom: 8px;
        line-height: 1.2;
    }

    .portfolio-link {
        font-size: 10px;
        gap: 6px;
    }

    .portfolio-link i {
        font-size: 10px;
    }

    .portfolio-item:hover img {
        transform: translateY(calc(-100% + 280px));
    }

    .portfolio-title {
        font-size: 32px;
        line-height: normal;
    }
}