/* ============================================================
   OMNIO CONCIERGE CHATBOT — Frontend Styles (v1.3)
   Matched to the original omnio-eta.vercel.app widget:
   - Solid gold launcher disc
   - Dark gradient header with circular avatar + "Available now"
   - Cream body, dark user pills, white bot bubbles
   - Gold circular send button, pill input
   ============================================================ */

:root {
  --omnio-gold:        #C4A96B;
  --omnio-gold-light:  #d4bb85;
  --omnio-gold-dark:   #a88c52;
  --omnio-header-1:    #1e2530;
  --omnio-header-2:    #11151c;
  --omnio-body-bg:     #f5f2ec;
  --omnio-bot-bubble:  #ffffff;
  --omnio-bot-border:  #ece7dd;
  --omnio-bot-text:    #3a3a3a;
  --omnio-user-bubble: #1c2128;
  --omnio-user-text:   #ffffff;
  --omnio-input-bg:    #ffffff;
  --omnio-input-border:#e3ddd2;
  --omnio-input-text:  #2c2c2c;
  --omnio-muted:       #9a9a9a;
  --omnio-green:       #4caf6e;
  --omnio-radius:      18px;
  --omnio-z:           999999;
  --omnio-font:        Georgia, 'Times New Roman', serif;
  --omnio-panel-w:     390px;
  --omnio-panel-h:     560px;
  --omnio-shadow:      0 16px 48px rgba(20,25,35,0.30), 0 4px 16px rgba(20,25,35,0.18);
}

/* ── Widget Container ───────────────────────────── */
.omnio-chat-widget {
  position: fixed;
  z-index: var(--omnio-z);
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 16px;
  pointer-events: none;
}
.omnio-chat-widget * { box-sizing: border-box; }

.omnio-position-bottom-right { bottom: 28px; right: 28px; }
.omnio-position-bottom-left  { bottom: 28px; left: 28px; align-items: flex-start; }
.omnio-position-bottom-center{ bottom: 28px; left: 50%; transform: translateX(-50%); align-items: center; }

/* ── Launcher (solid gold disc) ─────────────────── */
.omnio-launcher {
  pointer-events: all;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--omnio-gold);
  border: none;
  color: #2a2017;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(196,169,107,0.45), 0 2px 8px rgba(0,0,0,0.18);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease, background 0.2s;
  position: relative;
  flex-shrink: 0;
  align-self: flex-end;
}
.omnio-launcher:hover {
  transform: scale(1.07);
  background: var(--omnio-gold-light);
  box-shadow: 0 8px 26px rgba(196,169,107,0.55), 0 3px 12px rgba(0,0,0,0.22);
}
.omnio-launcher:active { transform: scale(0.96); }

.omnio-launcher-icon { display: flex; align-items: center; justify-content: center; }

.omnio-notification-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 12px; height: 12px;
  background: #e0533d;
  border-radius: 50%;
  border: 2px solid var(--omnio-gold);
  animation: omnio-pulse 2s infinite;
}
@keyframes omnio-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(224,83,61,0.5); }
  50%     { box-shadow: 0 0 0 6px rgba(224,83,61,0); }
}

/* ── Chat Panel ─────────────────────────────────── */
.omnio-chat-panel {
  pointer-events: none;
  width: var(--omnio-panel-w);
  height: var(--omnio-panel-h);
  max-height: calc(100vh - 120px);
  background: var(--omnio-body-bg);
  border-radius: var(--omnio-radius);
  box-shadow: var(--omnio-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.34,1.3,.5,1);
}
.omnio-chat-panel.omnio-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Keep the collapsed chat panel out of the layout flow so it doesn't
   push the proactive bubble's header above the top of the viewport.
   The open state (.omnio-open) is unaffected, so the open/close
   transition still works normally. */
.omnio-chat-panel:not(.omnio-open) {
  position: absolute;
  bottom: 0;
}


