/* MessageComposer — Shared styling for SafeChannel and Peace Path */

.mc-root {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Moderation card (rewrite suggestion / flag) ──────────────────────── */
.mc-moderation-card {
  background: rgba(161, 74, 74, 0.08);
  border: 1px solid rgba(161, 74, 74, 0.25);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 14px;
}

.mc-mod-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1.4;
}

.mc-mod-body {
  flex: 1;
}

.mc-mod-title {
  font-weight: 700;
  color: rgba(252,165,165,.85);
  font-size: 14px;
  margin-bottom: 8px;
}

.mc-mod-reason {
  color: rgba(232,238,246,.60);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.mc-mod-rewrite {
  margin: 12px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid rgba(252,165,165,.3);
}

.mc-mod-rewrite-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(232,238,246,.60);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.mc-mod-rewrite-text {
  font-size: 13px;
  color: #e8eef6;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.mc-mod-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.mc-mod-btn {
  appearance: none;
  border: 1px solid rgba(252,165,165,.3);
  background: rgba(252,165,165,.08);
  color: rgba(252,165,165,.85);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
  transition: all 0.12s;
}

.mc-mod-btn:hover {
  background: rgba(252,165,165,.15);
  border-color: rgba(252,165,165,.4);
}

.mc-mod-btn-primary {
  background: linear-gradient(135deg, rgba(252,165,165,.15), rgba(252,165,165,.08));
  border-color: rgba(252,165,165,.4);
  color: rgba(252,165,165,.85);
}

.mc-mod-btn-primary:hover {
  background: linear-gradient(135deg, rgba(252,165,165,.25), rgba(252,165,165,.15));
  border-color: rgba(252,165,165,.5);
}

.mc-mod-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(252,165,165,.25);
  color: rgba(252,165,165,.85);
}

.mc-mod-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(252,165,165,.4);
}

.mc-mod-btn-tertiary {
  background: transparent;
  border-color: rgba(252,165,165,.2);
  color: rgba(232,238,246,.60);
}

.mc-mod-btn-tertiary:hover {
  background: rgba(252,165,165,.05);
  border-color: rgba(252,165,165,.3);
  color: rgba(252,165,165,.85);
}

/* ── Red flag warning banner ─────────────────────────────────────────── */
.mc-flag-banner {
  display: flex;
  gap: 12px;
  background: rgba(252,165,165,.06);
  border: 1px solid rgba(252,165,165,.25);
  border-radius: 12px;
  padding: 14px 16px;
}

.mc-flag-banner-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.mc-flag-banner-content {
  flex: 1;
}

.mc-flag-banner-title {
  font-weight: 700;
  color: rgba(252,165,165,.85);
  font-size: 14px;
  margin-bottom: 4px;
}

.mc-flag-banner-reason {
  color: rgba(232,238,246,.60);
  font-size: 13px;
  line-height: 1.5;
}

/* ── Delivery rules card ──────────────────────────────────────────────── */
.mc-delivery-card {
  background: rgba(96,165,250,.08);
  border: 1px solid rgba(96,165,250,.2);
  border-radius: 12px;
  padding: 14px 16px;
}

.mc-delivery-title {
  font-weight: 700;
  font-size: 13px;
  color: #e8eef6;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mc-delivery-body {
  font-size: 13px;
  color: rgba(232,238,246,.60);
  line-height: 1.6;
}

/* ── Compose + Assist Side-by-side Layout ──────────────────────────── */
.mc-compose-and-variants {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  align-items: start;
}

.mc-compose-left {
  display: flex;
  flex-direction: column;
}

/* ── Compose field ──────────────────────────────────────────────────── */
.mc-compose-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mc-label {
  font-weight: 600;
  font-size: 13px;
  color: #e8eef6;
}

.mc-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(96,165,250,.15);
  border-radius: 10px;
  color: #e8eef6;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 14px;
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mc-textarea:focus {
  border-color: rgba(96,165,250,.3);
  box-shadow: 0 0 0 3px rgba(96,165,250,.08);
}

