/* Showcase Gallery Styles */

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    padding: 1.25rem 0;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #0f172a;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transition: transform 0.45s ease, box-shadow 0.45s ease;
    cursor: pointer;
    isolation: isolate;
}

/* Mor hover efekti kaldırıldı; nötr hafif yükselme */
.gallery-item::after {
    display: none;
}

.gallery-item:hover {
    transform: translateY(-4px) scale(1.012);
    box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.gallery-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: transform .6s ease, filter .6s ease;
    filter: brightness(0.92) saturate(1.05);
}

.gallery-item:hover img {
    transform: scale(1.07);
    filter: brightness(1.02) saturate(1.15);
}

/* Minimal Hover Icon */
.gallery-hover-icon {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.75) 0%, rgba(15, 23, 42, 0.85) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    opacity: 0;
    transform: translateY(6px) scale(.9);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transition: opacity .45s ease, transform .45s ease;
    z-index: 2;
}

.gallery-item:hover .gallery-hover-icon {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.gallery-hover-icon i {
    pointer-events: none;
}

/* Modal Revamp */
/* Lightbox Inspired Modal */
.modal.fade.show {
    background: linear-gradient(rgba(8, 11, 19, 0.94), rgba(8, 11, 19, 0.94));
    backdrop-filter: blur(6px);
}

/* Navbar'ı gizlemek yerine modalı en üste taşı: Daha yüksek z-index */
.modal {
    z-index: 2000;
}

.modal-dialog {
    max-width: 100vw;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    min-height: 100dvh;
}

.modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
}

.modal-body {
    padding: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-wrapper {
    position: relative;
    width: 100%;
    text-align: center;
}

.modal-image {
    width: auto;
    max-width: 92vw;
    height: auto;
    max-height: 86dvh;
    object-fit: contain;
    border-radius: 14px;
    background: #0f172a;
    box-shadow: 0 18px 60px -18px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .04) inset;
    animation: modalIn .45s cubic-bezier(.16, .84, .44, 1);
}

@keyframes modalIn {
    from {
        transform: scale(.94);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scroll / Layout Stabilization for Lightbox */
html {
    scroll-behavior: smooth;
}

@supports (scrollbar-gutter: stable) {
    html {
        scrollbar-gutter: stable;
    }
}

body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

.modal {
    overflow: hidden;
}

.modal-dialog {
    min-height: 0;
    height: 100dvh;
}

.modal-body {
    overflow: hidden;
}

/* Hide any incidental vertical scroll in WebKit (double scrollbar issue) */
.modal::-webkit-scrollbar {
    width: 0;
    height: 0;
}


/* Modal Navigation */
/* Navigation Buttons Edge */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 28, 45, 0.78);
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.45);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .35s;
    z-index: 1060;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 38px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .05) inset;
}

.modal-nav:hover {
    background: rgba(30, 38, 60, 0.9);
    border-color: rgba(139, 92, 246, 0.75);
    transform: translateY(-50%) scale(1.09);
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(20, 28, 45, 0.78);
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.45);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    transition: .35s;
    z-index: 1060;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 34px -10px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .05) inset;
}

.modal-close:hover {
    background: rgba(30, 38, 60, 0.9);
    border-color: rgba(139, 92, 246, 0.75);
    transform: scale(1.08) rotate(6deg);
}

.modal-caption {
    position: absolute;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    background: rgba(20, 28, 45, 0.78);
    color: #fff;
    padding: .7rem 1rem .8rem;
    text-align: center;
    border-radius: 14px;
    font-size: .78rem;
    line-height: 1.25;
    box-shadow: 0 6px 28px -10px rgba(0, 0, 0, .6), 0 0 0 1px rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(6px);
    max-width: min(70ch, 78vw);
    pointer-events: none;
}

.modal-caption #modalCounter {
    font-size: .68rem;
    letter-spacing: .08em;
    opacity: 1;
    margin-top: .4rem;
    display: block;
    color: #fff !important;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 0.9375rem;
    }

    .gallery-item img {
        height: 200px;
    }

    .modal-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .modal-nav.prev {
        left: 10px;
    }

    .modal-nav.next {
        right: 10px;
    }

    .modal-body {
        padding: 0 2vw;
    }

    .modal-image {
        max-height: 80dvh;
    }

    .modal-nav {
        width: 54px;
        height: 54px;
    }

    .modal-close {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .modal-caption {
        bottom: 24px;
        font-size: .72rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.9375rem;
    }

    .gallery-overlay-content i {
        font-size: 2rem;
    }

    .gallery-overlay-content .title {
        font-size: 1rem;
    }
}