/**
 * Scroll Animations and Effects
 * Contains styles for navbar flip animation and smooth scroll-to-top button
 */

/* Navbar Flip Animation - Removed perspective from body to prevent fixed positioning issues */
/* Moved perspective to navbar container to avoid stacking context issues with fixed elements */

.nav-bar {
    /* Simplified to prevent stacking context issues that break fixed positioning */
    transform-origin: center top;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); /* Smooth bounce effect */
    will-change: auto; /* Changed from transform to auto to prevent stacking context */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    position: relative; /* Ensure normal document flow */
    z-index: 1000;
}

.nav-bar.flip-down {
    transform: rotateX(180deg);
}

.nav-bar:hover {
    transform: none !important; /* Reset on hover for improved usability */
}

/* Scroll to top button enhancements */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--brand-blue);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    visibility: visible;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) !important; /* Matching transition */
    z-index: 9999;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

.scroll-to-top.active {
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background-color: var(--brand-gold);
    transform: translateY(-5px);
}

.scroll-to-top i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.scroll-to-top:hover i {
    transform: translateY(-3px);
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nav-bar, .scroll-to-top {
        transition: none !important;
        transform: none !important;
    }
}
