/* Preserved Header Styles */
.gallery-header-section {
    background: linear-gradient(135deg, var(--dark-color, #000000) 0%, #111827 50%, var(--dark-color, #000000) 100%);
    padding: 128px 0 64px 0;
    color: var(--light-color, #FFFFFF);
    margin-bottom: 40px;
}

.gallery-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.gallery-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Common Gallery Styles */
.gallery-container {
    width: 100%;
    padding: 0 15px;
    /* Equal gaps left/right */
    margin: 0 auto;
    box-sizing: border-box;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    /* Smoother corners */
    margin-bottom: 24px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Overlay & Magnifying Glass */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(2px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.magnifying-glass {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 15px;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover .magnifying-glass {
    transform: scale(1);
}

.gallery-info {
    transform: translateY(20px);
    transition: transform 0.3s ease;
    padding: 0 20px;
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
}

.gallery-info h5 {
    color: white;
    margin: 0 0 5px 0;
    font-size: 1.25rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gallery-info p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Navigation Controls */
.gallery-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.gallery-prev,
.gallery-next {
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 1.2rem;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: var(--primary-color, #dc2626);
    color: white;
    transform: scale(1.1);
}

/* --- LIGHTBOX STYLES --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-caption {
    color: white;
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.2s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    transform: scale(1.2) rotate(90deg);
    color: var(--primary-color, #dc2626);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

@media (max-width: 768px) {

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        padding: 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 2rem;
    }
}

/* --- STYLES --- */

/* Grid Style */
.grid-style {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.grid-style .gallery-item {
    height: 280px;
    margin-bottom: 0;
}

/* Masonry Style */
.masonry-style {
    column-count: 3;
    column-gap: 24px;
}

.masonry-style .gallery-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 24px;
}

/* List Style - Professional */
.list-style {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.list-style .gallery-item {
    display: flex;
    height: 240px;
    background: white;
    border: 1px solid #eee;
}

.list-style .gallery-item img {
    width: 40%;
    height: 100%;
}

.list-style .gallery-overlay {
    position: relative;
    background: none;
    opacity: 1;
    width: 60%;
    backdrop-filter: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px;
    text-align: left;
}

.list-style .magnifying-glass {
    display: none;
    /* Hide icon in list view as info is always visible */
}

.list-style .gallery-info {
    transform: none;
    padding: 0;
}

.list-style .gallery-info h5 {
    color: #1f2937;
    font-size: 1.8rem;
    margin-bottom: 12px;
    text-shadow: none;
}

.list-style .gallery-info p {
    color: #6b7280;
    font-size: 1.1rem;
    text-shadow: none;
}

/* Slider Style - Professional */
.slider-style {
    display: flex;
    overflow-x: auto;
    gap: 30px;
    padding: 40px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Hide scrollbar */
}

.slider-style::-webkit-scrollbar {
    display: none;
}

.slider-style .gallery-item {
    flex: 0 0 80%;
    /* Mobile */
    height: 500px;
    scroll-snap-align: center;
    margin-bottom: 0;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .slider-style .gallery-item {
        flex: 0 0 45%;
        /* Desktop */
    }
}

/* Carousel Style - Professional */
.carousel-style {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 40px 0;
    scroll-snap-type: x mandatory;
}

.carousel-style .gallery-item {
    flex: 0 0 300px;
    height: 400px;
    scroll-snap-align: start;
    margin-bottom: 0;
    border-radius: 16px;
}

/* Showcase Style - Refined (Top Row, Center Featured, Bottom Row) */
.showcase-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.showcase-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    height: 150px;
    /* Small height for rows */
}

.showcase-row .gallery-item {
    height: 100%;
    margin-bottom: 0;
    border-radius: 8px;
    animation: fadeIn 0.5s ease-in-out;
}

.showcase-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    /* Larger height for featured */
    position: relative;
}

.featured-slider {
    width: 100%;
    max-width: 800px;
    height: 100%;
    position: relative;
}

.showcase-center .gallery-item {
    width: 100%;
    height: 100%;
    margin-bottom: 0;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: absolute;
    /* Stack them */
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    z-index: 1;
}

.showcase-center .gallery-item.active {
    opacity: 1;
    z-index: 2;
    transform: scale(1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .showcase-row {
        grid-template-columns: repeat(2, 1fr);
        /* 2 per row on mobile */
        height: auto;
    }

    .showcase-row .gallery-item {
        height: 120px;
    }

    .showcase-center {
        height: 300px;
    }
}

/* Coverflow Style - Professional */
.coverflow-style {
    display: flex;
    overflow-x: auto;
    padding: 60px 0;
    perspective: 1000px;
    gap: 0;
    /* Overlap handled by transform */
}

.coverflow-style .gallery-item {
    flex: 0 0 300px;
    height: 400px;
    margin: 0 20px;
    transition: all 0.5s ease;
    /* Transform handled by JS */
}

/* Other Styles (Polaroid, Mosaic, Hexagon, Cube) - Kept as is or slightly refined */
.polaroid-style {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding: 40px;
}

.polaroid-style .gallery-item {
    background: white;
    padding: 15px 15px 60px 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
    width: 320px;
    height: auto;
}

.mosaic-style {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    gap: 15px;
}

.hexagon-style {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 40px;
    gap: 10px;
}

.cube-style {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .gallery-header-section {
        padding: 80px 0 40px 0;
    }

    .gallery-title {
        font-size: 2rem;
    }

    .showcase-style {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .showcase-style .gallery-item {
        position: relative;
        opacity: 1;
        width: 100%;
        height: 300px;
        transform: none !important;
        margin-bottom: 20px;
    }

    .list-style .gallery-item {
        flex-direction: column;
        height: auto;
    }

}

/* Carousel Style - Professional */
.carousel-style {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 40px 0;
    scroll-snap-type: x mandatory;
}

.carousel-style .gallery-item {
    flex: 0 0 300px;
    height: 400px;
    scroll-snap-align: start;
    margin-bottom: 0;
    border-radius: 16px;
}

/* Showcase Style - Refined (Top Row, Center Featured, Bottom Row) */
.showcase-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.showcase-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    height: 150px;
    /* Small height for rows */
}

.showcase-row .gallery-item {
    height: 100%;
    margin-bottom: 0;
    border-radius: 8px;
    animation: fadeIn 0.5s ease-in-out;
}

.showcase-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    /* Larger height for featured */
    position: relative;
}

.featured-slider {
    width: 100%;
    max-width: 800px;
    height: 100%;
    position: relative;
}

.showcase-center .gallery-item {
    width: 100%;
    height: 100%;
    margin-bottom: 0;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: absolute;
    /* Stack them */
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    z-index: 1;
}

.showcase-center .gallery-item.active {
    opacity: 1;
    z-index: 2;
    transform: scale(1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .showcase-row {
        grid-template-columns: repeat(2, 1fr);
        /* 2 per row on mobile */
        height: auto;
    }

    .showcase-row .gallery-item {
        height: 120px;
    }

    .showcase-center {
        height: 300px;
    }
}

/* Coverflow Style - Professional */
.coverflow-style {
    display: flex;
    overflow-x: auto;
    padding: 60px 0;
    perspective: 1000px;
    gap: 0;
    /* Overlap handled by transform */
}

.coverflow-style .gallery-item {
    flex: 0 0 300px;
    height: 400px;
    margin: 0 20px;
    transition: all 0.5s ease;
    /* Transform handled by JS */
}

/* Other Styles (Polaroid, Mosaic, Hexagon, Cube) - Kept as is or slightly refined */
.polaroid-style {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding: 40px;
}

.polaroid-style .gallery-item {
    background: white;
    padding: 15px 15px 60px 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
    width: 320px;
    height: auto;
}

.mosaic-style {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    gap: 15px;
}

.hexagon-style {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 40px;
    gap: 10px;
}

.cube-style {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .gallery-header-section {
        padding: 80px 0 40px 0;
    }

    .gallery-title {
        font-size: 2rem;
    }

    .showcase-style {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .showcase-style .gallery-item {
        position: relative;
        opacity: 1;
        width: 100%;
        height: 300px;
        transform: none !important;
        margin-bottom: 20px;
    }

    .list-style .gallery-item {
        flex-direction: column;
        height: auto;
    }

    .list-style .gallery-item img {
        width: 100%;
        height: 250px;
    }

    .list-style .gallery-overlay {
        width: 100%;
        padding: 20px;
    }
}

/* Showcase 2 Specifics */
.showcase-2-container {
    position: relative;
    padding: 0 60px;
    /* Make room for arrows */
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    transition: all 0.2s;
}

.nav-arrow:hover {
    background: var(--primary-color, #dc2626);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow.prev {
    left: 0;
}

.nav-arrow.next {
    right: 0;
}

.showcase-2-container .showcase-center .gallery-item {
    /* Ensure center item in Showcase 2 behaves well */
    position: relative;
    /* Not absolute like the slider version */
    opacity: 1;
    transform: none;
}