/* ============================================================
   Chat Designer — Modern aesthetic (overrides acoustopredict.css)
   Inspired by: Linear, Vercel v0, Anthropic Claude
   Loaded AFTER acoustopredict.css so these rules win.
   ============================================================ */

/* Outer panel — soft elevated card */
#chatDesigner.chat-light {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  width: 100%;
  margin: 0 0 16px;
}

/* Header with status dot */
#chatDesigner.chat-light .chat-header {
  background: #ffffff;
  color: #0f172a;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}
#chatDesigner.chat-light .chat-header::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  animation: chatStatusPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes chatStatusPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.05); }
}
#chatDesigner.chat-light .chat-subhead {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 400;
  font-style: normal;
  margin-left: auto;
}

/* Layout */
#chatDesigner.chat-light .chat-split,
#chatDesigner.chat-light .chat-single {
  display: block;
  background: #ffffff;
  min-height: 65vh;
}
#chatDesigner.chat-light .chat-left {
  padding: 18px 20px 16px;
  background: transparent;
  border-right: none;
  display: flex;
  flex-direction: column;
}

/* Conversation feed — soft canvas */
#chatDesigner.chat-light .chat-feed {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  flex: 1;
  min-height: 380px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 14px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
#chatDesigner.chat-light .chat-feed::-webkit-scrollbar { width: 8px; }
#chatDesigner.chat-light .chat-feed::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Messages */
#chatDesigner.chat-light .chat-msg {
  display: flex;
  margin: 10px 0;
}
#chatDesigner.chat-light .chat-you { justify-content: flex-end; }
#chatDesigner.chat-light .chat-bot { justify-content: flex-start; }
#chatDesigner.chat-light .chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  font-size: 0.88rem;
}
#chatDesigner.chat-light .chat-bot .chat-bubble {
  border-top-left-radius: 4px;
}
#chatDesigner.chat-light .chat-you .chat-bubble {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  border: none;
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.20);
}
#chatDesigner.chat-light .chat-who {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 4px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
#chatDesigner.chat-light .chat-bot .chat-who::before {
  content: "";
  width: 14px; height: 14px;
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.30);
}
#chatDesigner.chat-light .chat-you .chat-who { color: rgba(255,255,255,0.82); }
#chatDesigner.chat-light .chat-tip {
  display: inline-block;
  font-size: 0.78rem;
  color: #64748b;
  font-style: normal;
}
#chatDesigner.chat-light .chat-you .chat-tip { color: rgba(255,255,255,0.85); }
#chatDesigner.chat-light .chat-bubble b {
  font-weight: 600;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88em;
}

/* Input row */
#chatDesigner.chat-light .chat-inputrow {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
#chatDesigner.chat-light .chat-input {
  flex: 1;
  padding: 11px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#chatDesigner.chat-light .chat-input::placeholder { color: #94a3b8; }
#chatDesigner.chat-light .chat-input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}
#chatDesigner.chat-light .chat-send-btn,
#chatDesigner.chat-light .chat-mic-btn,
#chatDesigner.chat-light .chat-upload-btn {
  border-radius: 10px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#chatDesigner.chat-light .chat-send-btn {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.25);
}
#chatDesigner.chat-light .chat-send-btn:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.30);
  transform: translateY(-1px);
}
#chatDesigner.chat-light .chat-mic-btn,
#chatDesigner.chat-light .chat-upload-btn {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 0 14px;
}
#chatDesigner.chat-light .chat-mic-btn:hover:not(:disabled),
#chatDesigner.chat-light .chat-upload-btn:hover:not(:disabled) {
  background: #ffffff;
  color: #0d9488;
  border-color: #14b8a6;
  box-shadow: 0 2px 6px rgba(20, 184, 166, 0.10);
}

/* Suggestion chips — pills */
#chatDesigner.chat-light .chat-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
#chatDesigner.chat-light .chat-chip {
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
#chatDesigner.chat-light .chat-chip:hover {
  background: #f0fdfa;
  border-color: #14b8a6;
  color: #0d9488;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(20, 184, 166, 0.08);
}

/* Smart-chat bar */
#chatDesigner.chat-light .smart-chat-bar {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.78rem;
  color: #64748b;
}
#chatDesigner.chat-light .smart-chat-btn {
  background: #ffffff;
  color: #0d9488;
  border: 1px solid #14b8a6;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
#chatDesigner.chat-light .smart-chat-btn:hover:not(:disabled) {
  background: #f0fdfa;
}
#chatDesigner.chat-light .smart-chat-btn.smart-chat-active {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
}
#chatDesigner.chat-light .smart-chat-disable {
  color: #ef4444;
  border-color: #fecaca;
}
#chatDesigner.chat-light .smart-chat-disable:hover { background: #fef2f2; }
#chatDesigner.chat-light .smart-chat-note {
  color: #64748b;
  font-style: normal;
}

/* Action menu */
#chatDesigner.chat-light .chat-actionbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
#chatDesigner.chat-light .chat-actionbar-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  font-weight: 700;
  margin-right: 6px;
}
#chatDesigner.chat-light .chat-action-btn {
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
#chatDesigner.chat-light .chat-action-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}
#chatDesigner.chat-light .chat-action-primary {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #ffffff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.25);
}
#chatDesigner.chat-light .chat-action-primary:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.28);
  transform: translateY(-1px);
}

/* Inline design card */
#chatDesigner.chat-light .chat-design-card {
  max-width: 92%;
  min-width: 380px;
  padding: 14px 16px;
}
#chatDesigner.chat-light .chat-design-card .preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0;
}
#chatDesigner.chat-light .chat-design-card .preview-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
#chatDesigner.chat-light .chat-design-card .preview-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  font-weight: 700;
}
#chatDesigner.chat-light .chat-design-card .preview-value {
  font-size: 1.05rem;
  color: #0f172a;
  font-weight: 600;
  margin-top: 3px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: -0.01em;
}
#chatDesigner.chat-light .chat-design-card .preview-unit {
  font-size: 0.66rem;
  color: #94a3b8;
  margin-left: 3px;
  font-weight: 400;
}
#chatDesigner.chat-light .chat-design-card .preview-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 2px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.84rem;
}
#chatDesigner.chat-light .chat-design-card .preview-row:last-of-type { border-bottom: none; }
#chatDesigner.chat-light .chat-design-card .preview-row .preview-label {
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
  color: #64748b;
  font-weight: 500;
}
#chatDesigner.chat-light .chat-design-card .preview-accent {
  color: #0d9488;
  font-weight: 600;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
#chatDesigner.chat-light .chat-design-card .preview-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
#chatDesigner.chat-light .chat-design-card .preview-btn {
  flex: 1 1 auto;
  min-width: 110px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
#chatDesigner.chat-light .chat-design-card .preview-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}
#chatDesigner.chat-light .chat-design-card .preview-btn-primary {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #ffffff;
  border-color: transparent;
  font-weight: 600;
}
#chatDesigner.chat-light .chat-design-card .preview-btn-primary:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.28);
  transform: translateY(-1px);
}

/* Mic-active state — modern red pulse */
#chatDesigner.chat-light .chat-mic-btn.chat-mic-active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: transparent;
  color: #ffffff;
  animation: chatMicPulseV3 1.4s ease-in-out infinite;
}
@keyframes chatMicPulseV3 {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  50%      { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
