@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
@import 'design-system.css';

body {
    --body-font: "Segoe UI Variable", "Segoe UI", sans-serif;
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    margin: 0;
}

.navmenu-icon {
    display: none;
}

.main {
    min-height: calc(100dvh - 86px);
    max-height: calc(100dvh - 86px);
    color: var(--neutral-foreground-rest);
    align-items: stretch !important;
    overflow: hidden;
}

.body-content {
    align-self: stretch;
    height: calc(100dvh - 86px) !important;
    display: flex;
    overflow: hidden;
}

/* The FluentStack + main chain inside body-content must not create extra scroll surfaces */
.body-content fluent-stack,
.body-content > * {
    min-height: 0;
    overflow: hidden;
}

.body-content main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.content {
    padding: 0.5rem 1.5rem;
    align-self: stretch !important;
    width: 100%;
}

footer {
    background: var(--neutral-layer-4);
    color: var(--neutral-foreground-rest);
    align-items: center;
    padding: 10px 10px;
}

    footer a {
        color: var(--neutral-foreground-rest);
        text-decoration: none;
    }

        footer a:focus {
            outline: 1px dashed;
            outline-offset: 3px;
        }

        footer a:hover {
            text-decoration: underline;
        }

.alert {
    border: 1px dashed var(--accent-fill-rest);
    padding: 5px;
}

/* FluentSelect/FluentCombobox dropdown layering is handled centrally in design-system.css.
   The rules below are kept only for fluent-dialog-body stacking context. */

/* Ensure dialog body establishes its own stacking context */
fluent-dialog-body {
    position: relative;
    z-index: 1;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    margin: 20px 0;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3a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4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::before {
        content: "An error has occurred. "
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

@media (max-width: 600px) {
    .header-gutters {
        margin: 0.5rem 3rem 0.5rem 1.5rem !important;
    }

    [dir="rtl"] .header-gutters {
        margin: 0.5rem 1.5rem 0.5rem 3rem !important;
    }

    .main {
        flex-direction: column !important;
        row-gap: 0 !important;
    }

    nav.sitenav {
        width: 100%;
        height: 100%;
    }

    #main-menu {
        width: 100% !important;
    }

        #main-menu > div:first-child:is(.expander) {
            display: none;
        }

    .navmenu {
        width: 100%;
    }

    #navmenu-toggle {
        appearance: none;
    }

        #navmenu-toggle ~ nav {
            display: none;
        }

        #navmenu-toggle:checked ~ nav {
            display: block;
        }

    .navmenu-icon {
        cursor: pointer;
        z-index: 10;
        display: block;
        position: absolute;
        top: 15px;
        left: unset;
        right: 20px;
        width: 20px;
        height: 20px;
        border: none;
    }

    [dir="rtl"] .navmenu-icon {
        left: 20px;
        right: unset;
    }
}

.icon-loading {
    display: grid;
    place-items: center;
}

.loading-screen {
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    gap: 75px;
    transition: background-color linear 0.3s;
}

.loading-component {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px;
}

.loading {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.linear-progress {
    background: #ffffff22;
    width: 75px;
    height: 6px;
    border-radius: 10rem;
    overflow: hidden;
    position: relative;
}

    .linear-progress:after {
        content: '';
        position: absolute;
        inset: 0;
        background: var(--accent-fill-rest);
        scale: var(--blazor-load-percentage, 0%) 100%;
        transform-origin: left top;
        transition: scale ease-out 0.5s;
    }

.loading-text {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    animation: blinking alternate ease infinite 1s;
}

.loading-label {
    font-family: 'ProximaNova', system-ui, sans-serif;
    font-stretch: condensed;
    color: white;
    font-size: 14px;
}

main {
    width: 100%;
    padding: 10px 15px;
}

/* ============================================
   Custom Icon-Only Back Button - Modern Design
   ============================================ */

/* Base button styling - Clean, modern, icon-only design */
.custom-back-button {
    /* Reset default button styles */
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
    outline: none;
    
    /* Custom styling */
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--neutral-layer-2, rgba(0, 0, 0, 0.04));
    color: var(--accent-fill-rest, #0078d4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    
    /* Subtle shadow for depth */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Icon styling */
.custom-back-button .back-icon {
    width: 20px;
    height: 20px;
    display: block;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover state - Enhanced visual feedback */
.custom-back-button:hover {
    background: var(--accent-fill-rest, #0078d4);
    color: white;
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.custom-back-button:hover .back-icon {
    transform: translateX(-2px);
}

/* Active/pressed state */
.custom-back-button:active {
    transform: translateX(-1px) scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 120, 212, 0.2);
}

/* Focus state - Accessibility */
.custom-back-button:focus-visible {
    outline: 2px solid var(--accent-fill-rest, #0078d4);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.1);
}

/* Disabled state */
.custom-back-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.custom-back-button:disabled:hover {
    background: var(--neutral-layer-2, rgba(0, 0, 0, 0.04));
    color: var(--accent-fill-rest, #0078d4);
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.custom-back-button:disabled:hover .back-icon {
    transform: none;
}

/* Responsive sizing */
/* Mobile (< 640px) - Larger touch target */
@media (max-width: 640px) {
    .custom-back-button {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }
    
    .custom-back-button .back-icon {
        width: 22px;
        height: 22px;
    }
}

/* Tablet (641px - 1024px) - Standard size */
@media (min-width: 641px) and (max-width: 1024px) {
    .custom-back-button {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }
    
    .custom-back-button .back-icon {
        width: 21px;
        height: 21px;
    }
}

/* Desktop (> 1024px) - Slightly smaller, more refined */
@media (min-width: 1025px) {
    .custom-back-button {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    
    .custom-back-button .back-icon {
        width: 20px;
        height: 20px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .custom-back-button {
        background: var(--neutral-layer-3, rgba(255, 255, 255, 0.08));
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    .custom-back-button:hover {
        box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
    }
}

/* High contrast mode support - Accessibility */
@media (prefers-contrast: high) {
    .custom-back-button {
        border: 2px solid currentColor;
    }
    
    .custom-back-button:focus-visible {
        outline-width: 3px;
    }
}

/* Reduced motion support - Accessibility */
@media (prefers-reduced-motion: reduce) {
    .custom-back-button,
    .custom-back-button .back-icon {
        transition: none;
    }
    
    .custom-back-button:hover {
        transform: none;
    }
    
    .custom-back-button:hover .back-icon {
        transform: none;
    }
}

/* Legacy back-button styles - Remove old implementation */
.back-button,
.back-button-text {
    /* Deprecated - replaced by custom-back-button */
}

/* Header divider styling */
.header-divider {
    width: 1px;
    height: 24px;
    background-color: var(--neutral-stroke-rest, rgba(0, 0, 0, 0.12));
    align-self: center;
    margin: 0 4px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .header-divider {
        height: 20px;
        margin: 0 2px;
    }
}

@media (prefers-color-scheme: dark) {
    .header-divider {
        background-color: var(--neutral-stroke-rest, rgba(255, 255, 255, 0.15));
    }
}

form {
    width: 100%;
}