/* PhotoSwipe 5 Styles */
.pswp {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.pswp__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.pswp__scroll-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.pswp__container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.pswp__item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.pswp__img {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
}

/* Gallery Grid */
.pswp-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

@media (min-width: 768px) {
    .pswp-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* UI Controls */
.pswp__ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pswp__ui--hidden {
    opacity: 0;
    pointer-events: none;
}

/* Top Bar */
.pswp__top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 44px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: auto;
}

.pswp__counter {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

/* Buttons */
.pswp__button {
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    pointer-events: auto;
}

.pswp__button:hover {
    opacity: 0.7;
}

.pswp__button--close::before {
    font-size: 32px;
    font-weight: bold;
}

.pswp__button--arrow--left::before {
    content: "‹";
    font-size: 32px;
    font-weight: bold;
}

.pswp__button--arrow--right::before {
    content: "›";
    font-size: 32px;
    font-weight: bold;
}

.pswp__button--fs::before {
    content: "⤢";
    font-size: 20px;
}

.pswp__button--zoom::before {
    content: "🔍";
    font-size: 20px;
}

/* Caption */
.pswp__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    text-align: center;
    pointer-events: auto;
}

.pswp__caption__center {
    font-size: 16px;
    line-height: 1.4;
}

/* Preloader */
.pswp__preloader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
}

.pswp__preloader__icn {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Gallery item hover effects */
.gallery-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pswp__top-bar {
        height: 50px;
        padding: 0 15px;
    }
    
    .pswp__button {
        width: 50px;
        height: 50px;
    }
    
    .pswp__caption {
        padding: 15px;
    }
    
    .pswp__caption__center {
        font-size: 14px;
    }
    
    .pswp-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* PhotoSwipe 5 specific overrides */
.pswp__img {
    transition: transform 0.3s ease;
}

.pswp__img--placeholder {
    background: #f0f0f0;
}

/* Zoom controls */
.pswp__zoom-controls {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.pswp__zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.pswp__zoom-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Navigation arrows */
.pswp__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    pointer-events: auto;
}

.pswp__arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.pswp__arrow--left {
    left: 20px;
}

.pswp__arrow--right {
    right: 20px;
}

.pswp__arrow::before {
    font-weight: bold;
}

.pswp__arrow--left::before {
    content: "‹";
}

.pswp__arrow--right::before {
    content: "›";
}
