/* Blazor error boundary - displays when an unhandled exception occurs in a component */
.blazor-error-boundary {
    background: #f44336;
    padding: 1rem;
    color: white;
    border-radius: 4px;
    margin: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blazor-error-boundary::before {
    content: "\26A0";
    font-size: 1.5rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please try refreshing the page.";
}

/* Blazor error UI - the bottom error bar for circuit disconnection */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #d32f2f;
    color: white;
    padding: 0.75rem 1rem;
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui.show {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#blazor-error-ui .error-icon {
    font-size: 1.25rem;
}

#blazor-error-ui .error-message {
    flex: 1;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    padding: 0.25rem 0.5rem;
}

#blazor-error-ui .reload:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#blazor-error-ui .dismiss {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    opacity: 0.8;
}

#blazor-error-ui .dismiss:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Focus outline for accessibility - ensure visible focus indicators */
h1:focus {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Native checkbox styling improvement for SSR compatibility */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--mud-palette-primary);
}

/* Utility class for clickable elements */
.cursor-pointer {
    cursor: pointer;
}

/* MudBlazor input field styling */
.mud-input-slot {
    font-size: 0.935rem !important;
}

.mud-input-slot::placeholder {
    font-size: 0.875rem !important;
    color: var(--mud-palette-text-secondary) !important;
}

/* Also style the label to match */
.mud-input-label {
    font-size: 0.875rem !important;
}

/* MudStepper - center the step numbers and increase size */
.mud-stepper .mud-step-label-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mud-stepper .mud-step-label-icon .mud-typography {
    line-height: 1 !important;
    font-size: 0.875rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mud-stepper .mud-step-label-icon .mud-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mud-stepper .mud-step-label-icon svg {
    margin: auto !important;
}

/* Align grid items to bottom */
.align-end {
    align-items: flex-end !important;
}

.align-end .mud-button-root {
    height: 40px !important;
}

/* Preview table cell styling for onboarding wizard */
.preview-cell {
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--mud-palette-table-lines);
}

/* Active menu item indicator */
.nav-menu-active {
    border-bottom: 3px solid #14b8a6 !important;
    border-radius: 0 !important;
}

/* Ensure AppBar toolbar has relative positioning for logo */
.mud-appbar .mud-toolbar {
    position: relative;
    padding-left: 200px; /* Space for logo */
}

/* Logo positioned absolutely on the left edge of AppBar */
.appbar-logo {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

/* Syncfusion RichTextEditor fullscreen fix - ensure it appears above sticky header */
.e-richtexteditor.e-rte-full-screen {
    z-index: 1400 !important;
}


/* PROOF it loads */
/* Drop targets: root + all children-* lists */
#survey-root,
[id^="children-"] {
    min-height: 44px;
    padding: 6px;
    border-radius: 0;
    background: rgba(25,118,210,.04);
}

/* Empty lists are unmistakable drop zones */
    #survey-root:empty,
    [id^="children-"]:empty {
        min-height: 44px;
        background: rgba(25,118,210,.04);
        border-radius: 0;
    }

        #survey-root:empty::before,
        [id^="children-"]:empty::before {
            content: "Deixe aqui";
            display: block;
            padding: 10px 12px;
            color: rgba(0,0,0,.55);
            font-style: italic;
        }

/* Drag visuals (NO transform/scale; keep it stable) */
.sortable-drag,
.sortable-drag .tree-node-card {
    box-shadow: 0 10px 22px rgba(0,0,0,.20) !important;
    background: var(--mud-palette-surface) !important;
}

.sortable-ghost,
.sortable-ghost .tree-node-card {
    opacity: 0.25 !important;
    background: rgba(25,118,210,.04) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.survey-builder-ui .drag-handle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
}

.survey-builder-ui .drag-handle:active {
    cursor: grabbing;
}

.survey-builder-ui .drag-handle:hover {
    background: rgba(0,0,0,.05);
}

/* Floating scroll FAB buttons */
.scroll-fab {
    position: fixed;
    bottom: 24px;
    z-index: 2000;
}

.scroll-fab--up {
    right: 24px;
}

.scroll-fab--down {
    right: 72px;
}