/* styles-additions-v25.css — MB8.5: Diagnostics overlay + batch-setup banner +
 * edit contact button + smart-add buttons
 *
 * Loaded AFTER v24.css. Cache buster v=195.
 *
 * Sections:
 *   1. Diagnostics panel overlay (F6)
 *   2. Batch-setup banner in Contacts view (F4)
 *   3. Smart-add buttons (F4)
 *   4. Edit-contact button in composer (F3)
 *   5. Composer no-email state — layout fix (F2)
 */


/* =============================================================
 * 1. Diagnostics panel overlay (F6)
 * ============================================================= */

.diag-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3, 12px);
  animation: diag-fade-in 200ms ease-out;
}
@keyframes diag-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.diag-panel {
  background: var(--surface-card, #fff);
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.24);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--text-primary, #171717);
}

.diag-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3, 12px) var(--space-4, 16px);
  border-bottom: 1px solid var(--border-default, #e5e5e5);
}
.diag-panel-title {
  font-weight: 600;
  font-size: 15px;
}
.diag-panel-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-tertiary, #a3a3a3);
  padding: 4px 8px;
}
.diag-panel-close:hover { color: var(--text-primary, #171717); }

.diag-panel-body {
  overflow-y: auto;
  padding: var(--space-3, 12px) var(--space-4, 16px);
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 16px);
}

.diag-section { display: flex; flex-direction: column; gap: var(--space-2, 8px); }
.diag-section-title {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary, #a3a3a3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.diag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.diag-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-default, #e5e5e5);
  vertical-align: top;
}
.diag-table td:first-child {
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text-secondary, #525252);
  width: 1%;
  white-space: nowrap;
}

.diag-clear-errors-btn {
  background: transparent;
  border: 1px solid var(--border-default, #e5e5e5);
  border-radius: 4px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  color: var(--text-secondary, #525252);
}
.diag-clear-errors-btn:hover { background: var(--surface-subtle, #f8f8f7); }

.diag-test-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
}
.diag-test-btn {
  padding: 8px 12px;
  background: var(--text-primary, #171717);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.diag-test-btn:hover { background: #333; }

.diag-test-results {
  max-height: 160px;
  overflow-y: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  background: var(--surface-subtle, #f8f8f7);
  border-radius: 4px;
  padding: var(--space-2, 8px);
  border: 1px solid var(--border-default, #e5e5e5);
  min-height: 40px;
}
.diag-test-results:empty::before {
  content: 'No tests run yet.';
  color: var(--text-tertiary, #a3a3a3);
  font-style: italic;
}
.diag-test-pass { color: var(--color-pass, #16a34a); padding: 2px 0; }
.diag-test-fail { color: var(--color-critical, #dc2626); padding: 2px 0; }

.diag-danger {
  background: rgba(220, 38, 38, 0.04);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 6px;
  padding: var(--space-3, 12px);
}
.diag-danger-btn {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: var(--color-critical, #dc2626);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  margin-top: var(--space-2, 8px);
}
.diag-danger-btn:hover { background: #b91c1c; }
.diag-danger-hint {
  margin-top: var(--space-2, 8px);
  font-size: 11px;
  color: var(--text-secondary, #525252);
  line-height: 1.4;
}


/* =============================================================
 * 2. Batch-setup banner in Contacts view (F4)
 * ============================================================= */

.cl-batch-setup-banner {
  /* Shown when entering Contacts via "New batch" tab */
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  background: rgba(255, 213, 0, 0.10);
  border: 1px solid var(--color-accent, #FFD500);
  border-radius: 6px;
  margin-bottom: var(--space-3, 12px);
  flex-wrap: wrap;
}
.cl-batch-setup-icon {
  font-size: 18px;
  color: var(--text-primary, #171717);
}
.cl-batch-setup-text {
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  color: var(--text-primary, #171717);
}
.cl-batch-setup-text strong {
  font-weight: 600;
}
.cl-batch-setup-cancel {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-strong, #d4d4d4);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary, #525252);
  cursor: pointer;
  font-family: inherit;
}
.cl-batch-setup-cancel:hover { background: var(--surface-subtle, #f8f8f7); }


/* =============================================================
 * 3. Smart-add buttons (F4)
 * ============================================================= */

.cl-smart-add-row {
  display: flex;
  gap: var(--space-2, 8px);
  margin-bottom: var(--space-3, 12px);
  flex-wrap: wrap;
}
.cl-smart-add-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1, 4px);
  padding: 6px 12px;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-default, #e5e5e5);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-primary, #171717);
  white-space: nowrap;
}
.cl-smart-add-btn:hover {
  background: var(--surface-subtle, #f8f8f7);
  border-color: var(--border-strong, #d4d4d4);
}
.cl-smart-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cl-smart-add-count {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--text-secondary, #525252);
  margin-left: 2px;
}


/* =============================================================
 * 4. Edit-contact button in composer (F3)
 * ============================================================= */

.ec-edit-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1, 4px);
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-default, #e5e5e5);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-secondary, #525252);
  margin-left: var(--space-2, 8px);
}
.ec-edit-contact-btn:hover {
  background: var(--surface-subtle, #f8f8f7);
  color: var(--text-primary, #171717);
}

/* When placed next to the recipient picker, vertical-align with the select */
.ec-recipient-row {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
}


/* =============================================================
 * 5. Composer no-email state — layout fix (F2)
 * ============================================================= */

/* Previous design: when no email on file, the form short-circuited and left
 * the left column empty below the warning. Fix: keep the warning as a banner
 * at the top of the form, and let the carousel + body editor render below it
 * normally. Send / Open-in-Outlook buttons get disabled (visual gray) while
 * Save Draft stays enabled. */

.ec-no-email-banner {
  /* The pink/red warning panel, but as a banner not a replacement */
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 6px;
  margin-bottom: var(--space-3, 12px);
}
.ec-no-email-banner-title {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  font-weight: 500;
  font-size: 13px;
  color: var(--color-critical, #dc2626);
}
.ec-no-email-banner-hint {
  font-size: 12px;
  color: var(--text-secondary, #525252);
  line-height: 1.4;
}
.ec-no-email-banner-actions {
  display: flex;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
  margin-top: var(--space-1, 4px);
}
.ec-no-email-add-btn,
.ec-no-email-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1, 4px);
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  border-radius: 4px;
  cursor: pointer;
}
.ec-no-email-add-btn {
  background: var(--color-critical, #dc2626);
  color: #fff;
  border: none;
}
.ec-no-email-add-btn:hover { background: #b91c1c; }
.ec-no-email-edit-btn {
  background: transparent;
  color: var(--text-primary, #171717);
  border: 1px solid var(--border-default, #e5e5e5);
}
.ec-no-email-edit-btn:hover { background: var(--surface-subtle, #f8f8f7); }

/* Disabled send buttons in no-email state */
.ec-send-bar button:disabled,
button.ec-send-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Diagnostics trigger affordance on the version stamp */
#app-version-stamp {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
