/**
 * Gallery Styles - PSL Dolny Śląsk
 * 
 * Beautiful gallery styling with hover effects and animations
 * 
 * @package Apple_Dark
 * @since 1.0.0
 */

/* Gallery Container */
.media-gallery,
.contact-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease-out;
}

/* Gallery Item */
.media-item,
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f5f5f5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.media-item:hover,
.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(46, 211, 151, 0.3);
}

.media-item img,
.gallery-item img {
    display: block;
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease;
}

.media-item:hover img,
.gallery-item:hover img {
    transform: scale(1.1) rotate(1deg);
    filter: brightness(1.1);
}

/* Gallery Item Caption */
.media-item p,
.gallery-item p {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    margin: 0;
}

.media-item:hover p,
.gallery-item:hover p {
    background: var(--color-accent);
    color: white;
    font-weight: 600;
}

/* Gallery Tabs */
.media-tabs {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.media-tabs::-webkit-scrollbar {
    height: 4px;
}

.media-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.media-tabs::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 2px;
}

.media-tabs ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
    width: 100%;
}

.media-tabs li {
    white-space: nowrap;
}

.media-tab-link {
    display: inline-block;
    padding: 1rem 0;
    color: var(--color-text);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.media-tab-link:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.media-tab-link.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* Media Section Animation */
.media-section {
    animation: fadeInUp 0.4s ease-out;
}

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

/* Lightbox Custom Styles */
.glightbox-container {
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
}

.glightbox-slide img {
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

.glightbox-title {
    color: white;
    font-size: 1.1rem;
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
}

.glightbox-desc {
    color: #ccc;
    font-size: 0.95rem;
    text-align: center;
    padding: 1rem;
}

/* Lightbox Navigation Buttons */
.glightbox-prev,
.glightbox-next {
    background: rgba(46, 211, 151, 0.8);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glightbox-prev:hover,
.glightbox-next:hover {
    background: var(--color-accent);
    transform: scale(1.1);
}

/* Lightbox Close Button */
.glightbox-close {
    background: rgba(46, 211, 151, 0.8);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 28px;
}

.glightbox-close:hover {
    background: var(--color-accent);
    transform: rotate(90deg) scale(1.1);
}

/* Mobile Gallery Styles */
@media (max-width: 768px) {
    .media-gallery,
    .contact-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .media-item img,
    .gallery-item img {
        height: 200px;
    }

    .media-tabs {
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .media-tab-link {
        padding: 0.75rem 0;
        font-size: 0.85rem;
    }

    .glightbox-prev,
    .glightbox-next,
    .glightbox-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .media-gallery,
    .contact-gallery-grid {
        grid-template-columns: 1fr;
    }

    .media-item img,
    .gallery-item img {
        height: 250px;
    }

    .media-tabs ul {
        gap: 1rem;
    }

    .glightbox-prev,
    .glightbox-next {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
}

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.gallery-loading {
    animation: spin 0.8s linear infinite;
}

/* Image placeholder while loading */
.media-item img[data-src],
.gallery-item img[data-src] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Smooth transitions for content */
.content-wrapper {
    transition: all 0.3s ease;
}

.page-header {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
