/* ============================================================
   Global Alarm Notification Banner — Top-right corner
   Non-SOS critical / warning alarms. Non-intrusive, persistent
   until dismissed. Themed to match the application palette.
   ============================================================ */

/* ---------- Container ---------- */
.alarm-notif-container {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 1800;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 16px;
    pointer-events: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(245,158,11,.18) transparent;
}

.alarm-notif-container::-webkit-scrollbar {
    width: 4px;
}

.alarm-notif-container::-webkit-scrollbar-track {
    background: transparent;
}

.alarm-notif-container::-webkit-scrollbar-thumb {
    background: rgba(245,158,11,.22);
    border-radius: 10px;
}

/* ---------- Individual notification card ---------- */
.alarm-notif {
    pointer-events: auto;
    width: 370px;
    max-width: calc(100vw - 40px);
    min-height: 0;
    flex-shrink: 0;
    background: var(--bg-card, #1C2130);
    border: 1px solid rgba(var(--accent-rgb, 245,158,11), .28);
    border-left: 4px solid var(--accent, #F59E0B);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .15);
    padding: 0;
    overflow: hidden;
}

.alarm-notif--critical {
    border-left-color: var(--danger, #EF4444);
    border-color: rgba(239, 68, 68, .22);
}

.alarm-notif--restricted {
    border-left-color: #A855F7;
    border-color: rgba(168, 85, 247, .22);
}

.alarm-notif--entering {
    animation: alarmNotifSlideIn .35s cubic-bezier(.16, 1, .3, 1) forwards;
}

.alarm-notif--dismissing {
    animation: alarmNotifSlideOut .28s ease forwards;
}

@keyframes alarmNotifSlideIn {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes alarmNotifSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(80px); }
}

/* ---------- Header row ---------- */
.alarm-notif__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 8px;
}

.alarm-notif__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.alarm-notif .alarm-notif__icon {
    background: rgba(var(--accent-rgb, 245,158,11), .14);
    color: var(--accent, #F59E0B);
}

.alarm-notif--critical .alarm-notif__icon {
    background: rgba(239, 68, 68, .14);
    color: #FCA5A5;
}

.alarm-notif--restricted .alarm-notif__icon {
    background: rgba(168, 85, 247, .14);
    color: #D8B4FE;
}

.alarm-notif__title {
    flex: 1;
    min-width: 0;
}

.alarm-notif__title-text {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-primary, #F1F1F3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alarm-notif__title-type {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-top: 1px;
}

.alarm-notif .alarm-notif__title-type {
    color: var(--accent, #F59E0B);
}

.alarm-notif--critical .alarm-notif__title-type {
    color: #FCA5A5;
}

.alarm-notif--restricted .alarm-notif__title-type {
    color: #D8B4FE;
}

.alarm-notif__close {
    background: none;
    border: none;
    color: var(--text-muted, #5C6070);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    font-size: .9rem;
    line-height: 1;
    transition: color .15s, background .15s;
    flex-shrink: 0;
}

.alarm-notif__close:hover {
    color: var(--text-primary, #F1F1F3);
    background: rgba(255, 255, 255, .06);
}

/* ---------- Body ---------- */
.alarm-notif__body {
    padding: 0 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.alarm-notif__detail {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .76rem;
    color: var(--text-secondary, #8B8FA3);
}

.alarm-notif__detail i {
    font-size: .72rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    opacity: .7;
}

/* ---------- Footer ---------- */
.alarm-notif__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 10px;
    border-top: 1px solid var(--border-color, rgba(255,255,255,.07));
}

.alarm-notif__time {
    font-size: .7rem;
    color: var(--text-muted, #5C6070);
}

.alarm-notif__view-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: .72rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .15s, color .15s;
}

.alarm-notif .alarm-notif__view-btn {
    background: rgba(var(--accent-rgb, 245,158,11), .14);
    color: var(--accent, #F59E0B);
}

.alarm-notif .alarm-notif__view-btn:hover {
    background: rgba(var(--accent-rgb, 245,158,11), .26);
}

.alarm-notif--critical .alarm-notif__view-btn {
    background: rgba(239, 68, 68, .14);
    color: #FCA5A5;
}

.alarm-notif--critical .alarm-notif__view-btn:hover {
    background: rgba(239, 68, 68, .24);
}

.alarm-notif--restricted .alarm-notif__view-btn {
    background: rgba(168, 85, 247, .14);
    color: #D8B4FE;
}

.alarm-notif--restricted .alarm-notif__view-btn:hover {
    background: rgba(168, 85, 247, .24);
}

/* ---------- Badge on topbar bell ---------- */
.alarm-notif-bell {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary, #8B8FA3);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    transition: color .15s, background .15s;
    line-height: 1;
}

.alarm-notif-bell:hover {
    color: var(--accent, #F59E0B);
    background: rgba(var(--accent-rgb, 245,158,11), .08);
}

.alarm-notif-bell__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    background: var(--danger, #EF4444);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
    animation: alarmBadgePop .3s cubic-bezier(.16, 1, .3, 1);
}

@keyframes alarmBadgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ---------- Light theme overrides ---------- */
[data-theme="light"] .alarm-notif {
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .06);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .alarm-notif-container {
        right: 8px;
        left: 8px;
        top: 64px;
    }

    .alarm-notif {
        width: 100%;
    }
}
