/* In-app issue reporting: side-tab report button, report dialog and the "Report this" link in Blazor's error bar.
   Self-contained so host styles (MudBlazor, Bootstrap) do not leak in. */

/* A folder tab hanging off a screen edge. Only the shape lives here: issue-reporting.js sets top/bottom and
   left/right inline from the ButtonTop / ButtonBottom / ButtonSide settings (default: right edge, 76px from the
   top, just under LinCore's 64 px app bar). On hover/focus it grows away from the edge and reveals a vertical
   label while staying flush with the edge. */
.ir-fab {
    position: fixed;
    top: 76px;
    right: 0;
    z-index: 10001; /* above the host's full-page blocker (10000) */
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-sizing: border-box;
    min-width: 34px;
    min-height: 88px;
    margin: 0;
    padding: 8px 7px;
    border: none;
    border-radius: 8px 0 0 8px;
    background: #c62828;
    color: #fff;
    box-shadow: -1px 1px 4px rgba(0, 0, 0, 0.2);
    font: 600 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    cursor: pointer;
    opacity: 0.9;
    transition: padding 0.15s ease, gap 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.ir-fab:hover,
.ir-fab:focus-visible {
    padding-left: 12px;
    gap: 5px;
    opacity: 1;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.3);
}

.ir-fab.ir-fab-left {
    border-radius: 0 8px 8px 0;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}

.ir-fab.ir-fab-left:hover,
.ir-fab.ir-fab-left:focus-visible {
    padding-left: 7px;
    padding-right: 12px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.ir-fab:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -5px;
}

.ir-fab[hidden] {
    display: none;
}

.ir-fab svg {
    display: block;
    flex: none;
}

.ir-fab-label {
    display: block;
    writing-mode: vertical-rl;
    white-space: nowrap;
    letter-spacing: 0.02em;
    max-width: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.15s ease, max-height 0.15s ease, opacity 0.15s ease;
}

.ir-fab:hover .ir-fab-label,
.ir-fab:focus-visible .ir-fab-label {
    max-width: 16px;
    max-height: 140px;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .ir-fab,
    .ir-fab-label {
        transition: none;
    }
}

/* ---- Dialog ---------------------------------------------------------------------------------------------- */

.ir-dialog {
    z-index: 10002;
    box-sizing: border-box;
    width: 90vw;
    max-width: 960px;
    max-height: 90vh;
    margin: auto;
    padding: 0;
    border: 1px solid #d0d4da;
    border-radius: 8px;
    background: #fff;
    color: #1f2328;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    overflow: hidden;
}

.ir-dialog[open] {
    display: flex;
    flex-direction: column;
}

.ir-dialog::backdrop {
    background: rgba(15, 20, 25, 0.45);
}

.ir-dialog *,
.ir-dialog *::before,
.ir-dialog *::after {
    box-sizing: border-box;
}

.ir-dialog [hidden] {
    display: none !important;
}

.ir-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e4e7eb;
}

.ir-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.ir-close {
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #57606a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.ir-close:hover {
    background: #f0f2f4;
    color: #1f2328;
}

.ir-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 16px;
    overflow: auto;
}

.ir-caption {
    margin: 0 0 10px;
    color: #57606a;
    font-size: 12px;
    word-break: break-word;
}

.ir-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e4e7eb;
}

.ir-tab {
    margin: 0 0 -1px;
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: 6px 6px 0 0;
    background: transparent;
    color: #57606a;
    font: inherit;
    cursor: pointer;
}

.ir-tab[aria-selected="true"] {
    border-color: #e4e7eb #e4e7eb #fff;
    background: #fff;
    color: #1f2328;
    font-weight: 600;
}

.ir-panel {
    padding: 10px 0;
}

.ir-shot {
    display: block;
    max-width: 100%;
    max-height: 50vh;
    margin: 0 auto;
    border: 1px solid #e4e7eb;
    border-radius: 4px;
    object-fit: contain;
}

.ir-empty {
    margin: 12px 0;
    color: #57606a;
    font-style: italic;
}

.ir-replay-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
}

.ir-replay {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 1px solid #e4e7eb;
    border-radius: 4px;
    background: #f6f8fa;
}

.ir-replay-stage {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
}

.ir-replay-stage iframe {
    border: none;
    background: #fff;
}

.ir-fields {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.ir-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ir-label {
    font-weight: 600;
    font-size: 13px;
}

.ir-required {
    color: #c62828;
}

.ir-textarea {
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #d0d4da;
    border-radius: 6px;
    background: #fff;
    color: #1f2328;
    font: inherit;
    resize: vertical;
}

.ir-textarea:focus {
    border-color: #0969da;
    outline: 2px solid rgba(9, 105, 218, 0.25);
}

.ir-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    cursor: pointer;
    user-select: none;
}

.ir-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e4e7eb;
    background: #f6f8fa;
}

.ir-status {
    flex: 1 1 240px;
    min-height: 1.45em;
    margin: 0;
    color: #57606a;
}

.ir-status-success { color: #1a7f37; }
.ir-status-error { color: #c62828; }
.ir-status-warn { color: #9a6700; }

.ir-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.ir-btn {
    margin: 0;
    padding: 6px 14px;
    border: 1px solid #d0d4da;
    border-radius: 6px;
    background: #fff;
    color: #1f2328;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.ir-btn:hover:not(:disabled) {
    background: #f0f2f4;
}

.ir-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.ir-btn-primary {
    border-color: #0969da;
    background: #0969da;
    color: #fff;
}

.ir-btn-primary:hover:not(:disabled) {
    background: #0757b5;
}

.ir-btn-quiet {
    border-color: transparent;
    background: transparent;
}

.ir-btn-small {
    padding: 3px 10px;
    font-size: 12px;
}

/* ---- Blazor error bar --------------------------------------------------------------------------------------- */

#blazor-error-ui .ir-report-link {
    margin: 0 0.5rem;
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
