/* Base Styles */
.portfolio-section {
    background-color: #1a1a1a;
    color: #fff;
    padding: 60px 0;
    font-family: 'Arial', sans-serif;
}

.portfolio-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.portfolio-navigation {
    margin-bottom: 40px;
}

.portfolio-nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.portfolio-nav-list li {
    margin: 0 15px;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #4CAF50;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Project Title */
.project-title {
    text-align: center;
    margin: 20px 0 30px;
    font-size: 32px;
    color: #4CAF50;
    position: relative;
    padding-bottom: 15px;
}

.project-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background-color: #4CAF50;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Image Gallery - 3×2 Grid */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 300px);
    gap: 20px;
    margin: 0 40px 60px; /* 40px left/right margin */
    padding: 0 20px;
    /* margin-bottom: 60px; */
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Different sizes for grid items */
.gallery-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}
.gallery-item:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}
.gallery-item:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
}
.gallery-item:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
}
.gallery-item:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
}
.gallery-item:nth-child(6) {
    grid-column: 3;
    grid-row: 2;
}

/* Make first and last items in each row larger */
.gallery-item:nth-child(1),
.gallery-item:nth-child(3),
.gallery-item:nth-child(5) {
    height: 350px;
}

/* Make middle items in each row smaller */
.gallery-item:nth-child(2),
.gallery-item:nth-child(4),
.gallery-item:nth-child(6) {
    height: 250px;
    margin-top: 50px;    /* Offset for visual interest */
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.gallery-figure {
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-thumb {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .image-overlay {
    opacity: 1;
}

.zoom-icon {
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.gallery-item:hover .zoom-icon {
    transform: scale(1.2);
}

/* CTA Button */
.cta-buttons {
    text-align: center;
    margin-top: 50px;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: transparent;
    color: #4CAF50;
    border: 2px solid #4CAF50;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    background-color: #4CAF50;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

#lightbox-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: #4CAF50;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s;
    cursor: pointer;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 0 3px 3px 0;
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: #4CAF50;
}

.lightbox-caption {
    text-align: center;
    color: #fff;
    padding: 10px 0;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
}

#lightbox-counter {
    color: #aaa;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 250px);
    }
    
    /* Reassign grid positions for tablet */
    .gallery-item:nth-child(1) { grid-column: 1; grid-row: 1; }
    .gallery-item:nth-child(2) { grid-column: 2; grid-row: 1; }
    .gallery-item:nth-child(3) { grid-column: 1; grid-row: 2; }
    .gallery-item:nth-child(4) { grid-column: 2; grid-row: 2; }
    .gallery-item:nth-child(5) { grid-column: 1; grid-row: 3; }
    .gallery-item:nth-child(6) { grid-column: 2; grid-row: 3; }
    
    /* Reset heights for tablet */
    .gallery-item {
        height: 250px !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 768px) {
    .project-title {
        font-size: 28px;
    }
    
    .lightbox-content {
        width: 95%;
    }
}

@media (max-width: 576px) {
    .image-gallery {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 250px);
    }
    
    /* Reassign grid positions for mobile */
    .gallery-item:nth-child(1) { grid-column: 1; grid-row: 1; }
    .gallery-item:nth-child(2) { grid-column: 1; grid-row: 2; }
    .gallery-item:nth-child(3) { grid-column: 1; grid-row: 3; }
    .gallery-item:nth-child(4) { grid-column: 1; grid-row: 4; }
    .gallery-item:nth-child(5) { grid-column: 1; grid-row: 5; }
    .gallery-item:nth-child(6) { grid-column: 1; grid-row: 6; }
    
    .portfolio-nav-list {
        flex-direction: column;
        align-items: center;
    }
    
    .portfolio-nav-list li {
        margin: 5px 0;
    }
}