/* ═══════════════════════════════════════════════════════════════
   AI Work Coach — Smart Conversational Creation Overlay
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay container ── */
.wk-coach-overlay {
  position: fixed; z-index: 14000;
  inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(15,23,42,.35);
  backdrop-filter: blur(4px);
  animation: wkCoachBgIn .2s ease;
}
.wk-coach-overlay.is-open { display: flex; }
@keyframes wkCoachBgIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Shell ── */
.wk-coach-shell {
  width: 520px; max-width: 92vw;
  max-height: 82vh;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: wkCoachIn .25s ease;
}
@keyframes wkCoachIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ── Topbar ── */
.wk-coach-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  flex-shrink: 0;
}
.wk-coach-topbar-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wk-coach-topbar-icon svg { width: 16px; height: 16px; stroke: #fff; fill: none; }
.wk-coach-topbar-title {
  font-size: 14px; font-weight: 700; color: #fff; flex: 1;
}
.wk-coach-topbar-close {
  width: 28px; height: 28px; border: none;
  background: rgba(255,255,255,.15); border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.8); transition: all .15s; flex-shrink: 0;
}
.wk-coach-topbar-close:hover { background: rgba(255,255,255,.25); color: #fff; }
.wk-coach-topbar-close svg { width: 14px; height: 14px; }

/* ── Messages area ── */
.wk-coach-msgs {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 200px;
}

/* ── Message bubbles ── */
.wk-coach-msg {
  max-width: 88%; animation: wkMsgIn .2s ease;
}
@keyframes wkMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.wk-coach-msg--ai { align-self: flex-start; }
.wk-coach-msg--user { align-self: flex-end; }

.wk-coach-bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.6; color: #1e293b;
}
.wk-coach-msg--ai .wk-coach-bubble {
  background: #f1f5f9; border-bottom-left-radius: 4px;
}
.wk-coach-msg--user .wk-coach-bubble {
  background: #7c3aed; color: #fff;
  border-bottom-right-radius: 4px;
}

/* Markdown-like formatting inside AI bubbles */
.wk-coach-msg--ai .wk-coach-bubble strong { font-weight: 700; color: #0f172a; }
.wk-coach-msg--ai .wk-coach-bubble em { font-style: italic; }

/* ── Typing indicator ── */
.wk-coach-typing {
  display: flex; gap: 4px; padding: 12px 16px;
  align-self: flex-start;
}
.wk-coach-typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #94a3b8;
  animation: wkTypeDot .8s ease infinite;
}
.wk-coach-typing-dot:nth-child(2) { animation-delay: .15s; }
.wk-coach-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes wkTypeDot {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* ── Chip rows (for goal/project picker) ── */
.wk-coach-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 20px 8px;
  animation: wkMsgIn .25s ease;
}
.wk-coach-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  border: 1.5px solid #e5e7eb; background: #fff;
  color: #475569; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.wk-coach-chip:hover {
  border-color: #c4b5fd; background: #faf5ff; color: #7c3aed;
}
.wk-coach-chip.is-selected {
  border-color: #7c3aed; background: #7c3aed; color: #fff;
}
.wk-coach-chip--goal { --chip-dot: #f59e0b; }
.wk-coach-chip--project { --chip-dot: #6366f1; }
.wk-coach-chip--new {
  border-style: dashed; color: #7c3aed;
}
.wk-coach-chip--new:hover {
  border-style: solid; background: #f5f3ff;
}
.wk-coach-chip--skip {
  color: #94a3b8; border-color: #e2e8f0;
}
.wk-coach-chip--skip:hover { color: #64748b; border-color: #cbd5e1; }
.wk-coach-chip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--chip-dot, #94a3b8); flex-shrink: 0;
}

/* ── Quick-create inline form ── */
.wk-coach-inline-form {
  padding: 0 20px 8px;
  animation: wkMsgIn .2s ease;
}
.wk-coach-inline-form-inner {
  display: flex; gap: 8px; align-items: center;
}
.wk-coach-inline-input {
  flex: 1; padding: 8px 12px; border-radius: 10px;
  border: 1.5px solid #e5e7eb; background: #f9fafb;
  font-size: 13px; color: #1e293b; outline: none;
  transition: border-color .15s;
}
.wk-coach-inline-input:focus { border-color: #7c3aed; background: #fff; }
.wk-coach-inline-input::placeholder { color: #94a3b8; }
.wk-coach-inline-btn {
  padding: 8px 14px; border-radius: 10px; border: none;
  background: #7c3aed; color: #fff; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.wk-coach-inline-btn:hover { background: #6d28d9; }
.wk-coach-inline-btn--ghost {
  background: transparent; color: #94a3b8; border: 1.5px solid #e2e8f0;
}
.wk-coach-inline-btn--ghost:hover { background: #f1f5f9; color: #64748b; }

/* ── Summary card (shows what AI has built) ── */
.wk-coach-summary {
  margin: 0 20px 8px; padding: 12px 14px;
  border-radius: 12px; border: 1.5px solid #e5e7eb;
  background: #fafbfc;
  animation: wkMsgIn .2s ease;
}
.wk-coach-summary-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #7c3aed; margin-bottom: 8px;
}
.wk-coach-summary-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 12px; color: #475569;
}
.wk-coach-summary-row svg {
  width: 14px; height: 14px; stroke: #7c3aed; fill: none;
  flex-shrink: 0;
}
.wk-coach-summary-label { color: #94a3b8; min-width: 60px; }
.wk-coach-summary-val { font-weight: 600; color: #1e293b; }
.wk-coach-summary-actions {
  display: flex; gap: 8px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}
.wk-coach-summary-btn {
  flex: 1; padding: 8px; border-radius: 10px; border: none;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.wk-coach-summary-btn--create {
  background: #7c3aed; color: #fff;
}
.wk-coach-summary-btn--create:hover { background: #6d28d9; }
.wk-coach-summary-btn--edit {
  background: #f1f5f9; color: #475569;
}
.wk-coach-summary-btn--edit:hover { background: #e2e8f0; }

/* ── Input area ── */
.wk-coach-input-area {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 20px 16px; border-top: 1px solid #e5e7eb;
  background: #fff; flex-shrink: 0;
}
.wk-coach-input {
  flex: 1; padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid #e5e7eb; background: #f9fafb;
  font-size: 13px; color: #1e293b; outline: none;
  resize: none; min-height: 20px; max-height: 100px;
  line-height: 1.5; font-family: inherit;
  transition: border-color .15s;
}
.wk-coach-input:focus { border-color: #7c3aed; background: #fff; }
.wk-coach-input::placeholder { color: #94a3b8; }
.wk-coach-send {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  background: #7c3aed; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.wk-coach-send:hover { background: #6d28d9; }
.wk-coach-send:disabled { background: #e2e8f0; color: #94a3b8; cursor: default; }
.wk-coach-send svg { width: 16px; height: 16px; }

/* ── Milestone list in summary ── */
.wk-coach-ms-list {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 4px;
}
.wk-coach-ms-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #475569;
  padding: 3px 0;
}
.wk-coach-ms-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #7c3aed; flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .wk-coach-shell { max-width: 98vw; max-height: 90vh; border-radius: 16px; }
  .wk-coach-msgs { padding: 14px; }
  .wk-coach-chips { padding: 0 14px 8px; }
  .wk-coach-input-area { padding: 10px 14px 12px; }
}
