/*
 * POC chips + hover popover.
 *
 * A "POC chip" is the inline element rendered by app/services/poc_renderer.py
 * for {{poc:key}} / {% poc 'key' %} markers. It's keyboard-focusable and shows
 * a small popover on hover/focus with name, role, ext, email, and a profile
 * link. JS lives in app/static/js/poc.js.
 */

.poc-chip {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 4px;
    border: 1px solid transparent;
    line-height: 1.4;
    cursor: help;
    text-decoration: none;
    transition: background 120ms ease, border-color 120ms ease;
    /* Hint to the page that this is interactive without changing the
       baseline alignment. */
    position: relative;
}

.poc-chip:focus {
    outline: 2px solid #fcb040;
    outline-offset: 1px;
}

/* Subtle "· OOO" marker on a filled chip whose shown contact is out of
   office and has no backup covering. Muted so it reads as a hint, not an
   alarm — the red vacant/missing chips own "loud". */
.poc-chip__ooo {
    font-size: 0.82em;
    font-weight: 600;
    opacity: 0.75;
    white-space: nowrap;
}

.poc-chip--filled {
    background: #fff5e0;
    color: #5a3b00;
    border-color: #f0c066;
    font-weight: 600;
}

.poc-chip--filled:hover {
    background: #ffe6b8;
}

.poc-chip--vacant,
.poc-chip--missing {
    background: #fde2e2;
    color: #8a1f1f;
    border-color: #f5a3a3;
    font-weight: 600;
}

.poc-chip--vacant:hover,
.poc-chip--missing:hover {
    background: #f9c8c8;
}

/* The popover itself, attached to <body> by JS so it isn't clipped by
   ancestors with overflow:hidden. */
.poc-popover {
    position: absolute;
    z-index: 9999;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #fff;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    padding: 14px;
    font-size: 0.92rem;
    line-height: 1.45;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.poc-popover.poc-popover--open {
    opacity: 1;
    transform: translateY(0);
}

.poc-popover__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.poc-popover__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #fcb040;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.poc-popover__name {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
}

.poc-popover__title {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

.poc-popover__role {
    background: #fff5e0;
    color: #5a3b00;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: inline-block;
}

/* Out-of-office notice line in the popover. Navy to match the profile-page
   OOO badge (background:#0a2c45); subtle, sits under the role pill. */
.poc-popover__ooo {
    margin: 0 0 8px 0;
    padding: 5px 8px;
    border-radius: 4px;
    background: #0a2c45;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

.poc-popover__ooo i {
    margin-right: 5px;
}

.poc-popover__ooo strong {
    font-weight: 700;
}

.poc-popover__rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.poc-popover__rows li {
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.poc-popover__rows i {
    width: 18px;
    color: #fcb040;
    text-align: center;
}

.poc-popover__rows a {
    color: #2a5e9a;
    text-decoration: none;
}

.poc-popover__rows a:hover {
    text-decoration: underline;
}

.poc-popover__rows .poc-popover__webclient {
    color: #888;
    font-size: 0.85rem;
}

/* [ADDED 2026-07-21] Out-of-office coverage. Navy banner leads the popover
   when a backup is covering; the header below is the person to actually call. */
.poc-popover__coverage-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #eaf1fb;
    color: #1f3a63;
    border: 1px solid #d3e2f5;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
}
.poc-popover__coverage-banner i { color: #2a5e9a; }
.poc-popover__coverage-banner--self {
    background: #fdf0e4;
    color: #7a4a12;
    border-color: #f2d9bf;
}
.poc-popover__coverage-banner--self i { color: #c07a1d; }

.poc-popover__coverage-note {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: #777;
}
.poc-popover__coverage-note a { color: #2a5e9a; text-decoration: none; }
.poc-popover__coverage-note a:hover { text-decoration: underline; }

.poc-popover__escalate {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: #5a3b00;
}
.poc-popover__escalate i { color: #c07a1d; margin-right: 4px; }
.poc-popover__escalate a { color: #2a5e9a; text-decoration: none; font-weight: 600; }
.poc-popover__escalate a:hover { text-decoration: underline; }

.poc-popover__footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
}

.poc-popover__footer a {
    color: #2a5e9a;
    text-decoration: none;
    font-weight: 600;
}

.poc-popover__footer a:hover {
    text-decoration: underline;
}

.poc-popover__vacant {
    color: #8a1f1f;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.poc-popover__loading {
    color: #888;
    font-style: italic;
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .poc-popover {
        transition: none;
    }
}
