.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border: 2px solid #0000ff; 
    box-shadow: 0 0 15px #0000ff, 0 0 30px #0000ff, 0 0 45px #0000ff; 
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
    overflow: hidden; 
}

.lightbox-img.cyberpunk-open {
    animation: cyberpunk-color-transition 2s ease-in-out forwards, glitch-distort 1s infinite alternate;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(255, 255, 0, 0.15) 2px, rgba(255, 255, 0, 0.15) 4px); /* Yellow-tinted scanlines */
    background-size: 100% 4px;
    animation: scanlines 0.5s linear infinite, glitch-distort 1s infinite alternate, cyberpunk-color-transition 2s ease-in-out forwards;
}

.lightbox-img.cyberpunk-open::before,
.lightbox-img.cyberpunk-open::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    opacity: 0.5;
    z-index: -1;
}

.lightbox-img.cyberpunk-open::before {
    animation: glitch-blue 0.5s infinite;
    background-color: rgba(0, 0, 255, 0.2); 
    transform: translate(2px, 0);
}

.lightbox-img.cyberpunk-open::after {
    animation: glitch-yellow 0.5s infinite reverse;
    background-color: rgba(255, 255, 0, 0.2); 
    transform: translate(-2px, 0);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    text-shadow: 0 0 5px #ffff00; 
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@keyframes cyberpunk-color-transition {
    0% {
        border-color: #0000ff; 
        box-shadow: 0 0 15px #0000ff, 0 0 30px #0000ff, 0 0 45px #0000ff;
        filter: hue-rotate(210deg) brightness(1.2); 
    }
    50% {
        border-color: #00ffff; 
        box-shadow: 0 0 15px #00ffff, 0 0 30px #00ffff, 0 0 45px #00ffff;
        filter: hue-rotate(180deg) brightness(1.5);
    }
    100% {
        border-color: #ffff00; 
        box-shadow: 0 0 15px #ffff00, 0 0 30px #ffff00, 0 0 45px #ffff00;
        filter: hue-rotate(60deg) brightness(1.2);
    }
}

@keyframes cyberpunk-open {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(5deg);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
        filter: blur(0);
    }
}

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 4px;
    }
}

@keyframes glitch-distort {
    0% {
        clip-path: inset(0 0 0 0);
    }
    20% {
        clip-path: inset(10% 0 15% 0);
        transform: skew(0.5deg);
    }
    40% {
        clip-path: inset(5% 0 20% 0);
        transform: skew(-0.5deg);
    }
    60% {
        clip-path: inset(15% 0 10% 0);
    }
    80% {
        clip-path: inset(20% 0 5% 0);
        transform: skew(0.3deg);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes glitch-blue {
    0% { transform: translate(2px, 1px); }
    50% { transform: translate(-2px, -1px); }
    100% { transform: translate(2px, 1px); }
}

@keyframes glitch-yellow {
    0% { transform: translate(-2px, -1px); }
    50% { transform: translate(2px, 1px); }
    100% { transform: translate(-2px, -1px); }
}

@media screen and (max-width: 700px) {
    .lightbox-img {
        max-width: 100%;
        max-height: 80%;
    }
    .close-btn {
        font-size: 30px;
        top: 10px;
        right: 20px;
    }
}