/* ── Header (dark gradient) ─────────────────────── */
.omnio-chat-header {
  background: linear-gradient(160deg, var(--omnio-header-1) 0%, var(--omnio-header-2) 100%);
  padding: 16px 16px 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.omnio-header-brand { display: flex; align-items: center; gap: 12px; }

.omnio-header-avatar,
.omnio-proactive-avatar {
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--omnio-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.omnio-header-avatar { width: 42px; height: 42px; }
.omnio-proactive-avatar { width: 30px; height: 30px; }

.omnio-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.omnio-avatar-letter {
  font-family: var(--omnio-font);
  color: #fff;
  font-weight: bold;
  letter-spacing: .02em;
}
.omnio-header-avatar .omnio-avatar-letter { font-size: 19px; }
.omnio-proactive-avatar .omnio-avatar-letter { font-size: 14px; }

.omnio-header-text { display: flex; flex-direction: column; gap: 3px; }
.omnio-header-name {
  font-family: var(--omnio-font);
  font-size: 16px;
  color: #fff;
  line-height: 1;
}
.omnio-name-light { font-weight: 400; opacity: 0.92; }
.omnio-name-bold  { font-weight: 700; }

.omnio-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  font-family: var(--omnio-font);
}
.omnio-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--omnio-green);
  animation: omnio-status-pulse 2.5s infinite;
}
@keyframes omnio-status-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(76,175,110,0.5); }
  50%     { box-shadow: 0 0 0 4px rgba(76,175,110,0); }
}

.omnio-header-actions { display: flex; gap: 6px; align-items: center; }
.omnio-header-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.omnio-header-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }
.omnio-clear-btn { width: 26px; height: 26px; opacity: 0.7; }

/* ── Messages Area ──────────────────────────────── */
.omnio-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  background: var(--omnio-body-bg);
}
.omnio-messages::-webkit-scrollbar { width: 5px; }
.omnio-messages::-webkit-scrollbar-track { background: transparent; }
.omnio-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
.omnio-messages::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ── Message Bubbles ────────────────────────────── */
.omnio-msg {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  animation: omnio-msg-in 0.25s ease both;
}
@keyframes omnio-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.omnio-msg-bot  { align-self: flex-start; }
.omnio-msg-user { align-self: flex-end; }

.omnio-msg-bubble {
  padding: 13px 16px;
  font-size: 14px;
  line-height: 1.62;
  font-family: var(--omnio-font);
}
.omnio-msg-bot .omnio-msg-bubble {
  background: var(--omnio-bot-bubble);
  color: var(--omnio-bot-text);
  border: 1px solid var(--omnio-bot-border);
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.omnio-msg-user .omnio-msg-bubble {
  background: var(--omnio-user-bubble);
  color: var(--omnio-user-text);
  border-radius: 16px 16px 4px 16px;
  font-weight: 600;
}
.omnio-msg-bubble strong { font-weight: 700; }
.omnio-msg-bot .omnio-msg-bubble a { color: var(--omnio-gold-dark); text-decoration: underline; }
.omnio-msg-user .omnio-msg-bubble a { color: var(--omnio-gold-light); }

/* Typing indicator */
.omnio-typing .omnio-msg-bubble { padding: 15px 18px; }
.omnio-typing-dots { display: flex; gap: 5px; align-items: center; }
.omnio-typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--omnio-gold);
  opacity: 0.4;
  animation: omnio-dot-bounce 1.2s infinite ease-in-out;
}
.omnio-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.omnio-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes omnio-dot-bounce {
  0%,80%,100% { transform: translateY(0); opacity: 0.4; }
  40%         { transform: translateY(-5px); opacity: 1; }
}

