/* Anomaly Detection UI - Alarm Overlay, Acknowledgement Flow, and Security Mode */ /* ── Anomaly Alarm Overlay ────────────────────────────────────────────────────── */ .anomaly-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--alert); z-index: 2000; display: flex; align-items: center; justify-content: center; animation: anomaly-fade-in 0.3s ease-out; } .anomaly-overlay.hidden { display: none; } @keyframes anomaly-fade-in { from { opacity: 0; } to { opacity: 1; } } .anomaly-banner { background: var(--bg-card); border: 2px solid var(--alert); border-radius: var(--radius-modal); padding: 24px; max-width: 500px; width: 90%; box-shadow: 0 20px 60px var(--shadow-xl); animation: anomaly-slide-up 0.3s ease-out; } @keyframes anomaly-slide-up { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } .anomaly-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; background: var(--alert); border-radius: 50%; margin: 0 auto 16px; color: var(--text-on-accent); animation: anomaly-pulse 1.5s infinite; } @keyframes anomaly-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--alert-muted); } 50% { transform: scale(1.1); box-shadow: 0 0 20px 0 transparent; } } .anomaly-icon svg { width: 36px; height: 36px; } .anomaly-content { text-align: center; color: var(--text-secondary); } .anomaly-title { font-size: var(--text-lg); font-weight: 700; margin: 0 0 8px 0; color: var(--alert); } .anomaly-description { font-size: var(--text-base); margin-bottom: 12px; line-height: 1.4; } .anomaly-meta { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: 20px; font-family: var(--font-mono); } .anomaly-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; } .anomaly-btn { padding: 10px 20px; border-radius: var(--radius-control); font-size: var(--text-sm); font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; } .anomaly-btn.ack { background: var(--ok); color: var(--text-on-accent); } .anomaly-btn.ack:hover { background: var(--ok); transform: scale(1.05); } .anomaly-btn.view { background: var(--blue-9); color: var(--text-on-accent); } .anomaly-btn.view:hover { background: var(--blue-9); transform: scale(1.05); } .anomaly-btn.dismiss { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--slate-6); } .anomaly-btn.dismiss:hover { background: var(--bg-hover); } /* ── Feedback Modal ───────────────────────────────────────────────────────────── */ .anomaly-feedback-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; } .anomaly-feedback-modal.hidden { display: none; } .modal-backdrop { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--overlay-strong); backdrop-filter: blur(4px); } .modal-content { position: relative; background: var(--bg-card); border: 1px solid var(--slate-5); border-radius: var(--radius-modal); padding: 24px; max-width: 480px; width: 90%; max-height: 80vh; overflow-y: auto; color: var(--text-secondary); animation: modal-pop 0.2s ease-out; } @keyframes modal-pop { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } } .modal-content h3 { margin: 0 0 8px 0; font-size: var(--text-lg); font-weight: 600; } .feedback-anomaly-desc { margin-bottom: 16px; color: var(--text-muted); font-size: var(--text-sm); } .feedback-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; } .feedback-btn { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-card); border: 2px solid var(--slate-6); border-radius: var(--radius-control); cursor: pointer; text-align: left; transition: all 0.2s; } .feedback-btn:hover { background: var(--bg-hover); } .feedback-btn.selected { border-color: var(--blue-9); background: var(--blue-muted); } .feedback-btn .icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 18px; flex-shrink: 0; } .feedback-btn.expected .icon { background: var(--ok-muted); color: var(--ok); } .feedback-btn.intrusion .icon { background: var(--warn-muted); color: var(--warn); } .feedback-btn.false-alarm .icon { background: var(--alert-muted); color: var(--alert); } .feedback-btn .label { font-weight: 600; font-size: var(--text-sm); } .feedback-btn .desc { font-size: var(--text-xs); color: var(--text-muted); } .feedback-notes { margin-bottom: 16px; } #feedback-notes-input { width: 100%; min-height: 80px; padding: 10px; background: var(--bg-input); border: 1px solid var(--slate-6); border-radius: var(--radius-control); color: var(--text-secondary); font-size: var(--text-sm); font-family: inherit; resize: vertical; } #feedback-notes-input:focus { outline: none; border-color: var(--blue-9); } .modal-actions { display: flex; justify-content: flex-end; gap: 12px; } .modal-btn { padding: 10px 20px; border-radius: var(--radius-control); font-size: var(--text-sm); font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; } .modal-btn.cancel { background: var(--bg-card); color: var(--text-secondary); } .modal-btn.cancel:hover { background: var(--bg-hover); } .modal-btn.submit { background: var(--blue-9); color: var(--text-on-accent); } .modal-btn.submit:hover:not(:disabled) { background: var(--blue-9); } .modal-btn.submit:disabled { opacity: 0.5; cursor: not-allowed; } /* ── Learning Banner ──────────────────────────────────────────────────────────── */ #anomaly-learning-banner { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 500; background: var(--bg-card); border: 1px solid var(--slate-5); border-radius: var(--radius-card); padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 16px var(--shadow); animation: learning-appear 0.3s ease-out; } #anomaly-learning-banner.hidden { display: none; } @keyframes learning-appear { from { transform: translateX(-50%) translateY(-10px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } } .learning-icon { color: var(--blue-10); font-size: 18px; } .learning-text { font-size: var(--text-sm); color: var(--text-secondary); } .learning-progress-bar { width: 120px; height: 6px; background: var(--bg-input); border-radius: var(--radius-control); overflow: hidden; } .learning-progress { height: 100%; background: linear-gradient(90deg, var(--blue-10), var(--ok)); transition: width 0.5s ease-out; border-radius: var(--radius-control); } .days-remaining { font-size: var(--text-xs); color: var(--text-muted); margin-left: 8px; } /* ── Security Mode Indicator ───────────────────────────────────────────────────── */ #security-mode-indicator { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-modal); font-size: var(--text-xs); font-weight: 600; background: var(--bg-card); border: 1px solid var(--slate-5); transition: all 0.3s; } .security-status-indicator.mode-disarmed { background: var(--bg-card); border-color: var(--slate-5); } .security-status-indicator.mode-armed { background: var(--alert-muted); border-color: var(--alert); color: var(--alert); } .security-status-indicator.mode-alert { background: var(--alert-muted); border-color: var(--alert); color: var(--alert); animation: security-pulse 1s infinite; } @keyframes security-pulse { 0%, 100% { box-shadow: 0 0 5px var(--alert-muted); } 50% { box-shadow: 0 0 20px var(--alert); } } .security-status-indicator.mode-learning { background: var(--blue-border); border-color: var(--blue-10); color: var(--blue-10); } .security-status-indicator.mode-ready { background: var(--ok-muted); border-color: var(--ok); color: var(--ok); } .security-icon { font-size: var(--text-sm); } .security-text { font-weight: 600; } .security-toggle-btn { background: none; border: none; cursor: pointer; padding: 2px; margin-left: 4px; border-radius: var(--radius-control); color: inherit; opacity: 0.7; transition: opacity 0.2s; } .security-toggle-btn:hover { opacity: 1; } /* ── Alert Banner ──────────────────────────────────────────────────────────────────── */ #alert-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 1900; background: var(--alert); color: var(--text-on-accent); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; box-shadow: 0 4px 16px var(--shadow); animation: alert-slide-down 0.3s ease-out; } #alert-banner.hidden { display: none; } @keyframes alert-slide-down { from { transform: translateY(-100%); } to { transform: translateY(0); } } .alert-banner-icon { font-size: 24px; } .alert-banner-content { flex: 1; min-width: 0; } .alert-banner-title { font-size: var(--text-base); font-weight: 700; margin: 0 0 4px 0; } .alert-banner-description { font-size: var(--text-sm); opacity: 0.95; margin-bottom: 4px; } .alert-banner-meta { font-size: var(--text-xs); opacity: 0.85; display: flex; gap: 12px; } .alert-banner-actions { display: flex; gap: 8px; } .alert-banner-btn { padding: 8px 16px; background: var(--border-strong); border: 1px solid var(--border-strong); border-radius: var(--radius-control); color: var(--text-on-accent); font-size: var(--text-sm); font-weight: 600; cursor: pointer; transition: background 0.2s; } .alert-banner-btn:hover { background: var(--border-strong); } /* ── Security Dialog ────────────────────────────────────────────────────────────── */ .security-dialog-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--overlay-strong); backdrop-filter: blur(4px); z-index: 2000; display: flex; align-items: center; justify-content: center; animation: dialog-fade-in 0.2s ease-out; } @keyframes dialog-fade-in { from { opacity: 0; } to { opacity: 1; } } .security-dialog-card { background: var(--bg-card); border: 1px solid var(--slate-5); border-radius: var(--radius-modal); padding: 24px; max-width: 440px; width: 90%; max-height: 80vh; overflow-y: auto; color: var(--text-secondary); animation: dialog-pop 0.3s ease-out; } .security-dialog-card.arm { border-color: var(--alert); } .security-dialog-card.disarm { border-color: var(--ok); } @keyframes dialog-pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } } .security-dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--slate-5); } .security-dialog-header h2 { margin: 0; font-size: var(--text-lg); font-weight: 600; } .security-dialog-close { background: none; border: none; color: var(--text-muted); font-size: var(--text-base); cursor: pointer; padding: 4px; line-height: 1; border-radius: var(--radius-control); } .security-dialog-close:hover { background: var(--bg-hover); color: var(--text-secondary); } .security-dialog-content { margin-bottom: 20px; } .security-dialog-prompt { font-size: var(--text-sm); line-height: 1.5; margin-bottom: 16px; color: var(--text-secondary); } .security-dialog-warning { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius-control); padding: 12px; margin-bottom: 16px; } .security-dialog-warning p { margin: 0 0 8px 0; font-size: var(--text-sm); color: var(--warn); } .security-dialog-warning p:last-child { margin-bottom: 0; } .security-dialog-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; } .stat-item { background: var(--bg-input); border-radius: var(--radius-control); padding: 12px; } .stat-item-full { grid-column: 1 / -1; } .stat-label { display: block; font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; } .stat-value { display: block; font-size: var(--text-lg); font-weight: 600; } .security-dialog-actions { display: flex; justify-content: flex-end; gap: 12px; } .security-dialog-btn { padding: 10px 24px; border-radius: var(--radius-control); font-size: var(--text-sm); font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; } .security-dialog-btn.cancel { background: var(--bg-card); color: var(--text-secondary); } .security-dialog-btn.cancel:hover { background: var(--bg-hover); } .security-dialog-btn.arm { background: var(--alert); color: var(--text-on-accent); } .security-dialog-btn.arm:hover { background: var(--alert); } .security-dialog-btn.disarm { background: var(--ok); color: var(--text-on-accent); } .security-dialog-btn.disarm:hover { background: var(--ok); } /* ── Anomaly History ─────────────────────────────────────────────────────────────── */ .anomaly-history-item { padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--slate-5); border-radius: var(--radius-control); margin-bottom: 8px; display: flex; gap: 12px; align-items: center; } .anomaly-history-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; } .anomaly-history-icon.unusual-hour { background: var(--warn-muted); color: var(--warn); } .anomaly-history-icon.unknown-ble { background: var(--blue-muted); color: var(--blue-9); } .anomaly-history-icon.motion-during-away { background: var(--alert-muted); color: var(--alert); } .anomaly-history-icon.unusual-dwell { background: var(--alert-muted); color: var(--alert); } .anomaly-history-content { flex: 1; min-width: 0; } .anomaly-history-title { font-weight: 600; font-size: var(--text-sm); margin-bottom: 4px; } .anomaly-history-time { font-size: var(--text-xs); color: var(--text-muted); } .anomaly-history-score { font-size: var(--text-xs); padding: 2px 6px; border-radius: var(--radius-control); font-weight: 600; flex-shrink: 0; } .anomaly-history-score.high { background: var(--alert-muted); color: var(--alert); } .anomaly-history-score.medium { background: var(--warn-muted); color: var(--warn); } .anomaly-history-score.low { background: var(--warn-muted); color: var(--warn); } .anomaly-history-feedback { font-size: var(--text-xs); padding: 2px 6px; border-radius: var(--radius-control); flex-shrink: 0; } .anomaly-history-feedback.expected { background: var(--ok-muted); color: var(--ok); } .anomaly-history-feedback.intrusion { background: var(--alert-muted); color: var(--alert); } .anomaly-history-feedback.false-alarm { background: var(--alert-muted); color: var(--alert); } /* ── Zone Pulsing for Active Anomalies (3D View) ─────────────────────────────────── */ .anomaly-zone-pulse { animation: zone-pulse-red 2s infinite; } @keyframes zone-pulse-red { 0%, 100% { box-shadow: 0 0 10px var(--alert-border); border-color: var(--alert-muted); } 50% { box-shadow: 0 0 30px var(--alert-muted); border-color: var(--alert); } } /* ── Responsive ─────────────────────────────────────────────────────────────────── */ @media (max-width: 600px) { .anomaly-banner { padding: 20px; margin: 12px; } .anomaly-actions { flex-direction: column; } .anomaly-btn { width: 100%; } .modal-content { margin: 12px; max-width: calc(100% - 24px); } .security-dialog-stats { grid-template-columns: 1fr; } .security-dialog-actions { flex-direction: column; } .security-dialog-btn { width: 100%; } }