/* ─── EZLCMS Global Styles (aligned with legacy lms.css) ─── */

@import url('https://fonts.googleapis.com/css2?family=Questrial&family=Rokkitt:wght@400;700&display=swap');

:root {
    --brand-primary: #2563eb;
    --brand-secondary: #1e40af;
    --brand-primary-hover: #1d4ed8;
    --brand-primary-light: #dbeafe;
    --brand-text-on-primary: #ffffff;
    --nav-height: 48px;

    /* ── Design tokens ── */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);
    --transition-fast: 0.15s ease;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ── Accessibility utilities ── */

/* Visually hidden but exposed to screen readers (icon-button names,
   skip-link text, live-region labels). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Link-styled button that makes a clickable table row keyboard-reachable: the
   row keeps its @onclick for mouse convenience, and this focusable button in the
   primary cell gives keyboard/screen-reader users a way to trigger the same
   action (it stops propagation so the row handler doesn't double-fire). */
.row-open-btn {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}
.row-open-btn:hover { text-decoration: underline; }
.row-open-btn:focus-visible {
    outline: 2px solid var(--brand-primary, #2563eb);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Keyboard skip link — off-screen until focused, then pinned top-left so a
   keyboard/screen-reader user can jump past the nav to the page content. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    background: #fff;
    color: #111;
    padding: 8px 16px;
    border: 2px solid var(--brand-primary, #2563eb);
    border-radius: 0 0 var(--radius-sm, 4px) 0;
    font-weight: 600;
}
.skip-link:focus {
    left: 0;
    top: 0;
}

/* Solid "glass" backgrounds for the nav header buttons (role switcher, profile,
   logout), mixed from the header background toward the (already-readable) header
   text. Solid — not translucent — so they always contrast with the header text
   AND so axe can read the real background instead of compositing the semi-
   transparent layer over white and reporting a false ~1.4:1 failure. */
.app {
    --brand-header-btn-bg: color-mix(in srgb, var(--brand-header-text, #fff) 16%, var(--brand-header-bg, var(--brand-primary, #2563eb)));
    --brand-header-btn-hover: color-mix(in srgb, var(--brand-header-text, #fff) 30%, var(--brand-header-bg, var(--brand-primary, #2563eb)));
    --brand-header-btn-border: color-mix(in srgb, var(--brand-header-text, #fff) 42%, var(--brand-header-bg, var(--brand-primary, #2563eb)));
}

html, body {
    font-family: 'Questrial', Arial, Helvetica, sans-serif;
    font-size: 16px;
    color: #4b4b4b;
    line-height: 1.2em;
    margin: 0;
}

body {
    background-color: #eeeeee;
}

a, .btn-link {
    color: #4b4b4b;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── Page Layout Blocks ─── */

.pageBlock {
    background-color: #ffffff;
    width: 100%;
    border: 1px solid #f1f5f9;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.pageFull {
    background-color: #ffffff;
}

.pageHalf {
    background-color: #ffffff;
    width: 48%;
    display: inline-block;
    vertical-align: top;
}

/* ─── Instruction Area (page headers) ─── */

/* Page header. Grid layout positions the icon on the left spanning two
   rows; the title sits on row 1 and the helper text on row 2. The flat
   markup (.icon + .iconName + .instructionText siblings) is preserved
   so per-page templates don't need restructuring. */
.instructionArea {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: start;
    padding: 16px 20px;
}

.instructionArea .icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    width: 40px;
    height: 40px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--brand-primary-light, #dbeafe);
    color: var(--brand-primary, #2563eb);
    font-size: 18px;
    flex-shrink: 0;
}

.instructionArea .iconName {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
    margin: 0;
}

.instructionArea .instructionText {
    grid-column: 2;
    grid-row: 2;
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

/* ─── Tables ─── */

table, th, td {
    border-collapse: collapse;
    border: solid 0px #dadada;
}

.userTable {
    border: 1px solid #e5e7eb;
    border-collapse: collapse;
    /* Auto horizontal margin centers 96%-width legacy tables without
       creating an asymmetric inset on width:100% tables. */
    margin: 14px auto 0 auto;
    background: #ffffff;
}

.userTable td {
    border: 0;
    border-bottom: 1px solid #f1f3f5;
    padding: 10px 12px;
    vertical-align: middle;
}

.userTable tr:last-child td {
    border-bottom: 0;
}

/* Hover state for body rows. Header rows are excluded so the section
   labels (e.g. "Brands") don't tint when the cursor passes over them. */
.userTable tr:not(.tableHeader):hover {
    background: #f5f7fb;
}

.tableHeader {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.tableHeader td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.tableHeader strong {
    font-weight: 600;
}

/* ─── Modal Dialog ───
   Promoted from three identical per-page definitions. Pages can still
   override .modal-card { max-width: ... } when they need a wider/
   narrower size. */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalBackdropIn 0.15s ease-out;
}

.modal-card {
    background: #ffffff;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 95%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalCardIn 0.18s ease-out;
}

.modal-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
}

@keyframes modalBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalCardIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Field rows used inside modals (and other forms). */
.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: #4b5563;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.help-text {
    font-size: 0.78rem;
    color: #5f6368; /* AA 4.5:1 on white (was #9ca3af, ~2.5:1) */
    margin-top: 4px;
}

.req {
    color: #dc2626;
    font-weight: 600;
}

/* ─── Form Table ───
   Label/input tables (settings pages, brand editor, etc.). Shares the
   .tableHeader section-header style with data tables but skips the
   hover row tint, gives the label cell a muted color, and uses
   slightly more generous row padding. */
.formTable {
    border: 1px solid #e5e7eb;
    border-collapse: collapse;
    margin: 14px auto 0 auto;
    background: #ffffff;
    width: 96%;
}

.formTable td {
    border: 0;
    border-bottom: 1px solid #f1f3f5;
    padding: 12px 14px;
    vertical-align: middle;
}

.formTable tr:last-child td {
    border-bottom: 0;
}

/* Right-column input cell takes whatever width remains. */
.formTable td:first-child {
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Mobile: stack the 2-column label/input settings forms so the fixed-width
   label cells don't overflow a phone. Safe — .formTable is only used by the
   settings/brand-editor forms (never data grids, unlike .userTable). */
@media (max-width: 600px) {
    /* Block-ify the whole table so it fills the padded container and its
       content wraps — a display:table sizes to its widest content (the
       button row / selects) and blew past the right edge on a phone. */
    .formTable,
    .formTable tbody,
    .formTable tr {
        display: block;
        width: 100%;
    }
    .formTable {
        margin-left: 0;
        margin-right: 0;
    }
    .formTable td {
        display: block;
        width: auto;
    }
    .formTable td:first-child {
        padding-bottom: 2px;
    }
    /* Keep inputs/selects inside the column — a <select> otherwise widens to
       its longest option text and pushes the page past the viewport. */
    .formTable .form-input,
    .formTable input,
    .formTable select,
    .formTable textarea {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* ─── Button Styles ─── */

.buttonBar {
    margin: 12px 0;
    text-align: center;
    width: 100%;
}

/* Shared shape / typography / transition for both filled and outline
   variants. Many places in the codebase use .lmsButton-outline standalone
   (without .lmsButton) so the variant class can't depend on inheriting
   from .lmsButton — the base properties must apply to both. */
.lmsButton,
.lmsButton-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    margin-left: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition-fast),
                color var(--transition-fast),
                box-shadow var(--transition-fast),
                transform var(--transition-fast);
}

.lmsButton {
    background-color: var(--brand-primary, #2563eb);
    color: var(--brand-text-on-primary, #ffffff);
    box-shadow: var(--shadow-sm);
}

.lmsButton:hover {
    background-color: var(--brand-primary-hover, #1d4ed8);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    opacity: 1;
}

.lmsButton:active,
.lmsButton-outline:active {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

.lmsButton:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring), var(--shadow-sm);
}

.lmsButton:disabled,
.lmsButton-outline:disabled,
.lmsButton:disabled:hover,
.lmsButton-outline:disabled:hover {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.lmsButton-outline {
    background: #ffffff;
    /* readable variant so a light brand's outline text stays >=4.5:1 on white */
    color: var(--brand-primary-readable, var(--brand-primary, #2563eb));
    border-color: var(--brand-primary, #2563eb);
    padding: 8px 15px;
    box-shadow: none;
}

/* The anonymous auth pages (Login / Register / ForgotPassword / ResetPassword)
   use Bootstrap's .btn-primary rather than .lmsButton, so their CTA ignored the
   per-domain brand color and rendered Bootstrap blue. Drive it from the brand
   variables instead (both the Bootstrap 5.3 --bs-btn-* vars and the direct
   properties, so it works regardless of Bootstrap version). Higher specificity
   (.btn.btn-primary) wins regardless of stylesheet order. */
.btn.btn-primary {
    --bs-btn-bg: var(--brand-primary, #2563eb);
    --bs-btn-border-color: var(--brand-primary, #2563eb);
    --bs-btn-hover-bg: var(--brand-primary-hover, #1d4ed8);
    --bs-btn-hover-border-color: var(--brand-primary-hover, #1d4ed8);
    --bs-btn-active-bg: var(--brand-primary-hover, #1d4ed8);
    --bs-btn-active-border-color: var(--brand-primary-hover, #1d4ed8);
    --bs-btn-color: var(--brand-text-on-primary, #ffffff);
    --bs-btn-hover-color: var(--brand-text-on-primary, #ffffff);
    --bs-btn-active-color: var(--brand-text-on-primary, #ffffff);
    background-color: var(--brand-primary, #2563eb);
    border-color: var(--brand-primary, #2563eb);
    color: var(--brand-text-on-primary, #ffffff);
}

.lmsButton-outline:hover {
    background: var(--brand-primary-light, #dbeafe);
    color: var(--brand-primary-readable, var(--brand-primary, #2563eb));
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.lmsButton-outline:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.lmsButton-outline.active {
    background: var(--brand-primary, #2563eb);
    color: var(--brand-text-on-primary, #ffffff);
}

.lmsButton-danger { background-color: #dc2626; }
.lmsButton-danger:hover { background-color: #b91c1c; }

.lmsButton-success { background-color: #16a34a; }
.lmsButton-success:hover { background-color: #15803d; }

.lmsButton-warning { background-color: #d97706; }
.lmsButton-warning:hover { background-color: #b45309; }

.lmsButton-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* ─── Icon Images ─── */

.iconImage {
    border: none;
    margin-bottom: -5px;
    padding: 2px;
    height: 22px;
    width: 22px;
    cursor: pointer;
    color: var(--brand-primary);
    font-size: 1.1rem;
}

.iconImage:hover {
    color: #333;
}

/* ─── Form Inputs ─── */

input, textarea, select {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    padding: 5px;
    transition: box-shadow 0.3s;
    box-sizing: border-box;
    border: 1px solid #9c9c9c;
    border-radius: 3px;
    outline: none;
    color: #505050;
}

input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

input[type=checkbox], input[type=radio] {
    transform: scale(1.3);
    margin: 0 3px 0 0;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: inherit;
    color: inherit;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color var(--transition-fast),
                box-shadow var(--transition-fast);
}

.form-input:hover:not(:disabled):not(:focus) {
    border-color: #9ca3af;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-primary, #2563eb);
    box-shadow: var(--focus-ring);
}

.form-input:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

/* Invalid state only after the user has interacted (filled then cleared,
   or actively typing). Avoids the every-required-field-is-red-on-load
   anti-pattern. */
.form-input:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
}

.form-input:invalid:not(:placeholder-shown):focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.form-input-sm {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-family: inherit;
    color: inherit;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color var(--transition-fast),
                box-shadow var(--transition-fast);
}

.form-input-sm:hover:not(:disabled):not(:focus) {
    border-color: #9ca3af;
}

.form-input-sm:focus {
    outline: none;
    border-color: var(--brand-primary, #2563eb);
    box-shadow: var(--focus-ring);
}

/* Brand-tinted native checkboxes / radios — modern browsers honor accent-color. */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--brand-primary, #2563eb);
}

/* ─── Spacing Helpers ─── */

.leftPadding {
    padding-left: 28px;
}

.rightPadding {
    padding-right: 28px;
}

.topPadding {
    padding-top: 20px;
}

.bottomPadding {
    padding-bottom: 20px;
}

.fullPadding {
    padding: 12px 20px;
}

/* ─── Alerts ─── */

.alertBox {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}
.alertBox-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.alertBox-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ─── Text ─── */

.ezBold {
    font-weight: bold;
}

.smalltext {
    font-size: 14px;
    display: inline;
    padding-left: 6px;
}

.courseTitle {
    font-size: 1.2em;
    font-weight: bold;
    padding-left: 3px;
}

.groupTitle {
    font-size: 21px;
    font-weight: bold;
    padding-left: 3px;
}

.tableTitle {
    margin-left: 20px;
    font-weight: bold;
    margin-bottom: -8px;
}

/* ─── Responsive Table Wrapper ─── */

.responsiveTableScroll {
    overflow-x: auto;
}

/* ─── Status / Tags ─── */

.status-badge,
.audience-badge,
.verification-badge,
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.status-badge .bi,
.audience-badge .bi,
.verification-badge .bi {
    font-size: 0.85em;
    line-height: 1;
}

.status-badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.status-badge-danger {
    background: #fce4ec;
    color: #c62828;
}

.status-badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

.category-tag {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #555;
}

/* ─── Detail Panel (expandable rows) ─── */

.detail-panel {
    padding: 10px 0;
    background: #fafafa;
    border-top: 1px solid #dadada;
}

/* ─── Respond / Edit Forms (inline) ─── */

.respond-form {
    padding-top: 12px;
    border-top: 1px solid #dadada;
    margin-top: 12px;
}

.form-row {
    margin-bottom: 8px;
}

.form-row label {
    display: block;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 4px;
}

.form-row-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.form-row-inline label {
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
}

/* ─── Empty State ─── */

/* Two flavors share one class:
   - "Full" empty state (has an <h3>): centered card with a faded icon,
     headline, and helper text. Used when a whole list/page is empty.
   - "Inline" empty state (text only): just a centered, muted notice,
     used inside sections like "No members in this group". The icon is
     scoped via :has(h3) so inline notices stay compact. */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.empty-state:has(h3) {
    padding: 3rem 1.5rem;
}

.empty-state:has(h3)::before {
    content: "\F49D"; /* bi-inbox */
    font-family: "bootstrap-icons";
    font-size: 44px;
    color: #d1d5db;
    display: block;
    margin: 0 auto 12px;
    line-height: 1;
}

.empty-state h3 {
    margin: 0 0 6px;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 600;
}

.empty-state p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.coming-soon-text {
    display: inline-block;
    margin-top: 1rem;
    background: #f0f0f0;
    color: #888;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 1rem;
    border-radius: 4px;
    text-transform: uppercase;
}

/* ─── Loading ─── */

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* ─── Content Area ─── */

.content {
    padding-top: 1.1rem;
}

/* ─── Blazor Framework ─── */

h1:focus {
    outline: none;
}

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

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

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ─── Rich Text Editor ─── */
.rte-wrapper {
    border: 1px solid #ccc;
    border-radius: 3px;
    overflow: hidden;
}
.rte-toolbar {
    background: #f5f5f5;
    border-bottom: 1px solid #ccc;
    padding: 4px 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}
.rte-btn {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    padding: 2px 7px;
    font-size: 14px;
    line-height: 1.4;
    min-width: 28px;
    text-align: center;
    color: #333;
}
.rte-btn:hover {
    background: #e0e0e0;
    border-color: #999;
}
.rte-sep {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: #ccc;
    margin: 0 4px;
}
.rte-content {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #fff;
    font-size: 14px;
    line-height: 1.5;
}
.rte-content:focus {
    outline: none;
}

/* ============================================
   Certificate Editor Page — Modern Layout
   ============================================ */

.cert-editor-page {
    padding-bottom: 24px;
}

/* ── Page Header ── */
.ced-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0 16px;
}
.ced-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-primary, #2563eb), var(--brand-secondary, #1e40af));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.ced-header-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}
.ced-header-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: #718096;
}

/* ── Cards ── */
.ced-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ced-card-header {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ced-card-header i {
    color: var(--brand-primary, #2563eb);
    font-size: 15px;
}
.ced-card-header-collapsible {
    cursor: pointer;
    justify-content: space-between;
    user-select: none;
}
.ced-card-header-collapsible:hover {
    background: #f1f5f9;
}
.ced-card-body {
    padding: 20px;
}
.ced-card-flush .cert-editor-layout {
    margin: 0;
}

/* ── Forms ── */
.ced-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.ced-form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}
.ced-form-wide {
    grid-column: 1 / -1;
}
.ced-form-group {
    display: flex;
    flex-direction: column;
}
.ced-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ced-input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #334155;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ced-input:focus {
    outline: none;
    border-color: var(--brand-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.ced-input-sm {
    max-width: 100px;
}
.ced-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 4px;
}
.ced-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
}
.ced-check input[type="checkbox"] {
    transform: scale(1.15);
}
.ced-image-preview {
    margin-bottom: 10px;
}
.ced-image-preview img {
    max-width: 280px;
    max-height: 210px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}
.ced-file-upload {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ced-upload-status {
    color: #64748b;
    font-size: 13px;
}
.ced-file-name {
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}

/* ── Editor Mode Tabs ── */
.ced-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid #e2e8f0;
}
.ced-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s, border-color 0.15s;
}
.ced-tab:hover {
    color: #334155;
}
.ced-tab.active {
    color: var(--brand-primary, #2563eb);
    border-bottom-color: var(--brand-primary, #2563eb);
}
.ced-tab i {
    font-size: 14px;
}

/* ── Visual Editor Canvas Layout ── */
.cert-editor-layout {
    display: flex;
    gap: 16px;
    padding: 16px;
}
.cert-canvas-column {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.cert-canvas-wrapper {
    overflow: hidden;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #e5e7eb;
    padding: 10px;
}
#cert-canvas {
    position: relative;
    width: 1024px;
    height: 768px;
    background-color: #fff;
    background-size: cover;
    background-position: center;
    cursor: crosshair;
    border-radius: 4px;
}
.cert-props-column {
    width: 260px;
    flex-shrink: 0;
}

/* ── Draggable Elements ── */
.cert-el {
    position: absolute;
    cursor: move;
    user-select: none;
    border: 1px dashed transparent;
    display: flex;
    align-items: center;
    transition: border-color 0.15s, background-color 0.15s;
    z-index: 1;
}
.cert-el:hover {
    border-color: #2563eb;
    background-color: rgba(37, 99, 235, 0.05);
}
.cert-el.selected {
    border: 2px solid #2563eb;
    background-color: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    z-index: 10;
}
.cert-el.dragging {
    opacity: 0.7;
    z-index: 100;
    cursor: grabbing;
}
.cert-el-label {
    position: absolute;
    top: -18px;
    left: 0;
    font-size: 10px;
    color: #2563eb;
    background: rgba(255,255,255,0.9);
    padding: 0 4px;
    border-radius: 2px;
    white-space: nowrap;
    pointer-events: none;
    line-height: 16px;
    font-family: Arial, sans-serif;
    display: none;
}
.cert-el:hover .cert-el-label,
.cert-el.selected .cert-el-label {
    display: block;
}

/* ── Properties Panel ── */
.cert-props-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    font-size: 13px;
    max-height: calc(768px + 20px);
    overflow-y: auto;
}
.cert-props-panel h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}
.cert-props-panel label {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cert-props-panel input[type="number"],
.cert-props-panel input[type="text"],
.cert-props-panel input[type="color"],
.cert-props-panel select {
    width: 100%;
    margin-bottom: 8px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 13px;
    background: #fff;
    transition: border-color 0.15s;
}
.cert-props-panel input:focus,
.cert-props-panel select:focus {
    border-color: var(--brand-primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    outline: none;
}
.cert-props-panel input[type="color"] {
    height: 32px;
    padding: 3px;
    cursor: pointer;
}
.cert-props-row {
    display: flex;
    gap: 8px;
}
.cert-props-row > div {
    flex: 1;
}
.ced-props-section {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.ced-props-section:last-of-type {
    border-bottom: none;
}
.ced-props-section-title {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.ced-check-inline {
    display: flex;
    gap: 14px;
    margin-top: 6px;
}
.ced-check-inline label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: normal;
    cursor: pointer;
}
.ced-props-empty {
    text-align: center;
    padding: 24px 12px;
    color: #94a3b8;
}
.ced-props-empty i {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}
.ced-props-empty p {
    margin: 0;
    font-size: 13px;
}

/* ── Element List ── */
.cert-element-list {
    margin-top: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}
.cert-element-list h4 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cert-element-list-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 6px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.1s;
}
.cert-element-list-item:hover {
    background: #e0e7ff;
}
.cert-element-list-item.active {
    background: #c7d2fe;
    font-weight: 600;
}
.cert-element-list-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
.cert-element-list-item .el-pos {
    margin-left: auto;
    color: #94a3b8;
    font-size: 10px;
    font-family: 'Courier New', monospace;
}

/* ── Preview ── */
.ced-preview-body {
    padding: 16px;
    background: #f1f5f9;
}
.ced-preview-frame {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    width: 100%;
    position: relative;
}
.ced-preview-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}
.ced-preview-empty i {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}
.ced-preview-empty p {
    margin: 0;
    font-size: 14px;
}

/* ── HTML Editor ── */
.ced-placeholder-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}
.ced-placeholder-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-right: 4px;
}
.ced-placeholder-tag {
    font-size: 11px;
    padding: 3px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: all 0.1s;
}
.ced-placeholder-tag:hover {
    background: var(--brand-primary, #2563eb);
    color: #fff;
    border-color: var(--brand-primary, #2563eb);
}
.ced-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 10px;
}
.ced-hint code {
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #475569;
}
.ced-textarea {
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    resize: vertical;
    transition: border-color 0.15s;
}
.ced-textarea:focus {
    outline: none;
    border-color: var(--brand-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── Action Bar ── */
.ced-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 0;
}
.ced-actions .lmsButton {
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ced-actions .lmsButton-outline {
    border-radius: 6px;
    padding: 9px 20px;
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .cert-editor-layout {
        flex-direction: column;
    }
    .cert-canvas-column {
        min-width: auto;
    }
    .cert-props-column {
        width: 100%;
    }
    .ced-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Shared modal (used by Reports, Certificates, etc.) ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: #fff;
    border-radius: 6px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
}
.modal-header h2 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}
.modal-close:hover { color: #333; }
.modal-body { padding: 1.25rem; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 1rem 1.25rem;
    border-top: 1px solid #eee;
}
@media (max-width: 600px) {
    .modal-footer { flex-direction: column-reverse; }
}
