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 code {
    background-color: rgba(15, 23, 42, 0.08);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 85%;
}

.markdown-body pre {
    background-color: rgba(15, 23, 42, 0.06);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
}

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

.markdown-body blockquote {
    border-left: 3px solid #d1d5db;
    padding-left: 1rem;
    color: #64748b;
    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 #e5e7eb;
    padding: 0.4rem 0.8rem;
    text-align: left;
}

.markdown-body th {
    background-color: #f8fafc;
}

/* 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 #dbe4f0;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
}

.issue-description-viewer {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    border: 1px solid #dbe4f0;
    border-radius: 0.85rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.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 #e5e7eb;
    padding: 0.4rem 0.8rem;
    text-align: left;
}

.rich-text-body th {
    background-color: #f8fafc;
}

.rich-text-body blockquote {
    border-left: 3px solid #d1d5db;
    padding-left: 1rem;
    color: #64748b;
    margin: 0.5rem 0;
}

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

.rich-text-body code {
    background-color: rgba(15, 23, 42, 0.08);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 85%;
}

.rich-text-body pre {
    background-color: rgba(15, 23, 42, 0.06);
    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);
}

@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;
    }
}
