/* ── OhvrFlow Chat Widget ─────────────────────────────────────────────── */

.ofchat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #ea580c;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.ofchat-toggle:hover {
  background: #c2410c;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.ofchat-toggle svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* Move back-to-top to the left of the chat toggle */
#back-to-top {
  right: 92px !important;
}

/* Panel */
.ofchat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 50;
  width: 380px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.ofchat-panel.ofchat-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.ofchat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #ea580c;
  color: #fff;
}

.ofchat-header-title {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.ofchat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s;
}

.ofchat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ofchat-close svg {
  width: 18px;
  height: 18px;
}

/* Messages area */
.ofchat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 340px;
}

/* Message bubbles */
.ofchat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.ofchat-msg a {
  color: #ea580c;
  text-decoration: underline;
}

.ofchat-msg--user {
  align-self: flex-end;
  background: #ea580c;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ofchat-msg--user a {
  color: #fff;
}

.ofchat-msg--bot {
  align-self: flex-start;
  background: #f3f4f6;
  color: #1f2937;
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.ofchat-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #f3f4f6;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.ofchat-typing-dot {
  width: 7px;
  height: 7px;
  background: #9ca3af;
  border-radius: 50%;
  animation: ofchat-bounce 1.2s infinite;
}

.ofchat-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.ofchat-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ofchat-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* Input bar */
.ofchat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.ofchat-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}

.ofchat-input:focus {
  border-color: #ea580c;
}

.ofchat-input::placeholder {
  color: #9ca3af;
}

.ofchat-send {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #ea580c;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.ofchat-send:hover {
  background: #c2410c;
}

.ofchat-send:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.ofchat-send svg {
  width: 18px;
  height: 18px;
}

/* Powered-by */
.ofchat-powered {
  text-align: center;
  padding: 6px;
  font-size: 0.7rem;
  color: #9ca3af;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.ofchat-powered a {
  color: #6b7280;
  text-decoration: none;
}

.ofchat-powered a:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 480px) {
  .ofchat-panel {
    right: 10px;
    left: 10px;
    bottom: 88px;
    width: auto;
    max-height: 70vh;
  }

  .ofchat-messages {
    max-height: 50vh;
  }

  #back-to-top {
    right: 24px !important;
    bottom: 92px !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ofchat-panel,
  .ofchat-toggle {
    transition: none;
  }

  .ofchat-typing-dot {
    animation: none;
  }
}
