/* Background animation */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes rise {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-120vh);
        opacity: 0;
    }
}

@keyframes quickPagePop {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.portfolio-page .banner,
.portfolio-page h1,
.portfolio-page .info-card,
.portfolio-page .portfolio-actions,
.portfolio-page .github-activity,
.portfolio-page .copyright,
.applications-page .banner,
.applications-page h1,
.applications-page .applications-container,
.applications-page .copyright,
.error-page .banner,
.error-page .rainbow-404,
.error-page img,
.error-page .info-card,
.error-page .copyright {
    opacity: 0;
    animation: quickPagePop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: transform, opacity;
}

.portfolio-page .banner,
.applications-page .banner,
.error-page .banner {
    animation-delay: 0.02s;
}

.portfolio-page h1,
.applications-page h1,
.error-page .rainbow-404 {
    animation-delay: 0.06s;
}

.portfolio-page .info-card,
.applications-page .applications-container,
.error-page img {
    animation-delay: 0.1s;
}

.portfolio-page .portfolio-actions,
.error-page .info-card {
    animation-delay: 0.13s;
}

.portfolio-page .github-activity,
.applications-page .copyright,
.error-page .copyright {
    animation-delay: 0.16s;
}

.portfolio-page .copyright {
    animation-delay: 0.19s;
}

body {
    background-size: 400% 400% !important;
    animation: gradientAnimation 30s ease infinite;
    animation-fill-mode: both;
    will-change: background-position;
}

body::before {
    background-size: 400% 400% !important;
    animation: gradientAnimation 30s ease infinite;
    animation-fill-mode: both;
}

/* Smooth page transitions */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    background-size: 400% 400%;
    animation: gradientAnimation 30s ease infinite;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Bubbles animation for light mode */
[data-theme="light"] .bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

[data-theme="light"] .bubble {
    position: absolute;
    bottom: -150px;
    border-radius: 50%;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(253, 253, 253, 0.4) 50%,
            rgba(245, 245, 245, 0.4) 100%);
    border: 1px solid rgba(220, 220, 220, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation-name: rise;
    animation-iteration-count: infinite;
    opacity: 0;
    box-shadow: 0 4px 15px rgba(210, 153, 194, 0.15);
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-page .banner,
    .portfolio-page h1,
    .portfolio-page .info-card,
    .portfolio-page .portfolio-actions,
    .portfolio-page .github-activity,
    .portfolio-page .copyright,
    .applications-page .banner,
    .applications-page h1,
    .applications-page .applications-container,
    .applications-page .copyright,
    .error-page .banner,
    .error-page .rainbow-404,
    .error-page img,
    .error-page .info-card,
    .error-page .copyright {
        opacity: 1;
        animation: none;
        transform: none;
        will-change: auto;
    }
}
