/* Showcase Gallery Pro - Frontend Styles */

.sgp-gallery-wrapper {
    width: 100%;
}

/* Filters */
.sgp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.sgp-filter-btn {
    padding: 10px 20px;
    background: #f3f3f3;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.sgp-filter-btn:hover {
    background: #e9e9e9;
    border-color: #ccc;
}

.sgp-filter-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Gallery Grid */
.sgp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .sgp-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sgp-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Gallery Item */
.sgp-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
    transition: transform 0.3s, box-shadow 0.3s;
}

.sgp-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.sgp-item a {
    display: block;
    position: relative;
    text-decoration: none;
}

/* Thumbnail Wrapper */
.pwp-thumb {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
}

/* Aspect Ratio: Original (default) */
.pwp-thumb.ratio-original {
    aspect-ratio: auto;
}

.pwp-thumb.ratio-original img {
    width: 100%;
    height: auto;
    display: block;
}

/* Aspect Ratio: 1:1 */
.pwp-thumb.ratio-1-1 {
    aspect-ratio: 1 / 1;
}

/* Aspect Ratio: 4:3 */
.pwp-thumb.ratio-4-3 {
    aspect-ratio: 4 / 3;
}

/* Aspect Ratio: 3:2 */
.pwp-thumb.ratio-3-2 {
    aspect-ratio: 3 / 2;
}

/* Aspect Ratio: 16:9 */
.pwp-thumb.ratio-16-9 {
    aspect-ratio: 16 / 9;
}

/* Aspect Ratio: 9:16 */
.pwp-thumb.ratio-9-16 {
    aspect-ratio: 9 / 16;
}

/* Image fit for non-original ratios */
.pwp-thumb:not(.ratio-original) img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Object fit: cover */
.pwp-thumb.fit-cover img {
    object-fit: cover;
}

/* Object fit: contain */
.pwp-thumb.fit-contain img {
    object-fit: contain;
}

/* Placeholder */
.pwp-thumb.has-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

.pwp-thumb.pwp-loaded::before {
    display: none;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.pwp-thumb img {
    transition: transform 0.3s;
    position: relative;
    z-index: 2;
}

/* Removed fixed height - aspect ratio controlled by .pwp-thumb wrapper */

.sgp-item:hover img {
    transform: scale(1.05);
}

/* Overlay */
.sgp-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.sgp-item:hover .sgp-overlay {
    transform: translateY(0);
}

.sgp-item-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.sgp-item-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

/* Notice */
.sgp-notice {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    text-align: center;
    font-size: 14px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sgp-filters {
        justify-content: flex-start;
    }

    .sgp-filter-btn {
        font-size: 13px;
        padding: 8px 16px;
    }

    .sgp-item img {
        height: 250px;
    }

    .sgp-item-title {
        font-size: 16px;
    }

    .sgp-item-description {
        font-size: 13px;
    }
}

/* Animation for filtered items */
.sgp-item {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lightbox Styles */
.sgp-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgp-lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sgp-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    padding: 10px;
    line-height: 1;
    transition: opacity 0.2s;
}

.sgp-lightbox-close:hover {
    opacity: 0.7;
}

.sgp-lightbox-prev,
.sgp-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 40px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sgp-lightbox-prev:hover,
.sgp-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
}

.sgp-lightbox-prev {
    left: -80px;
}

.sgp-lightbox-next {
    right: -80px;
}

.sgp-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}

.sgp-lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.sgp-lightbox-info {
    margin-top: 20px;
    text-align: center;
    color: #fff;
    max-width: 600px;
}

.sgp-lightbox-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #fff;
}

.sgp-lightbox-description {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.sgp-lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sgp-lightbox-prev,
    .sgp-lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 30px;
    }

    .sgp-lightbox-prev {
        left: 10px;
    }

    .sgp-lightbox-next {
        right: 10px;
    }

    .sgp-lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }

    .sgp-lightbox-image {
        max-height: 60vh;
    }

    .sgp-lightbox-title {
        font-size: 20px;
    }

    .sgp-lightbox-description {
        font-size: 14px;
    }

    .sgp-lightbox-counter {
        bottom: 10px;
    }
}