.mc-char-count {
  font-size: 12px;
  color: rgba(232,238,246,.50);
  text-align: right;
  font-family: system-ui, sans-serif;
}

.mc-char-count.warn {
  color: #d4a63e;
}

/* ── AI Assist Section ───────────────────────────────────────────────── */
.mc-assist-section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(96,165,250,.15);
  border-radius: 12px;
  padding: 14px 16px;
}

.mc-assist-title {
  font-weight: 700;
  font-size: 12px;
  color: rgba(232,238,246,.60);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.mc-assist-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Empty state: Guide rules */
.mc-assist-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mc-guide-rule {
  padding: 10px 0;
}

.mc-guide-label {
  font-weight: 700;
  font-size: 13px;
  color: #e8eef6;
  margin-bottom: 4px;
}

.mc-guide-desc {
  font-size: 12px;
  color: rgba(232,238,246,.60);
  line-height: 1.5;
}

/* Loading state */
.mc-assist-loading {
  font-size: 13px;
  color: rgba(232,238,246,.50);
  font-style: italic;
}

/* Variant cards */
.mc-variant {
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(96,165,250,.15);
  border-radius: 8px;
}

.mc-variant-label {
  font-weight: 700;
  font-size: 13px;
  color: #e8eef6;
  margin-bottom: 8px;
}

.mc-variant-desc {
  font-weight: 400;
  font-size: 12px;
  color: rgba(232,238,246,.60);
  margin-left: 6px;
}

.mc-variant-text {
  font-size: 13px;
  color: #e8eef6;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  border-radius: 6px;
  line-height: 1.55;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

/* Idle state — placeholder before analysis results */
.mc-variant-text.mc-variant-idle {
  color: rgba(232,238,246,.50);
  font-style: italic;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.mc-variant-text.mc-variant-idle::before {
  content: attr(data-idle);
}

.mc-variant-text.mc-variant-idle:empty::before {
  content: attr(data-idle);
}

/* Content warning */
.mc-content-warning {
  padding: 10px 12px;
  background: rgba(252,165,165,.08);
  border: 1px solid rgba(252,165,165,.2);
  border-radius: 6px;
  font-size: 13px;
  color: rgba(252,165,165,.85);
  margin-bottom: 8px;
}

.mc-warning-flags {
  font-size: 12px;
  color: rgba(252,165,165,.85);
  margin-top: 4px;
}

/* ── Actions ──────────────────────────────────────────────────────────── */
.mc-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.mc-action-primary {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mc-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #e8eef6;
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
  transition: all 0.12s;
}

.mc-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.mc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mc-btn-primary {
  background: linear-gradient(135deg, rgba(96,165,250,.3), rgba(52,211,153,.2));
  border-color: rgba(96,165,250,.3);
}

.mc-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(96,165,250,.4), rgba(52,211,153,.3));
}

.mc-btn-urgent {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  padding: 11px 14px;
  color: #e8eef6;
}

.mc-btn-urgent.enabled {
  border-color: rgba(212, 166, 62, 0.4);
  background: rgba(212, 166, 62, 0.12);
  color: rgba(212, 166, 62, 0.9);
}

.mc-btn-urgent.enabled:hover {
  background: rgba(212, 166, 62, 0.15);
}

.mc-btn-urgent.disabled-tier {
  opacity: 0.45;
  cursor: not-allowed;
}

.mc-btn-variant {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: linear-gradient(135deg, rgba(96,165,250,.15), rgba(52,211,153,.1));
  border-color: rgba(96,165,250,.2);
  color: #e8eef6;
  font-size: 13px;
  margin-top: 6px;
}

.mc-btn-variant:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(96,165,250,.25), rgba(52,211,153,.15));
  border-color: rgba(96,165,250,.3);
}

/* ── Notice text ──────────────────────────────────────────────────────── */
.mc-notice {
  font-size: 12px;
  color: rgba(232,238,246,.50);
  font-style: italic;
  font-family: system-ui, sans-serif;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .mc-compose-and-variants {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mc-action-primary {
    flex-direction: column;
  }

  .mc-btn {
    flex: 1;
  }

  .mc-textarea {
    min-height: 100px;
  }
}
