#portfolio {
    background: linear-gradient(0deg, #184e65 0%, #0a0f1e 100%);
}

#portfolio .inner {
    position: relative;
    z-index: 1;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 3rem;
}

/* Portfolio Tabs */
.portfolio-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tab-button {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(107, 165, 214, 0.35);
    color: var(--off-white);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tab-button:hover {
    border-bottom-color: var(--bleu-ciel);
    transform: translateY(-2px);
}

.tab-button.active {
    border-bottom-color: var(--bleu-ciel);
}

/* Portfolio Grid - Masonry Layout */
.grid {
    display: none;
    margin: 0;
    padding: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: relative;
    width: 100%;
}

.grid.active {
    display: block;
}

.grid.active.visible {
    opacity: 1;
}

.grid-sizer,
.grid-item { 
    width: 23.5%; /* 4 columns */
}

.gutter-sizer {
    width: 2%;
}

.grid-item {
    position: relative;
    float: left;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2%;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(24, 78, 101, 0.4);
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.grid-item:hover img {
    transform: scale(1.05);
}

/* Portfolio Overlay */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(24, 78, 101, 0.9) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-title {
    color: var(--off-white);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Video Item Specific */
.video-item .portfolio-overlay {
    background: linear-gradient(to top, rgba(24, 78, 101, 0.95) 0%, rgba(10, 15, 30, 0.7) 100%);
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: lightboxFadeIn 0.3s ease;
}

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

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: lightboxZoomIn 0.3s ease;
}

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

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 5px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    will-change: transform;
}

.lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--off-white);
    font-size: 1.2rem;
    padding: 1rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    z-index: 10001;
    object-fit: contain;
    opacity: 0.9;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8));
}

.lightbox-close {
    width: 25px;
    height: 25px;
    top: 20px;
    right: 40px;
}

.lightbox-prev,
.lightbox-next {
    width: 35px;
    height: 35px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
    transform: scale(1.15);
}

.lightbox-prev {
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.15);
}

.lightbox-next {
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
}

