/* ==================== PREMIUM LIGHTBOX MODAL ==================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.98);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.95) 100%);
}

.lightbox-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    /* display, flex-direction, align-items, justify-content, padding now handled by Bootstrap classes */
}

/* ==================== CLOSE BUTTON ==================== */
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
    color: var(--primary-white);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* display, align-items, justify-content now handled by Bootstrap classes */
    z-index: 100;
    backdrop-filter: blur(20px);
}

.lightbox-close:hover {
    background: var(--gradient-magenta);
    border-color: var(--magenta);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 30px rgba(255, 0, 162, 0.5);
}

/* ==================== NAVIGATION BUTTONS ==================== */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
    color: var(--primary-white);
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* display, align-items, justify-content now handled by Bootstrap classes */
    z-index: 100;
    backdrop-filter: blur(20px);
}

.lightbox-prev {
    left: 2.5rem;
}

.lightbox-next {
    right: 2.5rem;
}

.lightbox-nav:hover {
    background: var(--gradient-magenta);
    border-color: var(--magenta);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 0 40px rgba(255, 0, 162, 0.5);
}

.lightbox-nav:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==================== CONTENT AREA ==================== */
.lightbox-content {
    max-width: 85vw;
    max-height: 80vh;
    /* display, flex-direction, align-items now handled by Bootstrap classes */
    animation: lightboxZoomIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes lightboxZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

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

.lightbox-image-wrapper {
    position: relative;
    /* display, align-items, justify-content now handled by Bootstrap classes */
    max-width: 100%;
    max-height: 72vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.lightbox-image {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 16px;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox-image.loaded {
    opacity: 1;
    transform: scale(1);
}

/* ==================== LOADER ==================== */
.lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.lightbox-loader.active {
    display: block;
}

.lightbox-loader .loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--magenta);
    border-radius: 50%;
    animation: lightboxSpin 0.8s linear infinite;
}

@keyframes lightboxSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== INFO SECTION ==================== */
.lightbox-info {
    /* text-align and padding now handled by Bootstrap classes */
    max-width: 700px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin-top: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-white);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.lightbox-description {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
    line-height: 1.6;
}

/* ==================== COUNTER ==================== */
.lightbox-counter {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    padding: 0.7rem 2rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--primary-white);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    z-index: 50;
}

.lightbox-counter span:first-child {
    color: var(--magenta);
}

/* ==================== THUMBNAILS STRIP ==================== */
.lightbox-thumbnails {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    /* display and gap now handled by Bootstrap classes */
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(30px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 85vw;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--magenta) transparent;
    z-index: 50;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: var(--gradient-magenta);
    border-radius: 10px;
}

.lightbox-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.4;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.lightbox-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.lightbox-thumb:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.lightbox-thumb:hover::after {
    background: transparent;
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: var(--magenta);
    box-shadow:
        0 0 20px rgba(255, 0, 162, 0.5),
        0 0 40px rgba(255, 0, 162, 0.3);
    transform: scale(1.08);
}

.lightbox-thumb.active::after {
    background: transparent;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== TOUCH SWIPE HINT ==================== */
.lightbox-touch-hint {
    position: absolute;
    bottom: 7rem;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 30px;
    animation: fadeOut 4s forwards;
}

.lightbox-touch-hint i {
    animation: swipeHint 1.5s ease-in-out infinite;
}

@keyframes swipeHint {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(10px);
    }
}

@media (max-width: 768px) {
    .lightbox-touch-hint {
        display: flex;
    }
}

@keyframes fadeOut {

    0%,
    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* ==================== SLIDE TRANSITION EFFECTS ==================== */
.lightbox-image.slide-left {
    animation: slideOutLeft 0.4s ease forwards;
}

.lightbox-image.slide-right {
    animation: slideOutRight 0.4s ease forwards;
}

.lightbox-image.slide-in-left {
    animation: slideInLeft 0.4s ease forwards;
}

.lightbox-image.slide-in-right {
    animation: slideInRight 0.4s ease forwards;
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(-100px) scale(0.9);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-100px) scale(0.9);
    }

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .lightbox-nav {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .lightbox-prev {
        left: 1.5rem;
    }

    .lightbox-next {
        right: 1.5rem;
    }

    .lightbox-thumbnails {
        bottom: 1.5rem;
        padding: 0.75rem 1rem;
    }

    .lightbox-thumb {
        width: 65px;
        height: 48px;
    }

    .lightbox-info {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .lightbox-container {
        padding: 1rem;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .lightbox-nav {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .lightbox-prev {
        left: 0.75rem;
    }

    .lightbox-next {
        right: 0.75rem;
    }

    .lightbox-content {
        max-height: 70vh;
    }

    .lightbox-image,
    .lightbox-image-wrapper {
        max-height: 55vh;
    }

    .lightbox-title {
        font-size: 1.25rem;
    }

    .lightbox-description {
        font-size: 0.95rem;
    }

    .lightbox-thumbnails {
        display: none;
    }

    .lightbox-counter {
        top: auto;
        bottom: 1.25rem;
        font-size: 0.9rem;
        padding: 0.5rem 1.5rem;
    }

    .lightbox-info {
        margin-top: 1rem;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .lightbox-container {
        padding: 0.75rem;
    }
    
    .lightbox-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .lightbox-prev {
        left: 0.35rem;
    }

    .lightbox-next {
        right: 0.35rem;
    }

    .lightbox-image,
    .lightbox-image-wrapper {
        max-height: 50vh;
        border-radius: 12px;
    }

    .lightbox-info {
        border-radius: 12px;
        margin-top: 0.75rem;
        padding: 0.6rem 0.8rem;
    }

    .lightbox-title {
        font-size: 1.05rem;
    }

    .lightbox-description {
        font-size: 0.85rem;
    }
    
    .lightbox-counter {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
}

/* Extra small devices (320px and below) */
@media (max-width: 320px) {
    .lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .lightbox-close {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .lightbox-image,
    .lightbox-image-wrapper {
        max-height: 45vh;
    }
    
    .lightbox-title {
        font-size: 1rem;
    }
}

/* Safe area support for devices with notch */
@supports (padding: max(0px)) {
    .lightbox-container {
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
    }
    
    .lightbox-close {
        top: max(1rem, env(safe-area-inset-top));
        right: max(1rem, env(safe-area-inset-right));
    }
    
    @media (max-width: 768px) {
        .lightbox-counter {
            bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + 0.5rem));
        }
    }
}