/* ── Quick Prompts ──────────────────────────────── */
.omnio-quick-prompts {
  padding: 4px 18px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  flex-shrink: 0;
  background: var(--omnio-body-bg);
}
.omnio-quick-btn {
  background: #fff;
  border: 1px solid var(--omnio-bot-border);
  color: var(--omnio-gold-dark);
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-family: var(--omnio-font);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.omnio-quick-btn:hover {
  background: #fbf7ef;
  border-color: var(--omnio-gold);
  color: var(--omnio-gold-dark);
}
.omnio-quick-btn:active { transform: scale(0.97); }

/* ── Input Area ─────────────────────────────────── */
.omnio-input-area {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  background: var(--omnio-body-bg);
}
.omnio-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--omnio-input-bg);
  border: 1px solid var(--omnio-input-border);
  border-radius: 28px;
  padding: 6px 6px 6px 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.omnio-input-wrap:focus-within {
  border-color: var(--omnio-gold);
  box-shadow: 0 0 0 3px rgba(196,169,107,0.12);
}
.omnio-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--omnio-input-text);
  font-size: 14px;
  font-family: var(--omnio-font);
  line-height: 1.5;
  resize: none;
  max-height: 96px;
  overflow-y: auto;
  padding: 6px 0;
}
.omnio-input::placeholder { color: var(--omnio-muted); opacity: 1; }

.omnio-send-btn {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--omnio-gold);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  padding: 0;
}
.omnio-send-btn:hover { background: var(--omnio-gold-light); transform: scale(1.06); }
.omnio-send-btn:active { transform: scale(0.94); }
.omnio-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.omnio-footer-note {
  margin-top: 9px;
  text-align: center;
  font-size: 11px;
  color: var(--omnio-muted);
  letter-spacing: 0.04em;
  font-family: var(--omnio-font);
}
.omnio-footer-note a {
  color: var(--omnio-gold-dark);
  text-decoration: none;
  transition: color 0.15s;
}
.omnio-footer-note a:hover { color: var(--omnio-gold); text-decoration: underline; }

/* ── Proactive Bubble ───────────────────────────── */
.omnio-proactive-bubble {
  pointer-events: all;
  width: 320px;
  background: linear-gradient(160deg, var(--omnio-header-1) 0%, var(--omnio-header-2) 100%);
  border-radius: var(--omnio-radius);
  box-shadow: var(--omnio-shadow);
  overflow: hidden;
  animation: omnio-bubble-in 0.4s cubic-bezier(.34,1.4,.5,1) both;
}
@keyframes omnio-bubble-in {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.omnio-proactive-content { padding: 16px 18px 18px; }
.omnio-proactive-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.omnio-proactive-name {
  flex: 1;
  font-family: var(--omnio-font);
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.02em;
}
.omnio-proactive-close {
  background: rgba(255,255,255,0.18);
  border: none;
  color: #ffffff;
  opacity: 1;
  cursor: pointer;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.omnio-proactive-close:hover { background: rgba(255,255,255,0.16); color: #fff; }
.omnio-proactive-close svg {
  width: 12px;
  height: 12px;
  flex: none;
  display: block;
  color: #ffffff;
}
.omnio-proactive-text {
  font-family: var(--omnio-font);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.92);
  margin: 0 0 14px;
}
.omnio-proactive-open {
  background: var(--omnio-gold);
  color: #2a2017;
  border: none;
  padding: 10px 18px;
  border-radius: 24px;
  font-family: var(--omnio-font);
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}
.omnio-proactive-open:hover { background: var(--omnio-gold-light); }

/* ── Error message ──────────────────────────────── */
.omnio-msg-error .omnio-msg-bubble {
  background: #fbeaea;
  border-color: #e3c3c3;
  color: #9c4a4a;
}

/* ── Fallback (OpenAI) reply ─────────────────────────
   Shown in a cursive face so it's visually clear the answer
   came from the backup model while Claude was unavailable. */
.omnio-msg-fallback .omnio-msg-bubble {
  font-family: 'Segoe Script', 'Brush Script MT', 'Snell Roundhand', cursive;
  font-style: italic;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --omnio-panel-w: calc(100vw - 24px);
    --omnio-panel-h: calc(100vh - 110px);
  }
  .omnio-position-bottom-right,
  .omnio-position-bottom-left,
  .omnio-position-bottom-center {
    bottom: 18px;
    right: 12px;
    left: 12px;
    transform: none;
    align-items: flex-end;
  }
  .omnio-proactive-bubble { width: calc(100vw - 48px); }
}
