/* Threshold Alerts Panel — slide-out panel for momentum_alerts feed */

/* Overlay */
.tap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9100;
  display: none;
}
.tap-overlay.open { display: block; }

/* Panel */
.tap-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: #fff;
  box-shadow: -4px 0 40px rgba(0, 0, 0, 0.18);
  z-index: 9101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.tap-panel.open { transform: translateX(0); }

/* Header */
.tap-header {
  padding: 20px 20px 0;
  border-bottom: 1px solid #e0e0dc;
  flex-shrink: 0;
  background: #fff;
}
.tap-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.tap-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #0a0a0a;
  letter-spacing: -0.2px;
}
.tap-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #6b6b6b;
  transition: background 0.15s;
}
.tap-close-btn:hover { background: #f5f4f0; color: #0a0a0a; }

/* Body */
.tap-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* Loading / empty states */
.tap-loading, .tap-empty {
  padding: 48px 20px;
  text-align: center;
  color: #6b6b6b;
  font-size: 14px;
  line-height: 1.6;
}
.tap-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.tap-empty-sub {
  font-size: 12px;
  color: #9e9e9e;
  margin-top: 6px;
}

/* Alert card */
.tap-alert-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px 20px;
  border-bottom: 1px solid #e0e0dc;
  transition: background 0.12s;
  position: relative;
}
.tap-alert-card:last-child { border-bottom: none; }
.tap-alert-card:hover { background: #fafaf8; }

/* Severity left bar */
.tap-alert-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--tap-severity-color, #e0e0dc);
}

/* Card top row */
.tap-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.tap-company-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #0a0a0a;
  cursor: pointer;
  text-decoration: none;
}
.tap-company-name:hover { color: #1a5c2a; text-decoration: underline; }
.tap-timestamp {
  font-size: 11px;
  color: #9e9e9e;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Score delta row */
.tap-score-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
}
.tap-score-prev {
  font-weight: 600;
  color: #0a0a0a;
}
.tap-score-arrow {
  color: #c62828;
  font-size: 12px;
}
.tap-score-curr {
  font-weight: 700;
  color: #c62828;
}
.tap-threshold-label {
  font-size: 11px;
  color: #6b6b6b;
  background: #f5f4f0;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 2px;
}

/* Severity badge */
.tap-severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tap-severity-badge.critical  { background: #ffebee; color: #b71c1c; }
.tap-severity-badge.high      { background: #fff3e0; color: #e65100; }
.tap-severity-badge.moderate  { background: #fff8e1; color: #f57f17; }
.tap-severity-badge.low       { background: #f5f4f0; color: #6b6b6b; }

/* Action row */
.tap-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tap-btn-view {
  font-size: 12px;
  font-weight: 600;
  color: #1a5c2a;
  background: #e8f5e9;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.tap-btn-view:hover { background: #c8e6c9; }
.tap-btn-dismiss {
  font-size: 12px;
  color: #9e9e9e;
  background: none;
  border: 1px solid #e0e0dc;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.tap-btn-dismiss:hover { background: #f5f4f0; color: #0a0a0a; border-color: #ccc; }
.tap-btn-dismiss:disabled { opacity: 0.4; cursor: not-allowed; }

/* Mobile */
@media (max-width: 480px) {
  .tap-panel { width: 100vw; }
}
