/* alerts.css
   Notifications dropdown wired up by ui/alertsPanel.js -- active
   alerts feed + a compact rule-authoring form. Uses .modal-window
   (modals.css) as its base panel look, positioned as a fixed dropdown
   under the topbar's notifications button rather than a centered
   modal. */

#notificationsBtn.has-alerts {
    border-color: #e03131;
    color: #ff8080;
}

.alerts-dropdown {
    position: fixed;
    width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 10000;
    padding: 14px;
}

.alerts-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--panel-border);
}

.alerts-link-btn {
    background: none;
    border: none;
    color: var(--mint);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alerts-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12px;
}

.alerts-severity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.alerts-row-message {
    color: var(--text-light);
}

.alerts-row-meta {
    color: #888;
    font-size: 11px;
    margin-top: 2px;
}

/* Unseen (state === "new") vs already-opened -- the same distinction the topbar badge count
   gives, but per-row once the panel itself is open. */
.alerts-row-new .alerts-row-message {
    font-weight: bold;
}

.alerts-empty {
    font-size: 12px;
    color: #888;
    padding: 4px 0;
}

.alerts-rule-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alerts-form-row {
    display: flex;
    gap: 6px;
}

.alerts-form-row input,
.alerts-form-row select {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    background: var(--btn-bg);
    color: var(--text-light);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    font-size: 12px;
}

.alerts-form-row button {
    padding: 6px 10px;
    background: var(--btn-bg);
    color: var(--text-light);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.alerts-form-row button:hover {
    background: var(--btn-hover);
}

.alerts-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin: 10px 0 6px;
}

.alerts-rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alerts-rule-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12px;
}

.alerts-rule-remove {
    background: none;
    border: none;
    color: #ff8080;
    cursor: pointer;
    padding: 0 2px;
    font-size: 12px;
    flex-shrink: 0;
}

/* Per-rule "send to my phone" switch (notify_channels ["push"]). */
.alerts-rule-phone {
    background: none;
    border: 1px solid #5c6570;
    border-radius: 3px;
    color: #a8b0bb;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 11px;
    padding: 0 4px;
    white-space: nowrap;
}

.alerts-rule-phone.is-on {
    border-color: var(--mint);
    color: var(--mint);
}

.alerts-phone-label {
    align-items: center;
    color: #a8b0bb;
    display: inline-flex;
    font-size: 12px;
    gap: 3px;
    white-space: nowrap;
}

.alerts-status {
    font-size: 12px;
    color: var(--mint);
    margin-top: 6px;
}

.alerts-status.alerts-status-error {
    color: #ff8080;
}

@media (max-width: 700px) {
    .alerts-dropdown {
        left: 6px !important;
        max-height: calc(100vh - var(--topbar-h) - var(--timeline-h) - 18px);
        right: 6px !important;
        width: auto;
    }

    .alerts-form-row {
        flex-wrap: wrap;
    }

    .alerts-form-row input,
    .alerts-form-row select {
        flex-basis: 120px;
    }
}

/* Notification timestamps (ui/alertsPanel.js): UTC day/time + age. */
.alerts-row-time { font-size: 10.5px; color: var(--text-muted, #9aa3ad); margin-top: 1px; font-variant-numeric: tabular-nums; }

.alerts-airport-action {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    padding: 0;
    cursor: pointer;
    min-width: 0;
}
.alerts-airport-action:hover { text-decoration: underline; }
.alerts-airport-action:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
