/* Build 24: oddly action card + queue layout.
 *
 * Self-contained styles for the card UI rendered by /shared/oddly-actions.js.
 * Uses the brand teal (#2c7873) for primary accents; severity colours
 * are inlined per-card via CSS custom properties so the matrix stays in
 * one place (shared/oddly-actions.js).
 */

/* ---------- Queue layout ---------- */
.oa-queue {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .oa-queue {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Filter bar */
.oa-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
}
.oa-filter {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #57506b;
  background: #f4f4f5;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.oa-filter:hover { color: #1f5f5b; }
.oa-filter.active {
  background: #e8f0ef;
  color: #1f5f5b;
  border-color: #b5d3d0;
}
.oa-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.oa-filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-right: 4px;
}
.oa-filter-divider {
  width: 1px;
  background: #e4e4e7;
  margin: 0 4px;
  align-self: stretch;
}

/* Counter badge (consumed by the topnav) */
.oa-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #2c7873;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.oa-counter.empty { background: #e4e4e7; color: #57506b; }

/* ---------- Card ---------- */
.oa-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-left: 4px solid var(--sev-color, #2c7873);
  border-radius: 12px;
  padding: 16px 18px 14px;
  box-shadow: 0 4px 14px rgba(31, 95, 91, 0.05);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.oa-card.oa-snap { transition: transform 220ms ease-out, opacity 220ms ease-out; }
.oa-card[data-status="executed"] { opacity: 0.78; }
.oa-card[data-status="dismissed"], .oa-card[data-status="snoozed"] {
  opacity: 0.55;
  pointer-events: none;
}

/* Swipe overlays (mobile only by default; desktop hides them) */
.oa-swipe-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 1;
}
.oa-overlay-approve {
  background: rgba(22, 163, 74, 0.92);
  color: #ffffff;
  opacity: var(--oa-overlay-approve, 0);
}
.oa-overlay-dismiss {
  background: rgba(220, 38, 38, 0.92);
  color: #ffffff;
  opacity: var(--oa-overlay-dismiss, 0);
}
.oa-overlay-snooze {
  background: rgba(217, 119, 6, 0.92);
  color: #ffffff;
  opacity: var(--oa-overlay-snooze, 0);
}
.oa-swipe-overlay svg { width: 56px; height: 56px; stroke-width: 3; }

/* ---------- Card head: severity badge + source ---------- */
.oa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.oa-sev-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.oa-sev-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: currentColor;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.oa-sev-icon::after { color: var(--sev-bg); }
.oa-sev-badge .oa-sev-icon {
  /* Reverse the colour mapping so the icon contrasts against the badge bg. */
  background: var(--sev-color);
  color: #ffffff;
}
.oa-source {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Build 33: tier pill rendered in the card head next to the source. */
.oa-tier-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  line-height: 1;
}
.oa-tier-pill.nudge { border: 1px solid #b5d3d0; color: #1f5f5b; background: transparent; }
.oa-tier-pill.steer { background: #2c7873; color: #ffffff; }
.oa-tier-pill.addon { background: #fef3c7; color: #92400e; }
/* Build 44.17: parallel set on the action-card chip so callers can
   tag features behind any tier the platform ships, not just the
   nudge/steer/addon trio that 33 originally needed. Same OEG palette
   mapping as /dashboard/integrations and /onboard. */
.oa-tier-pill.watch       { background: #fafaf7; color: #2c7873; box-shadow: inset 0 0 0 1px #2c7873; }
.oa-tier-pill.spark       { background: #2c7873; color: #fafaf7; }
.oa-tier-pill.solopreneur { background: #1a1a2e; color: #fafaf7; box-shadow: inset 0 0 0 1px #b08d57; }
.oa-tier-pill.studio      { background: #1a1a2e; color: #fafaf7; box-shadow: inset 0 0 0 1.5px #b08d57; }
.oa-tier-pill.studio-pro  { background: linear-gradient(135deg, #1a1a2e 0%, #2c2240 55%, #b08d57 130%); color: #fafaf7; }
.oa-tier-pill.enterprise  { background: linear-gradient(135deg, #0f0f1d 0%, #1a1a2e 55%, #b08d57 140%); color: #fafaf7; box-shadow: inset 0 0 0 1px #b08d57; }

/* ---------- Card body ---------- */
.oa-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: #1f1b2e;
  margin: 0 0 6px;
  line-height: 1.35;
}
.oa-context {
  font-size: 13px;
  line-height: 1.55;
  color: #57506b;
  margin: 0 0 6px;
}
.oa-impact {
  font-size: 13px;
  line-height: 1.5;
  color: #1f1b2e;
  background: #e8f0ef;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 8px 0 0;
  font-weight: 500;
}

/* ---------- Card footer + buttons ---------- */
.oa-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.oa-meta {
  font-size: 12px;
  color: #94a3b8;
}
.oa-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.oa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.oa-btn-icon { display: inline-flex; }
.oa-approve {
  background: #16a34a;
  color: #ffffff;
}
.oa-approve:hover { background: #15803d; }
.oa-dismiss {
  background: #ffffff;
  color: #57506b;
  border-color: #e4e4e7;
}
.oa-dismiss:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.oa-snooze {
  background: #ffffff;
  color: #57506b;
  border-color: #e4e4e7;
}
.oa-snooze:hover {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

/* Snooze duration picker */
.oa-snooze-wrap { position: relative; }
.oa-snooze-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 11, 26, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  min-width: 140px;
}
.oa-snooze-menu button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1f1b2e;
  background: transparent;
  border: none;
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.oa-snooze-menu button:hover { background: #e8f0ef; color: #1f5f5b; }

/* Watch tier upgrade nudge */
.oa-upgrade {
  flex-basis: 100%;
  margin-top: 8px;
  font-size: 12px;
  color: #1f5f5b;
  background: #e8f0ef;
  border: 1px solid #d4e5e3;
  border-radius: 8px;
  padding: 8px 12px;
}
.oa-upgrade-link {
  color: #1f5f5b;
  font-weight: 700;
  text-decoration: underline;
}

/* Steer auto-approved badge */
.oa-auto-approved {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: #15803d;
  flex-wrap: wrap;
}
.oa-auto-pill {
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
}
.oa-auto-meta { color: #57506b; }
.oa-undo-link {
  background: transparent;
  border: none;
  font: inherit;
  color: #1f5f5b;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ---------- Empty state ---------- */
.oa-empty {
  background: #ffffff;
  border: 1px dashed #b5d3d0;
  border-radius: 14px;
  padding: 36px 24px;
  text-align: center;
  color: #57506b;
}
.oa-empty .oa-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e8f0ef;
  color: #1f5f5b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.oa-empty h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1f1b2e;
  margin: 0 0 6px;
}
.oa-empty p {
  font-size: 13px;
  color: #57506b;
  margin: 0;
}

/* ---------- Mobile swipe deck ---------- */
@media (max-width: 767px) {
  .oa-queue {
    /* Stack the cards vertically on mobile so the topmost card is the
     * one ready to swipe. The container height adapts to the active card. */
    display: block;
    position: relative;
  }
  .oa-card {
    margin-bottom: 14px;
  }
  /* Hide explicit buttons on mobile; gestures replace them. The snooze
   * dropdown still surfaces when summoned by a swipe-down. */
  .oa-card .oa-btn-label { display: none; }
  .oa-card .oa-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }
}

/* Desktop: hide the swipe overlays so they don't show on hover/click
 * (they are only relevant during a touch gesture). */
@media (min-width: 768px) {
  .oa-swipe-overlay { display: none; }
  .oa-card { touch-action: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .oa-card.oa-snap { transition: none; }
  .oa-swipe-overlay { transition: none; }
}
