/**
 * Impersonation UI Styles
 *
 * Banner shown when impersonating another user, plus the member
 * picker modal triggered from the sidebar "View as…" button.
 */

/* ── Banner ──────────────────────────────────────────── */

.impersonate-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 20px;
  background: #dc2626;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.impersonate-banner-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.impersonate-banner-real {
  opacity: 0.75;
  font-size: 12px;
}

.impersonate-banner-stop {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.impersonate-banner-stop:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Push down the entire layout when the banner is visible */
body.impersonating .app-container {
  padding-top: 40px;
}

body.impersonating .sidebar {
  top: 40px;
  height: calc(100vh - 40px);
}

/* ── Trigger Button ──────────────────────────────────── */

.impersonate-trigger {
  font-size: 13px;
}

/* ── Member Picker Modal ─────────────────────────────── */

.impersonate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impersonate-modal {
  background: var(--bg-primary, #fff);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: min(440px, 90vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.impersonate-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.impersonate-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary, #111);
}

.impersonate-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary, #6b7280);
  padding: 0 4px;
  line-height: 1;
}

.impersonate-modal-body {
  padding: 12px 20px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.impersonate-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 8px;
  font-size: 15px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
  box-sizing: border-box;
  margin-bottom: 10px;
}

.impersonate-search:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.impersonate-results {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.impersonate-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  color: var(--text-primary, #111);
  border-radius: 6px;
}

.impersonate-result-item:hover {
  background: var(--bg-secondary, #f3f4f6);
}

.impersonate-result-name {
  font-weight: 500;
}

.impersonate-result-id {
  font-size: 12px;
  color: var(--text-tertiary, #9ca3af);
}

.impersonate-loading,
.impersonate-empty,
.impersonate-error,
.impersonate-more {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.impersonate-error {
  color: #ef4444;
}
