/* Simple Page Transition System */

/* Page loader - black screen overlay with centered logo */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: black;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
/* Transition logo placement */
.page-transition {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transition-logo {
    opacity: 0;
}

#page-loader.fade-out {
    opacity: 0;
}

/* Page content wrapper */
.page-transition-wrapper {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.page-transition-wrapper.fade-in {
    opacity: 1;
}

/* Fix white flash during fade by controlling background colors */
.page-transition-wrapper:not(.fade-in) > div {
    background-color: black !important;
    transition: background-color 0.1s ease;
}

.page-transition-wrapper:not(.fade-in) main {
    background-color: black !important;
    transition: background-color 0.1s ease;
}

.page-transition-wrapper.fade-in > div {
    background-color: white !important;
    transition: background-color 0.3s ease 0.2s;
}

.page-transition-wrapper.fade-in main {
    background-color: white !important;
    transition: background-color 0.3s ease 0.2s;
}

/* Content animation */
.fade-in {
    animation: fadeIn 0.8s ease;
}

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

/* Utility classes */
.animate-stagger > * {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.5s; }

.animate-text-reveal {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

/* No JavaScript fallback */
.no-js #page-loader {
    display: none;
}

.no-js .page-transition-wrapper {
    opacity: 1;
}
