/* Nowe animacje premium */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-slow {
    animation: pulse-slow 2s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out forwards;
}

.animate-scale-in {
    animation: scale-in 0.5s ease-out forwards;
}

.animation-delay-100 {
    animation-delay: 0.1s;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-300 {
    animation-delay: 0.3s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

.animation-delay-600 {
    animation-delay: 0.6s;
}

video {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

@media (prefers-reduced-motion: reduce) {
    video {
        animation: none !important;
    }
}

/* Optymalizacje dla galerii zdjęć - photos.css */

/* Lazy loading obrazów - efekt fade in */
.img-lazy {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.img-lazy.loaded {
    opacity: 1;
}

/* Modal galerii - bazowe style */
.gallery-modal {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Obraz w modalu - płynna zmiana */
.modal-image {
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: transform;
}

/* Hover effect na przyciskach nawigacyjnych */
.nav-btn {
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

.nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Miniaturki - scrollbar styling */
.thumbnails::-webkit-scrollbar {
    height: 8px;
}

.thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 4px;
}

.thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.8);
}

/* Gallery items - lepszy aspect ratio na mobile */
@media (max-width: 768px) {
    .gallery-item {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Mniejsze odstępy na mobile */
    .modal-header {
        padding: 0.75rem;
    }
    
    .image-container {
        padding: 1rem !important;
    }
    
    /* Wskaźnik swipe */
    .swipe-indicator {
        animation: pulseSwipe 2s ease-in-out infinite;
    }
    
    @keyframes pulseSwipe {
        0%, 100% {
            opacity: 0.3;
        }
        50% {
            opacity: 0.6;
        }
    }
}

/* Desktop optimizations */
@media (min-width: 769px) {
    /* Hover effects na thumbnails */
    .thumbnail img {
        transition: all 0.3s ease;
    }
    
    .thumbnail:hover img {
        opacity: 1 !important;
        transform: scale(1.05);
    }
    
    /* Płynniejsze przewijanie thumbnails */
    .thumbnails {
        scroll-behavior: smooth;
    }
}

/* Performance optimizations */
.gallery-item img,
.modal-image {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Prevent text selection during swipe */
.gallery-modal * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Loading state dla obrazów */
.modal-image[src=""] {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Accessibility improvements */
.gallery-modal:focus-visible,
.nav-btn:focus-visible,
.thumbnail:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

/* Reduce motion dla użytkowników z prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .img-lazy,
    .modal-image,
    .nav-btn,
    .thumbnail img,
    .gallery-modal {
        transition: none !important;
        animation: none !important;
    }
}