/* styles-additions-v13.css
   ============================================================
   Phase A.1/A.2: Email Outreach as its own section.
   - Top-nav mode toggle (Dashboard / Email Outreach)
   - Email Outreach section shell with sub-tabs
   - Card detail overlay with prev/next navigation
   Utility-grade. Pastel polish + radar charts come in a later phase.
   ============================================================ */

/* ----- Mode visibility (set by app-mode.js via body class) ----- */

body.app-mode-dashboard      #email-outreach-root { display: none; }
body.app-mode-email-outreach #dashboard-root      { display: none; }

#email-outreach-root {
  /* top padding clears the absolute-positioned #app-mode-nav */
  padding: 64px 32px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ----- Top-nav mode toggle ----- */

#app-mode-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.app-mode-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-text-muted, #555);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.app-mode-btn:hover {
  border-color: rgba(0,0,0,0.25);
  color: var(--ds-text, #2a2a2a);
}

.app-mode-btn-active {
  background: var(--ds-text, #1a1a1a);
  color: #fff;
  border-color: var(--ds-text, #1a1a1a);
}

.app-mode-btn-active:hover {
  background: var(--ds-text, #1a1a1a);
  color: #fff;
}

/* ----- Email Outreach header ----- */

.eo-header {
  margin-bottom: 24px;
}

.eo-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.eo-back {
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--ds-text-muted, #777);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
}

.eo-back:hover {
  color: var(--ds-text, #2a2a2a);
  background: rgba(0,0,0,0.04);
}

.eo-title {
  font-size: 24px;
  font-weight: 600;
  font-family: var(--ds-font-serif, ui-serif, Georgia, serif);
  color: var(--ds-text, #1a1a1a);
}

.eo-spacer {
  flex: 1;
}

/* ----- Sub-tabs ----- */

.eo-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(0,0,0,0.10);
}

.eo-tab {
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-text-muted, #777);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.eo-tab:hover {
  color: var(--ds-text, #2a2a2a);
}

.eo-tab-active {
  color: var(--ds-text, #1a1a1a);
  border-bottom-color: var(--ds-text, #1a1a1a);
  font-weight: 600;
}

.eo-tab-count {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(0,0,0,0.08);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--ds-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

.eo-tab-active .eo-tab-count {
  background: var(--ds-text, #1a1a1a);
  color: #fff;
}

/* ----- Body / list area ----- */

.eo-body {
  min-height: 200px;
}

.eo-help {
  font-size: 12px;
  color: var(--ds-text-muted, #888);
  padding: 0 4px 12px;
  letter-spacing: 0.02em;
}

.eo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* The Outbox cards reuse .ob-card from styles-additions-v12.css.
   Inside the EO section we may want them to feel slightly different but
   for utility-grade Phase A we keep them visually identical. */

/* ----- Empty state ----- */

.eo-empty {
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed rgba(0,0,0,0.15);
  border-radius: 12px;
  background: rgba(255,255,255,0.4);
}

.eo-empty-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ds-text, #2a2a2a);
}

.eo-empty-sub {
  font-size: 13px;
  color: var(--ds-text-muted, #777);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

.eo-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  font-family: var(--ds-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  margin: 0 2px;
}

/* ============================================================
   Card detail overlay
   ============================================================ */

.ecd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9000;
  display: flex;
  align-items: center;        /* center vertically — was flex-start */
  justify-content: center;
  padding: 32px 16px;
  /* removed overflow-y: auto — content scrolls inside .ecd-content now */
}

.ecd-overlay.ecd-hidden {
  display: none;
}

.ecd-overlay-inner {
  width: 100%;
  max-width: 800px;
  max-height: calc(100vh - 64px);  /* fit in viewport minus padding */
  background: var(--ds-card-bg, #faf6ee);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  /* removed min-height: 400px — let content size naturally */
}

/* ----- Top bar ----- */

.ecd-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.10);
  flex-shrink: 0;  /* stays visible at top of overlay */
}

.ecd-close {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ds-text-muted, #555);
  cursor: pointer;
  font-family: inherit;
}

.ecd-close:hover {
  background: rgba(0,0,0,0.05);
  color: var(--ds-text, #1a1a1a);
}

.ecd-position {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--ds-text-muted, #888);
  font-family: var(--ds-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  letter-spacing: 0.04em;
}

.ecd-nav {
  display: flex;
  gap: 4px;
}

.ecd-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.12);
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  color: var(--ds-text, #1a1a1a);
}

.ecd-nav-btn:hover:not([disabled]) {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.25);
}

.ecd-nav-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ----- Content area ----- */

.ecd-content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;  /* internal scroll for long emails */
  min-height: 0;     /* required for flex item to shrink below content size */
}

.ecd-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.ecd-account-name {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--ds-font-serif, ui-serif, Georgia, serif);
  color: var(--ds-text, #1a1a1a);
}

.ecd-sent-at {
  font-size: 12px;
  color: var(--ds-text-muted, #888);
  margin-bottom: 18px;
  font-family: var(--ds-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

/* ----- Status badges (sized larger than ob-status) ----- */

.ecd-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--ds-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}
.ecd-status-draft  { background: rgba(120,120,120,0.18); color: #444; }
.ecd-status-queued { background: rgba(200,140,40,0.20);  color: #7a5010; }
.ecd-status-failed { background: rgba(200,40,40,0.20);   color: #8a2020; }
.ecd-status-sent   { background: rgba(40,160,80,0.20);   color: #1f6638; }
.ecd-status-default { background: rgba(0,0,0,0.06); color: #555; }

/* ----- Meta grid (To / Subject / Attachments) ----- */

.ecd-meta-grid {
  margin-top: 8px;
  margin-bottom: 24px;
  border-top: 1px solid rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 14px 0;
}

.ecd-meta-row {
  display: flex;
  gap: 16px;
  padding: 6px 0;
  font-size: 13px;
}

.ecd-meta-label {
  flex-shrink: 0;
  width: 100px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ds-text-muted, #888);
  padding-top: 2px;
}

.ecd-meta-value {
  flex: 1;
  color: var(--ds-text, #1a1a1a);
  word-break: break-word;
}

.ecd-attachment {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.05);
  font-size: 12px;
  color: var(--ds-text, #2a2a2a);
}

.ecd-no-attachments {
  color: var(--ds-text-muted, #999);
  font-style: italic;
  font-size: 12px;
}

/* ----- Body text ----- */

.ecd-body-section {
  margin-top: 8px;
}

.ecd-body-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ds-text-muted, #888);
  margin-bottom: 8px;
}

.ecd-body-text {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ds-text, #1a1a1a);
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 80px;
}

/* ----- Action bar ----- */

.ecd-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid rgba(0,0,0,0.10);
  flex-shrink: 0;  /* stays visible at bottom of overlay */
  background: var(--ds-card-bg, #faf6ee);  /* match overlay-inner bg */
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.ecd-actions-spacer {
  flex: 1;
}

.ecd-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.12);
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ecd-btn:hover {
  border-color: rgba(0,0,0,0.25);
}

.ecd-btn-edit {
  background: transparent;
  color: var(--ds-text, #2a2a2a);
}

.ecd-btn-edit:hover {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.30);
}

.ecd-btn-send {
  background: var(--ds-text, #1a1a1a);
  color: #fff;
  border-color: var(--ds-text, #1a1a1a);
}

.ecd-btn-send:hover {
  background: #000;
  border-color: #000;
}

.ecd-btn-delete {
  color: #a02525;
}

.ecd-btn-delete:hover {
  background: rgba(160,30,30,0.06);
  border-color: rgba(160,30,30,0.30);
}

.ecd-btn-followup {
  color: #1e5fa8;
  border-color: rgba(30,95,168,0.20);
}

.ecd-btn-followup:hover {
  background: rgba(30,95,168,0.06);
  border-color: rgba(30,95,168,0.40);
}

.ecd-btn-back {
  margin-top: 16px;
}

/* ----- Empty state inside detail ----- */

.ecd-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--ds-text-muted, #777);
}
