/* ============================================================
   Secuura Status Badge — canonical color + icon + text component.
   Replaces legacy .badge-pill-shared-* on Phase 3 surfaces.
   Legacy classes themselves NOT deleted (Phase 4 sweep handles
   the long tail). Loaded AFTER dashboard.css. Layer-on-top only.
   Per DASH-02, DASH-03, DASH-07 + CONTEXT D-01, D-02.
   ============================================================ */

.secuura-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    vertical-align: middle;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) - 4px);
    text-decoration: none;
}
.secuura-status-badge::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome;
    font-weight: 900;
    font-size: 0.6875rem;
}
.secuura-status-badge__label {
    line-height: inherit;
}

/* ---------- Response states (CONTEXT D-01) ---------- */
.secuura-status-badge--pending {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border-color: hsl(var(--border));
}
.secuura-status-badge--pending::before { content: "\f017"; } /* fa-clock */

.secuura-status-badge--read {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}
.secuura-status-badge--read::before { content: "\f06e"; } /* fa-eye */

.secuura-status-badge--signed {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}
.secuura-status-badge--signed::before { content: "\f00c"; } /* fa-check */

/* ---------- Permission tiers (CONTEXT D-02) ---------- */
.secuura-status-badge--noaccess {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border-color: hsl(var(--border));
}
.secuura-status-badge--noaccess::before { content: "\f05e"; } /* fa-ban */

/* All three share-permission tiers (view / download / view+download) use the
   same outlined-secondary pill so they read as one family. The icons differ
   so the user can still distinguish them at a glance:
     fa-eye          → view-only
     fa-download     → download-only
     fa-eye + arrow  → view AND download
*/
.secuura-status-badge--view,
.secuura-status-badge--download,
.secuura-status-badge--viewdownload {
    background-color: transparent;
    color: hsl(var(--secondary));
    border-color: hsl(var(--secondary));
}

.secuura-status-badge--view::before { content: "\f06e"; } /* fa-eye */
.secuura-status-badge--download::before { content: "\f019"; } /* fa-download */
.secuura-status-badge--viewdownload::before { content: "\f06e"; } /* fa-eye */
.secuura-status-badge--viewdownload::after {
    content: "\f063"; /* fa-arrow-down — second glyph for the "view & download" stack */
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome;
    font-weight: 900;
    font-size: 0.625rem;
    margin-left: 0.125rem;
}

/* ---------- Helper variants for Dashboard.cshtml legacy chips ---------- */
.secuura-status-badge--expired {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border-color: hsl(var(--border));
}
.secuura-status-badge--expired::before { content: "\f017"; } /* fa-clock */

.secuura-status-badge--blocked {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}
.secuura-status-badge--blocked::before { content: "\f05e"; } /* fa-ban */

/* Gold-as-Trust per DESIGN.md §2 — verified status / premium tier only. */
.secuura-status-badge--verified {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}
.secuura-status-badge--verified::before { content: "\f132"; } /* fa-shield */

/* Password-protected document — orange to read as a caution/attention chip,
   distinct from the teal-secondary "download" colour it used to share.
   Literal HSL so it reads orange in both light and dark themes; foreground
   is white for AA contrast on the saturated orange surface. */
.secuura-status-badge--protected {
    background-color: hsl(25 95% 53%);
    color: hsl(0 0% 100%);
}
.secuura-status-badge--protected::before { content: "\f023"; } /* fa-lock */

/* ---------- Size modifier ---------- */
.secuura-status-badge--lg {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

/* ---------- Focus (when wrapped in <a>/<button>) ---------- */
.secuura-status-badge:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

/* ---------- Reduced motion (defensive — no transitions defined) ---------- */
@media (prefers-reduced-motion: reduce) {
    .secuura-status-badge { transition: none; }
}

/* Assigned — rights delegated to a holder. Light red, distinct from the "Shared" (read) pill so
   the two don't blur together. (Order on Dashboard/My Documents: Assigned, Certified,
   Watermarked, Signed, Shared.) */
.secuura-status-badge--assigned {
    background-color: hsl(var(--destructive) / 0.14);
    color: hsl(var(--destructive));
    border-color: hsl(var(--destructive) / 0.35);
}
.secuura-status-badge--assigned::before { content: "\f234"; } /* fa-user-plus */

/* ---------- Attached-copy badge (PS-458) ----------
   The recipient was ALSO emailed an uncontrolled copy of the document.

   Sits under the access badge, like the origin chip below, because it qualifies that
   access — but it is a full status badge rather than a quiet chip, and takes the
   destructive tone: it is the one thing on the row that revoking cannot take back.
   Solid fill (not the 14% wash used by --assigned) so it outranks the access badge
   it sits beneath, which is exactly the reading we want. */
.secuura-status-badge--attachment {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    border-color: hsl(var(--destructive));
}
.secuura-status-badge--attachment::before { content: "\f0c6"; } /* fa-paperclip */

/* ---------- Share origin chip (PS-424) ----------
   Marks WHERE a share was created — currently only "Outlook-Share", set by the add-in's
   share endpoint; null for shares made through the web Share page.

   Sits UNDER the access badge in the Access column, so it reads as a qualifier of that
   access rather than as a second status. Deliberately quieter than .secuura-status-badge:
   muted fill, no icon, normal weight — it is provenance, not state.

   Its own class rather than the legacy .badge-pill-shared-grey, which is `display:block`
   and therefore stretches to the full cell width instead of hugging its text. That legacy
   class is shared with other surfaces and is not edited here. */
.secuura-share-source {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-top: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 9999px;
    vertical-align: middle;
}
