/**
 * Gallery Pro for Elementor - Frontend Styles
 */

/* Base Styles */
.gallery-pro-wrapper {
    position: relative;
    width: 100%;
}

/* Grid Layout */
.gallery-pro-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 3), 1fr);
    gap: var(--gap, 10px);
}

/* Masonry Layout */
.gallery-pro-masonry {
    column-count: var(--columns, 3);
    column-gap: var(--gap, 10px);
}

.gallery-pro-masonry .gallery-pro-item {
    break-inside: avoid;
    margin-bottom: var(--gap, 10px);
}

/* Justified Layout */
.gallery-pro-justified {
    display: flex;
    flex-wrap: wrap;
    margin: calc(var(--gap, 10px) / -2);
}

.gallery-pro-justified .gallery-pro-item {
    flex: 1 1 auto;
    margin: calc(var(--gap, 10px) / 2);
    height: var(--row-height, 200px);
}

/* Gallery Item */
.gallery-pro-item {
    position: relative;
    overflow: hidden;
    display: block;
    background: #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-pro-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

/* Overlay */
.gallery-pro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-pro-item:hover .gallery-pro-overlay {
    opacity: 1;
}

/* Title */
.gallery-pro-title {
    color: #ffffff;
    margin: 0;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 500;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-pro-item:hover .gallery-pro-title {
    transform: translateY(0);
}

/* Title Position - Below */
.gallery-pro-wrapper.title-below .gallery-pro-overlay {
    position: static;
    opacity: 1;
    background: transparent;
    padding: 10px 0;
}

.gallery-pro-wrapper.title-below .gallery-pro-title {
    color: #333;
    transform: none;
}

/* Hover Effects */
/* Zoom In */
.gallery-pro-item.hover-zoom-in:hover img {
    transform: scale(1.1);
}

/* Zoom Out */
.gallery-pro-item.hover-zoom-out img {
    transform: scale(1.1);
}

.gallery-pro-item.hover-zoom-out:hover img {
    transform: scale(1);
}

/* Rotate */
.gallery-pro-item.hover-rotate:hover img {
    transform: rotate(5deg) scale(1.1);
}

/* Blur */
.gallery-pro-item.hover-blur:hover img {
    filter: blur(3px);
}

/* Grayscale */
.gallery-pro-item.hover-grayscale img {
    filter: grayscale(100%);
}

.gallery-pro-item.hover-grayscale:hover img {
    filter: grayscale(0%);
}

/* Slide Up */
.gallery-pro-item.hover-slide-up .gallery-pro-overlay {
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-pro-item.hover-slide-up:hover .gallery-pro-overlay {
    transform: translateY(0);
    opacity: 1;
}

/* Entrance Animations */
.gallery-pro-item.animation-fade-in {
    animation: galleryFadeIn 0.6s ease-out;
}

.gallery-pro-item.animation-scale-up {
    animation: galleryScaleUp 0.6s ease-out;
}

.gallery-pro-item.animation-slide-up {
    animation: gallerySlideUp 0.6s ease-out;
}

.gallery-pro-item.animation-flip {
    animation: galleryFlip 0.8s ease-out;
}

/* Animation Keyframes */
@keyframes galleryFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes galleryScaleUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes galleryFlip {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

/* Responsive Styles */
/* Tablet */
@media (max-width: 1024px) {
    .gallery-pro-grid {
        grid-template-columns: repeat(var(--columns-tablet, 2), 1fr);
    }
    
    .gallery-pro-masonry {
        column-count: var(--columns-tablet, 2);
    }
}

/* Mobile */
@media (max-width: 767px) {
    .gallery-pro-grid {
        grid-template-columns: repeat(var(--columns-mobile, 1), 1fr);
    }
    
    .gallery-pro-masonry {
        column-count: var(--columns-mobile, 1);
    }
    
    .gallery-pro-title {
        font-size: 16px;
        padding: 8px 15px;
    }
}

/* Loading State */
.gallery-pro-wrapper.is-loading .gallery-pro-item {
    opacity: 0;
}

/* Lightbox Integration */
.gallery-pro-item[data-lightbox="yes"] {
    cursor: zoom-in;
}

/* Custom Scrollbar for Gallery */
.gallery-pro-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.gallery-pro-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.gallery-pro-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.gallery-pro-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Accessibility */
.gallery-pro-item:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.gallery-pro-item:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .gallery-pro-overlay {
        display: none !important;
    }
    
    .gallery-pro-item {
        break-inside: avoid;
    }
}

/* Editor Styles */
.elementor-editor-active .gallery-pro-wrapper {
    min-height: 200px;
}

.elementor-editor-active .gallery-pro-wrapper:empty::before {
    content: "Gallery Pro - Add images to get started";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    color: #999;
    font-family: Arial, sans-serif;
}