/* Gallery Grid Layout */
.pgd-gallery-wrapper {
    margin: 20px 0;
}

.pgd-gallery-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.pgd-gallery-grid[data-columns="1"] {
    grid-template-columns: repeat(1, 1fr);
}

.pgd-gallery-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.pgd-gallery-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.pgd-gallery-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.pgd-gallery-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.pgd-gallery-grid[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* Gallery Item */
.pgd-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: #fff;
}

.pgd-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.pgd-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.pgd-gallery-item:hover img {
    transform: scale(1.05);
}

/* Overlay with Download Button */
.pgd-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pgd-gallery-item:hover .pgd-overlay {
    opacity: 1;
}

.pgd-download-btn {
    background: #007cba;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.pgd-download-btn:hover {
    background: #005a87;
    transform: scale(1.1);
}

.pgd-download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pgd-download-btn svg {
    width: 20px;
    height: 20px;
}

/* Lightbox Styles */
.pgd-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pgd-lightbox-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#pgd-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.pgd-lightbox-info {
    text-align: center;
    margin-top: 20px;
}

.pgd-lightbox-caption {
    color: white;
    font-size: 18px;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.pgd-lightbox-download {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    font-weight: 500;
}

.pgd-lightbox-download:hover {
    background: #005a87;
}

.pgd-lightbox-download:disabled {
    background: #666;
    cursor: not-allowed;
}

/* Navigation Arrows */
.pgd-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 36px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.pgd-nav:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);

}

.pgd-prev {
    left: 20px;
}

.pgd-next {
    right: 20px;
}

/* Close Button */
.pgd-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgd-close:hover {
    color: #ccc;
    transform: scale(1.1);
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pgd-loading {
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pgd-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .pgd-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .pgd-gallery-item img {
        height: 150px;
    }
    
    .pgd-nav {
        font-size: 24px;
        padding: 10px 15px;
    }
    
    .pgd-prev {
        left: 10px;
    }
    
    .pgd-next {
        right: 10px;
    }
    
    .pgd-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    
    .pgd-lightbox-content {
        padding: 10px;
    }
    
    #pgd-lightbox-img {
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .pgd-gallery-grid {
        grid-template-columns: 1fr !important;
    }
    
    .pgd-gallery-item img {
        height: 200px;
    }
    
    .pgd-nav {
        font-size: 20px;
        padding: 8px 12px;
    }
    
    .pgd-lightbox-caption {
        font-size: 16px;
    }
    
    .pgd-lightbox-download {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Accessibility */
.pgd-nav:focus,
.pgd-close:focus,
.pgd-download-btn:focus,
.pgd-lightbox-download:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pgd-gallery-item,
    .pgd-gallery-item img,
    .pgd-download-btn,
    .pgd-nav,
    .pgd-close {
        transition: none;
    }
    
    .pgd-lightbox {
        animation: none;
    }
}