/* <Router /> — default styling, lm-router-* convention (v5: lm-pages) */
.lm-router {
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    height: 100%;
}

/* Every page owns the FULL container width: during a slide the two
   visible pages sit side by side at 100% each, and the container moves
   one full width — the new page pushes the old one entirely out of the
   viewport before it is hidden */
.lm-router-page {
    height: 100%;
    box-sizing: border-box;
    padding: 0 20px;
    flex: 0 0 100%;
    min-width: 100%;
    max-width: 100%;
}

@media (max-width: 800px) {
    .lm-router {
        height: 100%;
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
    }

    .lm-router-page {
        padding-top: calc(44px + var(--lm-safe-area-top, 0px));
        padding-bottom: calc(44px + var(--lm-safe-area-bottom, 0px));
        height: 100%;
        min-width: 100%;
        box-sizing: border-box;
        overflow-y: auto;
        will-change: scroll-position;
        -webkit-overflow-scrolling: touch;
    }
}

/* Slide between sibling pages, direction by route order (v5).
   transform, not left: % is the container's own width, and no
   position requirement. Overflow only clips DURING the slide. */
.lm-router-slide-in,
.lm-router-slide-out {
    overflow: hidden;
}

.lm-router-slide-in {
    animation: lm-router-slide-in 0.4s ease forwards;
}

.lm-router-slide-out {
    animation: lm-router-slide-out 0.4s ease forwards;
}

.lm-router-slide-in::-webkit-scrollbar,
.lm-router-slide-out::-webkit-scrollbar {
    display: none;
}

@keyframes lm-router-slide-in {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

@keyframes lm-router-slide-out {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Top progress bar while a remote view is fetching (v5) */
.lm-router-loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    animation: lm-router-loading 2s linear infinite;
    background: #e0e0e0
        repeating-linear-gradient(
            to right,
            var(--lm-main-color-deep, #2563eb),
            var(--lm-main-color-deep, #2563eb) 50%,
            #e0e0e0 50%,
            #e0e0e0
        );
    background-size: 200% 100%;
}

@keyframes lm-router-loading {
    from {
        background-position: 100% 0;
    }
    to {
        background-position: 0 0;
    }
}
