/**
 * Oxycell Website Funnel — confirmation-page chat widget styles.
 *
 * Self-contained — works on any WP theme. Uses generic class names with
 * an `oxf-` prefix to avoid collisions. Brand colors match
 * oxycell.com's existing palette (navy + cream + bronze).
 */

#oxycell-funnel-harness {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
}

#oxycell-funnel-harness *,
#oxycell-funnel-harness *::before,
#oxycell-funnel-harness *::after {
  box-sizing: border-box;
}

.oxf-card {
  max-width: 720px;
  margin: 24px auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

/* Header */

.oxf-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 16px;
  background: #ffffff;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
}

.oxf-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 1 / 1;
}

.oxf-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 25%; /* keep face in frame; headshots tend to crop bottom-heavy */
  display: block;
  background: transparent;
}

.oxf-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #265D88, #1B3D58);
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.oxf-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.oxf-agent-name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: #0f172a;
}

.oxf-agent-role {
  font-size: 13px;
  color: #64748b;
}

.oxf-agent-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  color: #64748b;
  width: max-content;
}

.oxf-agent-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}

/* Conversation */

.oxf-conversation {
  flex: 1 1 auto;
  padding: 22px 24px;
  overflow-y: auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
  max-height: 500px;
}

.oxf-msg {
  display: flex;
  max-width: 85%;
}

.oxf-msg-user {
  align-self: flex-end;
  justify-content: flex-end;
}

.oxf-msg-alan {
  align-self: flex-start;
  justify-content: flex-start;
}

.oxf-msg-system {
  align-self: center;
  max-width: 100%;
  font-style: italic;
  color: #6b7280;
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
}

.oxf-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 14.5px;
}

.oxf-msg-alan .oxf-bubble {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}

.oxf-msg-user .oxf-bubble {
  background: #265D88; /* portal --color-ink-400 */
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */

.oxf-typing .oxf-bubble {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
}

.oxf-dot {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  animation: oxf-typing-bounce 1.2s infinite ease-in-out;
}

.oxf-dot:nth-child(2) { animation-delay: 0.15s; }
.oxf-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes oxf-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input row — Tom-sealed 2026-05-19 restyle to match Claude Code desktop
   pattern: textarea + bottom-toolbar (plus-left, send-right) live inside a
   single rounded container; container owns the border + focus ring; toolbar
   sits flush at the bottom inside the same rectangle. */

.oxf-input-row {
  padding: 14px 18px 6px;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

.oxf-input-container {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 14px 10px;
  background: #ffffff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.oxf-input-container:focus-within {
  border-color: #265D88;
  box-shadow: 0 0 0 3px rgba(38, 93, 136, 0.12);
}

.oxf-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  padding: 4px 2px 0;
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: #0f172a;
  min-height: 80px;
  max-height: 200px;
  font-family: inherit;
}

.oxf-input::placeholder {
  color: #94a3b8;
}

.oxf-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
  padding: 0 2px;
}

.oxf-send {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #475569;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: background 120ms ease, transform 80ms ease;
}

.oxf-send svg {
  width: 14px;
  height: 14px;
}

.oxf-send:hover {
  background: #334155;
}

.oxf-send:active {
  transform: scale(0.94);
}

.oxf-send:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.oxf-input-hint {
  padding: 8px 24px 14px;
  font-size: 11.5px;
  color: #94a3b8;
  background: #ffffff;
  letter-spacing: 0.01em;
}

/* Terminal CTA */

.oxf-terminal-cta {
  padding: 16px 20px;
  background: #fef3c7; /* warm bronze */
  border-top: 2px solid #d97706;
  text-align: center;
}

.oxf-terminal-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
  font-weight: 600;
  margin-bottom: 4px;
}

.oxf-terminal-text {
  font-size: 14px;
  color: #1f2937;
}

/* Responsive */

@media (max-width: 520px) {
  .oxf-card {
    margin: 12px;
    border-radius: 10px;
    min-height: 400px;
  }
  .oxf-conversation {
    padding: 14px;
    min-height: 220px;
    max-height: 380px;
  }
  .oxf-msg {
    max-width: 95%;
  }
}
