/* 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: #a14a4a;
  font-size: 14px;
  margin-bottom: 8px;
}

.mc-mod-reason {
  color: #8b5a5a;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.mc-mod-rewrite {
  margin: 12px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  border-left: 3px solid rgba(161, 74, 74, 0.3);
}

.mc-mod-rewrite-label {
  font-size: 12px;
  font-weight: 600;
  color: #8b5a5a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.mc-mod-rewrite-text {
  font-size: 13px;
  color: #1f2a2e;
  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(161, 74, 74, 0.3);
  background: rgba(161, 74, 74, 0.08);
  color: #8b5a5a;
  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(161, 74, 74, 0.15);
  border-color: rgba(161, 74, 74, 0.4);
}

.mc-mod-btn-primary {
  background: linear-gradient(135deg, rgba(161, 74, 74, 0.2), rgba(139, 90, 90, 0.15));
  border-color: rgba(161, 74, 74, 0.4);
  color: #8b5a5a;
}

.mc-mod-btn-primary:hover {
  background: linear-gradient(135deg, rgba(161, 74, 74, 0.3), rgba(139, 90, 90, 0.25));
  border-color: rgba(161, 74, 74, 0.5);
}

.mc-mod-btn-secondary {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(161, 74, 74, 0.25);
  color: #8b5a5a;
}

.mc-mod-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(161, 74, 74, 0.4);
}

.mc-mod-btn-tertiary {
  background: transparent;
  border-color: rgba(161, 74, 74, 0.2);
  color: #a0adb3;
}

.mc-mod-btn-tertiary:hover {
  background: rgba(161, 74, 74, 0.05);
  border-color: rgba(161, 74, 74, 0.3);
  color: #8b5a5a;
}

/* ── Red flag warning banner ─────────────────────────────────────────── */
.mc-flag-banner {
  display: flex;
  gap: 12px;
  background: rgba(161, 74, 74, 0.06);
  border: 1px solid rgba(161, 74, 74, 0.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: #a14a4a;
  font-size: 14px;
  margin-bottom: 4px;
}

.mc-flag-banner-reason {
  color: #8b5a5a;
  font-size: 13px;
  line-height: 1.5;
}

/* ── Delivery rules card ──────────────────────────────────────────────── */
.mc-delivery-card {
  background: rgba(184, 211, 214, 0.08);
  border: 1px solid rgba(184, 211, 214, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
}

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

.mc-delivery-body {
  font-size: 13px;
  color: #4b5a60;
  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: #1f2a2e;
}

.mc-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(231, 221, 208, 0.7);
  border-radius: 10px;
  color: #1f2a2e;
  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(184, 211, 214, 0.5);
  box-shadow: 0 0 0 3px rgba(184, 211, 214, 0.1);
}

.mc-char-count {
  font-size: 12px;
  color: #a0adb3;
  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.6);
  border: 1px solid rgba(231, 221, 208, 0.6);
  border-radius: 12px;
  padding: 14px 16px;
}

.mc-assist-title {
  font-weight: 700;
  font-size: 12px;
  color: #4b5a60;
  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: #1f2a2e;
  margin-bottom: 4px;
}

.mc-guide-desc {
  font-size: 12px;
  color: #4b5a60;
  line-height: 1.5;
}

/* Loading state */
.mc-assist-loading {
  font-size: 13px;
  color: #a0adb3;
  font-style: italic;
}

/* Variant cards */
.mc-variant {
  padding: 12px;
  background: rgba(243, 234, 220, 0.3);
  border: 1px solid rgba(231, 221, 208, 0.5);
  border-radius: 8px;
}

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

.mc-variant-desc {
  font-weight: 400;
  font-size: 12px;
  color: #4b5a60;
  margin-left: 6px;
}

.mc-variant-text {
  font-size: 13px;
  color: #1f2a2e;
  background: rgba(255, 255, 255, 0.7);
  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;
}

/* Content warning */
.mc-content-warning {
  padding: 10px 12px;
  background: rgba(161, 74, 74, 0.08);
  border: 1px solid rgba(161, 74, 74, 0.2);
  border-radius: 6px;
  font-size: 13px;
  color: #8b5a5a;
  margin-bottom: 8px;
}

.mc-warning-flags {
  font-size: 12px;
  color: #a14a4a;
  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(31, 42, 46, 0.16);
  background: #f0ebe0;
  color: #1f2a2e;
  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(31, 42, 46, 0.28);
  background: #e8dfd3;
}

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

.mc-btn-primary {
  background: linear-gradient(135deg, rgba(184, 211, 214, 0.85), rgba(216, 196, 184, 0.55));
  border-color: rgba(31, 42, 46, 0.18);
}

.mc-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(184, 211, 214, 1), rgba(216, 196, 184, 0.7));
}

.mc-btn-urgent {
  background: #f0ebe0;
  border-color: rgba(31, 42, 46, 0.16);
  padding: 11px 14px;
}

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

.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(184, 211, 214, 0.6), rgba(216, 196, 184, 0.35));
  border-color: rgba(184, 211, 214, 0.3);
  color: #1f2a2e;
  font-size: 13px;
  margin-top: 6px;
}

.mc-btn-variant:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(184, 211, 214, 0.75), rgba(216, 196, 184, 0.5));
  border-color: rgba(184, 211, 214, 0.5);
}

/* ── Notice text ──────────────────────────────────────────────────────── */
.mc-notice {
  font-size: 12px;
  color: #a0adb3;
  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;
  }
}
