html,
body {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: #f1f5f9;
    color: #1f2937;
}

a {
    color: #0d6efd;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type="checkbox"]) {
    outline: 1px solid #198754;
}

.invalid {
    outline: 1px solid #dc3545;
}

.validation-message {
    color: #dc3545;
}

.blazor-error-boundary {
    background: #b91c1c;
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.blazor-error-boundary::after {
    content: "Đã xảy ra lỗi.";
}

/* Markdown rendered content */
.markdown-body {
    line-height: 1.6;
    word-wrap: break-word;
}

.markdown-body p {
    margin-bottom: 0.5rem;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.25rem 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.markdown-body code {
    background-color: var(--mud-palette-background-grey);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 85%;
}

.markdown-body pre {
    background-color: var(--mud-palette-background-grey);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
}

.markdown-body pre code {
    background: none;
    padding: 0;
}

.markdown-body blockquote {
    border-left: 3px solid var(--mud-palette-lines-default);
    padding-left: 1rem;
    color: var(--mud-palette-text-secondary);
    margin: 0.5rem 0;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.5rem;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5rem 0;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--mud-palette-table-lines);
    padding: 0.4rem 0.8rem;
    text-align: left;
}

.markdown-body th {
    background-color: var(--mud-palette-background-grey);
}

/* Rich text (TinyMCE) rendered content */
.rich-text-body {
    line-height: 1.6;
    word-wrap: break-word;
    overflow: hidden;
}

.issue-description-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.issue-description-toolbar {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 0.75rem;
    background: var(--mud-palette-background-grey);
}

.issue-description-viewer {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 0.85rem;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

.issue-description-content {
    min-height: 100%;
}

.issue-description-viewer img {
    cursor: zoom-in;
}

/* Reset Word/Outlook pasted styles that cause overflow */
.rich-text-body [class^="MsoList"],
.rich-text-body [class^="Mso"] {
    text-indent: 0 !important;
    margin-left: 0 !important;
}

.rich-text-body p {
    margin-bottom: 0.5rem;
}

.rich-text-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.rich-text-body video,
.rich-text-body audio {
    max-width: 100%;
}

.rich-text-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5rem 0;
}

.rich-text-body th,
.rich-text-body td {
    border: 1px solid var(--mud-palette-table-lines);
    padding: 0.4rem 0.8rem;
    text-align: left;
}

.rich-text-body th {
    background-color: var(--mud-palette-background-grey);
}

.rich-text-body blockquote {
    border-left: 3px solid var(--mud-palette-lines-default);
    padding-left: 1rem;
    color: var(--mud-palette-text-secondary);
    margin: 0.5rem 0;
}

.rich-text-body ul,
.rich-text-body ol {
    padding-left: 1.5rem;
}

.rich-text-body code {
    background-color: var(--mud-palette-background-grey);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 85%;
}

.rich-text-body pre {
    background-color: var(--mud-palette-background-grey);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
}

.rich-text-body pre code {
    background: none;
    padding: 0;
}

.issue-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(8px);
}

.issue-image-lightbox__dialog {
    width: min(1200px, 100%);
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.issue-image-lightbox__toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.issue-image-lightbox__stage {
    overflow: auto;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 28%),
        linear-gradient(180deg, #111827 0%, #020617 100%);
}

.issue-image-lightbox__image {
    max-width: 100%;
    height: auto;
    transform-origin: top center;
    transition: transform 0.12s ease-out;
    border-radius: 0.75rem;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

.issue-image-lightbox__thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.issue-image-lightbox__thumb {
    height: 56px;
    width: auto;
    border-radius: 0.4rem;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: opacity 0.12s ease-out;
}

.issue-image-lightbox__thumb:hover {
    opacity: 0.85;
}

.issue-image-lightbox__thumb.is-active {
    opacity: 1;
    border-color: var(--mud-palette-primary);
}

@media (max-width: 768px) {
    .issue-description-viewer {
        max-height: 420px;
        padding: 0.75rem;
    }

    .issue-image-lightbox {
        padding: 0.75rem;
    }

    .issue-image-lightbox__toolbar {
        flex-wrap: wrap;
    }
}

/* Ghi am mo ta loi */
.audio-recorder {
    border: 1px dashed var(--mud-palette-lines-default, #d0d0d0);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.audio-recorder__player {
    height: 36px;
    max-width: 320px;
    vertical-align: middle;
}

.audio-recorder__timer {
    font-variant-numeric: tabular-nums;
}

.audio-recorder__pulse {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e53935;
    animation: audio-recorder-pulse 1s ease-in-out infinite;
}

@keyframes audio-recorder-pulse {
    0% { transform: scale(0.85); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.55; }
    100% { transform: scale(0.85); opacity: 1; }
}

/* Trinh phat audio trong danh sach tep dinh kem */
.issue-attachment-audio {
    height: 36px;
    max-width: 360px;
    vertical-align: middle;
}

/* Canh bao khi dan anh ma circuit Blazor da chet (evidence-queue.js chen vao
   body nen phai la CSS global, khong phai scoped cua component). */
.evidence-queue__paste-error {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 2000;
    max-width: min(92vw, 520px);
    padding: 12px 18px;
    border-radius: 8px;
    background: #b71c1c;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.35;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
