/**
 * Alert panel — slide-out panel from the right (triggered by header alert icon)
 */

/* Alert icon badge (shown when Guardian detects sensitive data on send) */
#alertPanelBtn {
  position: relative;
}
.alert-panel-btn-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dc2626;
  border: 2px solid var(--color-surface, #fff);
  pointer-events: none;
}
.alert-panel-btn-badge[hidden] {
  display: none !important;
}

/* Needs attention banner (header top-right, shown when Guardian detects sensitive data) */
.needs-attention-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
}
.needs-attention-banner:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.needs-attention-banner[hidden] {
  display: none !important;
}
.needs-attention-banner__icon {
  font-size: 14px;
  line-height: 1;
}
.needs-attention-banner__text {
  letter-spacing: 0.02em;
}

.alert-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--color-surface);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  display: flex;
  flex-direction: column;
}

.alert-panel.is-open {
  transform: translateX(0);
}

.alert-panel__backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.alert-panel__backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.alert-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.alert-panel__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.alert-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}

.alert-panel__close:hover {
  background: var(--color-neutral-100);
  color: var(--color-text);
}

.alert-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.alert-panel__empty {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
}

.alert-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.alert-panel__body:has(.alert-panel__list .alert-panel__item) .alert-panel__empty {
  display: none;
}

.alert-panel__item {
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--color-neutral-50, #f9fafb);
  border-radius: 10px;
  border-left: 4px solid #f59e0b;
  font-size: 13px;
}

.alert-panel__item--clickable {
  cursor: pointer;
}

.alert-panel__item--clickable:hover {
  background: var(--color-neutral-100, #f3f4f6);
}

.alert-panel__item-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}

.alert-panel__item-row:last-child {
  margin-bottom: 0;
}

.alert-panel__item-label {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--color-text-secondary);
  min-width: 58px;
}

.alert-panel__item-value {
  color: var(--color-text);
  word-break: break-word;
}

.alert-panel__item-value--preview {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  max-height: 3.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.alert-panel__item-time {
  font-size: 11px;
  color: var(--color-text-tertiary, #9ca3af);
  margin-top: 8px;
}
