/* ============================================================================
   Navigation Helper Buttons
   
   Sticky bottom buttons for back to top and back to previous page
   ============================================================================ */

.nav-helper-buttons {
    position: fixed;
    bottom: var(--spacing-4);
    right: var(--spacing-4);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    z-index: 900;
    /* Below modals (1000) but above content */
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--easing-ease),
        transform var(--duration-normal) var(--easing-ease);
}

.nav-helper-buttons.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-helper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--color-purple-dark);
    color: var(--color-text-on-emphasis);
    border: 1px solid var(--color-purple-medium);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--duration-fast) var(--easing-ease);
}

@media (hover: hover) {
  .nav-helper-btn:hover {
    background: var(--color-purple-medium);
    box-shadow: var(--shadow-xl);
  }
}

.nav-helper-btn:active {
    background: var(--color-purple-medium);
}

.nav-helper-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================================================
   Navigation Spinner

   Shown during Blazor enhanced navigation (link click → page load).
   A 500ms JS delay before adding .active, plus a 150ms CSS fade-in, means the
   spinner only becomes visible for navigations that take >650ms — i.e. never
   on fast networks, always on 3G or slower.

   Structure: full-screen backdrop (.nav-spinner) + centered ring (.nav-spinner::after).
============================================================================ */

.nav-spinner {
    position: fixed;
    inset: 0;
    z-index: var(--z-index-modal);
    pointer-events: none;
    opacity: 0;
    /* Subtle dark tint + backdrop blur so the page is clearly "loading" */
    background: rgba(13, 17, 23, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* The actual spinning ring, centered in the viewport */
.nav-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 4px solid var(--color-purple-border-subtle);
    border-top-color: var(--color-purple-bright);
    border-radius: var(--radius-full);
    animation: nav-spinner-spin 0.75s linear infinite;
}

.nav-spinner.active {
    animation: nav-spinner-fade-in var(--duration-fast) var(--easing-ease) forwards;
}

@keyframes nav-spinner-fade-in {
    to { opacity: 1; }
}

@keyframes nav-spinner-spin {
    to { transform: rotate(360deg); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .nav-helper-buttons {
        bottom: var(--spacing-3);
        right: var(--spacing-3);
    }

    .nav-helper-btn {
        width: 44px;
        height: 44px;
    }

    .nav-helper-btn svg {
        width: 18px;
        height: 18px;
    }
}