/* Website chatbot widget styles. Self-contained; all classes are namespaced
   epv-chatbot-* and the widget avoids global/body/html resets so it will not break
   the host website. This is the only chatbot stylesheet.

   Theme: "polished obsidian & snow" — a monochrome, metallic-gloss palette to match
   theyetilife.com's black-and-white brand. Dark surfaces carry a specular sheen
   (diagonal gradient + inset top highlight) so they read like polished resin. */

.epv-chatbot-root {
  --epv-obsidian: #0b0b0d;
  --epv-snow: #ffffff;
  --epv-frost: #f4f6f8;
  --epv-ink: #141519;
  --epv-muted: #6b7079;
  --epv-hairline: #e6e8ee;
  --epv-silver: #d8dce2;
  /* Glossy dark surface: diagonal specular gradient used on header/launcher/send/user bubble. */
  --epv-gloss: linear-gradient(157deg, #2b2e37 0%, #101116 46%, #0b0b0d 100%);
  --epv-gloss-hover: linear-gradient(157deg, #3a3d48 0%, #17181f 46%, #101116 100%);
  /* Inset top-edge highlight that sells the "shine" on dark surfaces. */
  --epv-specular: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --epv-shadow: 0 18px 50px rgba(10, 10, 15, 0.30);
  position: fixed;
  z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--epv-ink);
}

.epv-chatbot-root.epv-pos-bottom-right { right: 20px; bottom: 20px; }
.epv-chatbot-root.epv-pos-bottom-left { left: 20px; bottom: 20px; }

/* Launcher bubble — glossy obsidian disc with a specular highlight. */
.epv-chatbot-launcher {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--epv-gloss);
  color: #fff;
  box-shadow: var(--epv-shadow), var(--epv-specular);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.epv-chatbot-launcher:hover { background: var(--epv-gloss-hover); transform: translateY(-2px); box-shadow: 0 22px 56px rgba(10, 10, 15, 0.38), var(--epv-specular); }
.epv-chatbot-launcher:focus-visible { outline: 3px solid rgba(216, 220, 226, 0.55); outline-offset: 2px; }
.epv-chatbot-launcher svg { width: 27px; height: 27px; }

/* Panel */
.epv-chatbot-panel {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--epv-snow);
  border-radius: 16px;
  box-shadow: var(--epv-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.epv-pos-bottom-left .epv-chatbot-panel { right: auto; left: 0; }
.epv-chatbot-root.epv-open .epv-chatbot-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.epv-chatbot-root.epv-open .epv-chatbot-launcher { transform: scale(0.92); }

/* Header — glossy obsidian with a specular top line and a hairline base. */
.epv-chatbot-header {
  background: var(--epv-gloss);
  color: #fff;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  box-shadow: var(--epv-specular);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.epv-chatbot-header-text { flex: 1 1 auto; min-width: 0; }
.epv-chatbot-title { font-weight: 700; font-size: 12.5px; letter-spacing: 0.15em; text-transform: uppercase; }
.epv-chatbot-subtitle { font-size: 11.5px; opacity: 0.68; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epv-chatbot-header-actions { display: flex; gap: 4px; }
.epv-chatbot-icon-btn {
  background: transparent; border: none; color: #fff; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.epv-chatbot-icon-btn:hover { background: rgba(255, 255, 255, 0.14); }
.epv-chatbot-icon-btn svg { width: 18px; height: 18px; }

/* Messages */
.epv-chatbot-messages {
  flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  background: var(--epv-frost);
}
.epv-chatbot-msg { width: fit-content; max-width: 86%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }

/* Links rendered inside bot answers (clickable URLs, media, emails). */
.epv-chatbot-link { color: var(--epv-ink); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; max-width: 100%; }
.epv-chatbot-link:hover { opacity: 0.7; }
.epv-chatbot-msg-user .epv-chatbot-link { color: #e7e9ee; }
/* Bot bubble — snow-white with a hairline + faint lift so it reads on the frost ground. */
.epv-chatbot-msg-bot {
  align-self: flex-start; margin-right: auto;
  background: var(--epv-snow); color: var(--epv-ink);
  border: 1px solid var(--epv-hairline);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(10, 10, 15, 0.05);
}
/* User bubble — glossy obsidian, matching the header sheen. */
.epv-chatbot-msg-user {
  align-self: flex-end; margin-left: auto;
  background: var(--epv-gloss); color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: var(--epv-specular), 0 2px 8px rgba(10, 10, 15, 0.20);
}
.epv-chatbot-msg-error { background: #f6eef0; color: #8a2230; border: 1px solid #ecd9dd; }

/* Typing indicator */
.epv-chatbot-typing { display: flex; gap: 4px; align-items: center; }
.epv-chatbot-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--epv-muted); opacity: 0.5;
  animation: epv-bounce 1.2s infinite ease-in-out;
}
.epv-chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.epv-chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes epv-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }

/* Composer */
.epv-chatbot-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--epv-hairline); background: var(--epv-snow); }
.epv-chatbot-input {
  flex: 1 1 auto; resize: none; border: 1px solid var(--epv-hairline); border-radius: 12px; padding: 9px 12px;
  font-family: inherit; font-size: 14px; line-height: 1.4; max-height: 120px; min-height: 40px; color: var(--epv-ink); background: var(--epv-snow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.epv-chatbot-input:focus { outline: none; border-color: var(--epv-obsidian); box-shadow: 0 0 0 3px rgba(11, 11, 13, 0.08); }
.epv-chatbot-input:disabled { background: #f1f2f5; color: var(--epv-muted); cursor: not-allowed; }
/* Send — glossy obsidian, brightens on hover. */
.epv-chatbot-send {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--epv-gloss); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--epv-specular); transition: background 0.15s ease;
}
.epv-chatbot-send:hover { background: var(--epv-gloss-hover); }
.epv-chatbot-send:disabled { opacity: 0.45; cursor: not-allowed; }
.epv-chatbot-send svg { width: 18px; height: 18px; }

.epv-chatbot-footer { text-align: center; font-size: 10.5px; color: var(--epv-muted); padding: 0 0 8px; background: var(--epv-snow); }
.epv-chatbot-footer-warning { color: #8a2230; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .epv-chatbot-root *, .epv-chatbot-typing span { transition: none !important; animation: none !important; }
}

@media (max-width: 480px) {
  .epv-chatbot-root.epv-pos-bottom-right, .epv-chatbot-root.epv-pos-bottom-left { right: 12px; left: 12px; bottom: 12px; }
  .epv-chatbot-panel {
    width: auto; left: 0; right: 0; height: 70vh; max-height: calc(100vh - 90px); bottom: 74px;
  }
}
