/* PAGE-TRANSITION.CSS - Animacje przejść między stronami */

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
}

.bubble-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transition-bubble {
    width: 0;
    height: 0;
    background: #000;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    top: 50%;
    left: 50%;
    transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Animacja wejścia - bąbelek się powiększa */
.page-transition.entering .transition-bubble {
    width: 200vmax;
    height: 200vmax;
    transition-duration: 0.6s;
}

/* Animacja wyjścia - bąbelek się zmniejsza */
.page-transition.exiting .transition-bubble {
    width: 0;
    height: 0;
    transition-duration: 0.6s;
    transition-delay: 0.1s;
}

/* Warianty kolorów dla różnych stron */
.page-transition.home .transition-bubble {
    background: #000;
}

.page-transition.about .transition-bubble {
    background: #000;
}

.page-transition.work .transition-bubble {
    background: #000;
}

.page-transition.services .transition-bubble {
    background: #000;
}

.page-transition.contact .transition-bubble {
    background: #000;
}

/* Alternatywny efekt - multiple bubbles */
.page-transition.multi-bubble .bubble-container::before,
.page-transition.multi-bubble .bubble-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: inherit;
    opacity: 0.7;
}

.page-transition.multi-bubble .bubble-container::before {
    width: 0;
    height: 0;
    top: 30%;
    left: 20%;
    transition: all 0.7s cubic-bezier(0.4, 0.0, 0.2, 1) 0.1s;
}

.page-transition.multi-bubble .bubble-container::after {
    width: 0;
    height: 0;
    top: 70%;
    left: 80%;
    transition: all 0.7s cubic-bezier(0.4, 0.0, 0.2, 1) 0.2s;
}

.page-transition.multi-bubble.entering .bubble-container::before {
    width: 60vmax;
    height: 60vmax;
}

.page-transition.multi-bubble.entering .bubble-container::after {
    width: 40vmax;
    height: 40vmax;
}

/* Efekt ripple - dla linków */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Loading indicator podczas przejścia */
.transition-loading {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-transition.entering .transition-loading {
    opacity: 1;
    transition-delay: 0.3s;
}

.loading-dots {
    display: inline-block;
    position: relative;
    width: 40px;
    height: 10px;
    margin-left: 10px;
}

.loading-dots div {
    position: absolute;
    top: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: loading-dots 1.2s linear infinite;
}

.loading-dots div:nth-child(1) { left: 0; animation-delay: -0.24s; }
.loading-dots div:nth-child(2) { left: 12px; animation-delay: -0.12s; }
.loading-dots div:nth-child(3) { left: 24px; animation-delay: 0; }

@keyframes loading-dots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Preloader dla strony */
.page-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease;
}

.page-preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    color: #fff;
}

.preloader-logo {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.preloader-progress {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
    overflow: hidden;
    margin: 0 auto;
}

.preloader-bar {
    width: 0%;
    height: 100%;
    background: #fff;
    border-radius: 1px;
    transition: width 0.3s ease;
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    .transition-loading {
        bottom: 30px;
        font-size: 0.8rem;
    }
    
    .preloader-logo {
        font-size: 1.5rem;
    }
    
    .preloader-progress {
        width: 150px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .transition-bubble {
        transition-duration: 0.3s;
    }
    
    .page-transition.entering .transition-bubble {
        transition-duration: 0.3s;
    }
    
    .page-transition.exiting .transition-bubble {
        transition-duration: 0.3s;
    }
    
    .loading-dots div {
        animation: none;
        opacity: 1;
    }
}