/* Wave Animation */
@keyframes wave-animation {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Gallery Styles */
.page-gallery {
    margin: 2rem 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.gallery-count {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.gallery-item {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #f8f9fa;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: zoom-in;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* Hover Effects */
.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Wave Effect */
.wave-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: wave-animation 0.6s ease-out;
    pointer-events: none;
    z-index: 1;
}

/* Lightbox Styles */
.custom-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
    object-fit: contain;
}

/* Lightbox Controls */
.lightbox-nav,
.lightbox-close,
.lightbox-counter {
    z-index: 10002;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    color: #333;
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    font-weight: bold;
    line-height: 1;
    user-select: none;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.9);
    border: none;
    color: #333;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    font-weight: bold;
    line-height: 1;
    user-select: none;
}

.lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Hover effects for lightbox controls */
.lightbox-nav:hover,
.lightbox-close:hover {
    background: rgba(255,255,255,1);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-close:hover {
    transform: scale(1.1);
}

/* Zapobieganie przeciąganiu obrazów */
.custom-lightbox-overlay img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Improve button alignment */
.lightbox-nav,
.lightbox-close {
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    padding: 0;
    margin: 0;
}

/* Zapobieganie outline na przyciskach */
.lightbox-nav:focus,
.lightbox-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Responsywność galerii */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        width: 45px;
        height: 45px;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item {
        height: 250px;
    }

    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
    }

    .lightbox-prev {
        left: 5px;
    }

    .lightbox-next {
        right: 5px;
    }

    .lightbox-close {
        width: 40px;
        height: 40px;
        top: 5px;
        right: 5px;
        font-size: 1.8rem;
    }

    .lightbox-counter {
        font-size: 0.8rem;
        padding: 6px 12px;
        bottom: 10px;
    }
}

/* Dodaj te style do istniejącego pliku CSS */

/* Style dla obrazów portretowych w lightbox */
.custom-lightbox-overlay img.portrait {
    max-width: 80vh !important;
    max-height: 90vh !important;
}

.custom-lightbox-overlay img.landscape {
    max-width: 90vw !important;
    max-height: 90vh !important;
}

/* Responsywność dla obrazów portretowych */
@media (max-width: 768px) {
    .custom-lightbox-overlay img.portrait {
        max-width: 95vw !important;
        max-height: 80vh !important;
    }
}