/**
 * Novara LEGEND - SPA Router Styles
 * Cinematic loading + transitions
 */

/* === SPA PROGRESS BAR (Arc Browser style) === */
.novara-spa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease;
}

.novara-spa-overlay.is-loading {
    opacity: 1;
}

.novara-spa-progress {
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
}

.novara-spa-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
        var(--novara-crimson, #E63946) 0%,
        #FF6B7A 50%,
        var(--novara-crimson, #E63946) 100%);
    background-size: 200% 100%;
    animation: novara-spa-shimmer 1.5s linear infinite;
    box-shadow: 0 0 12px rgba(230, 57, 70, 0.6),
                0 0 24px rgba(230, 57, 70, 0.3);
    transform-origin: left center;
}

@keyframes novara-spa-shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* === SPA TOAST NOTIFICATIONS === */
.novara-spa-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3),
                0 0 0 1px rgba(255,255,255,0.1);
    z-index: 99998;
    opacity: 0;
    transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    max-width: 90vw;
}

.novara-spa-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.novara-spa-toast--error {
    background: rgba(220, 38, 38, 0.95);
}

.novara-spa-toast--success {
    background: rgba(34, 197, 94, 0.95);
}

/* === PAGE TRANSITION STATES === */
main, #primary, #main, .novara-main {
    transition: opacity 280ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

/* During navigation, slight scale down */
html.novara-spa-navigating main {
    opacity: 0.6;
}

/* === REDUCE MOTION === */
@media (prefers-reduced-motion: reduce) {
    .novara-spa-progress__bar,
    .novara-spa-toast,
    main, #primary, #main, .novara-main {
        animation: none !important;
        transition: opacity 100ms linear !important;
        transform: none !important;
    }
}

/* === LOADING SKELETON (for content swap) === */
.novara-spa-skeleton {
    background: linear-gradient(90deg,
        rgba(0,0,0,0.04) 25%,
        rgba(0,0,0,0.08) 50%,
        rgba(0,0,0,0.04) 75%);
    background-size: 200% 100%;
    animation: novara-skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
}

[data-theme="dark"] .novara-spa-skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
}

@keyframes novara-skeleton-shimmer {
    0% { background-position: 200% 50%; }
    100% { background-position: -200% 50%; }
}
