/*
 * The officer panic banner.
 *
 * Lifted verbatim out of PanicAlertCenterWidget::css()'s heredoc, which
 * registered it inline on EVERY authenticated page — the widget is mounted from
 * layouts/main.php, so this block was re-sent with every single HTML response
 * in the application. As a file it is fetched once and cached, and both tiers
 * share the one copy.
 *
 * Colours, spacing and the pulse animation are unchanged: this is the same
 * banner, and a dispatcher should not have to re-learn what red means on the
 * day its transport changed. Two rules are NEW and marked below.
 */

.panic-alert-center {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: #b02a37;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    border-bottom: 2px solid #842029;
}

.panic-alert-center__inner {
    padding: .5rem .75rem;
    max-width: 1600px;
    margin: 0 auto;
}

.panic-alert-center__head {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .95rem;
}

.panic-alert-center__title { letter-spacing: .04em; }
.panic-alert-center__count { font-weight: 700; }

.panic-alert-center__list {
    margin-top: .5rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    max-height: 50vh;
    overflow-y: auto;
}

.panic-alert-center.is-collapsed .panic-alert-center__list { display: none; }

.panic-alert-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    background: rgba(255, 255, 255, .08);
    border-radius: .25rem;
}

.panic-alert-row__officer { font-weight: 700; }

.panic-alert-row__chip {
    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    padding: .15rem .55rem;
    font-size: .8rem;
}

/* NEW — the alert TYPE, which the old banner never rendered at all. Deliberately
   louder than the task chip beside it: "NEED BACKUP" and a plain "ALERT" were
   indistinguishable before, and the distinction is the whole reason it is here. */
.panic-alert-row__type {
    background: #fff;
    color: #842029;
    font-weight: 700;
    font-size: .75rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-radius: .2rem;
    padding: .1rem .4rem;
}

.panic-alert-row__time { font-size: .8rem; opacity: .85; }
.panic-alert-row__address { font-size: .8rem; opacity: .85; flex: 1 1 200px; }

/* margin-left:auto pins the actions to the far end. It is DIRECTION-AWARE via
   the logical property, so under ar_ma the buttons sit at the correct edge
   instead of colliding with the address. The original used margin-left. */
.panic-alert-row__actions {
    margin-inline-start: auto;
    display: flex;
    gap: .35rem;
}

/* NEW — the degraded notice. The stream having failed must be VISIBLE: a panic
   banner that has quietly stopped receiving looks exactly like a quiet night. */
.panic-alert-center__notice {
    font-size: .8rem;
    background: rgba(0, 0, 0, .35);
    border-radius: .2rem;
    padding: .1rem .45rem;
}

.panic-alert-center__more {
    font-size: .8rem;
    opacity: .85;
    padding: .2rem .5rem;
}

.panic-alert-center .btn-outline-light:hover,
.panic-alert-center .btn-outline-light:focus-visible {
    background-color: rgba(255, 255, 255, .18);
}

.panic-alert-row .is-failed {
    border-color: #ffda6a;
    color: #ffda6a;
}

@keyframes pac-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); }
    50%      { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.panic-alert-row { animation: pac-pulse 1.6s ease-out 1; }

/* A dispatcher who has asked for less motion still gets the banner, the count
   and the alarm — only the pulse goes. */
@media (prefers-reduced-motion: reduce) {
    .panic-alert-row { animation: none; }
}

@media print {
    .panic-alert-center { display: none !important; }
}
