/* ─────────────────────────────────────────────────────────────────────────
   chat-widget.css — OXYGN Catering  v2.0
   Floating user→admin support chat.
   Luxury dark-emerald + gold theme. WhatsApp-inspired layout.
   Mobile-first, no heavy animations.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Floating button ─────────────────────────────────────────────────────── */
#oxChatBtn {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 9998;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(229, 160, 0, .55);
  background: linear-gradient(145deg, #1a3a2a 0%, #0e231a 100%);
  color: var(--gold, #e5a000);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 0 1px rgba(229,160,0,.12);
  transition: transform .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
#oxChatBtn:hover,
#oxChatBtn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(229,160,0,.3);
}
#oxChatBtn svg { width: 26px; height: 26px; pointer-events: none; }

/* badge */
#oxChatBtn .ox-badge {
  position: absolute; top: -5px; right: -5px;
  background: #d62b2b; color: #fff;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px;
  font: 600 11px/20px 'Inter', system-ui, sans-serif;
  text-align: center;
  display: none;
  align-items: center; justify-content: center;
  border: 2px solid #060f0b;
  pointer-events: none;
}

/* ── Panel ───────────────────────────────────────────────────────────────── */
#oxChatPanel {
  position: fixed;
  bottom: 158px; right: 20px;
  z-index: 9999;
  width: 356px;
  max-width: calc(100vw - 28px);
  height: 524px;
  max-height: calc(100svh - 200px);
  background: #060f0b;
  border: 1px solid rgba(229, 160, 0, .22);
  border-radius: 18px;
  box-shadow: 0 28px 72px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.04);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  /* prevent body scroll bleed on mobile */
  overscroll-behavior: contain;
}
#oxChatPanel.ox-panel--open {
  display: flex;
  animation: oxSlideUp .22s cubic-bezier(.4,0,.2,1) both;
}
@keyframes oxSlideUp {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.ox-head {
  padding: 13px 14px;
  background: linear-gradient(135deg, #14241c 0%, #0a1812 100%);
  border-bottom: 1px solid rgba(229, 160, 0, .18);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.ox-head-av {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #e5a000, #b87e00);
  color: #0a1812;
  display: flex; align-items: center; justify-content: center;
  font: 700 13px/1 'Cinzel', serif;
  flex-shrink: 0;
}
.ox-head-info { flex: 1; min-width: 0; }
.ox-head-title {
  color: var(--gold, #e5a000);
  font: 600 13px/1 'Cinzel', serif;
  letter-spacing: .09em;
}
.ox-head-status {
  display: flex; align-items: center; gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  color: rgba(255,255,255,.5);
}
.ox-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,.2);
}
.ox-dot--online  { background: #22c55e; box-shadow: 0 0 5px rgba(34,197,94,.6); }
.ox-dot--offline { background: rgba(255,255,255,.25); }

.ox-close {
  background: transparent; border: 0;
  color: rgba(255,255,255,.5);
  width: 32px; height: 32px; border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ox-close:hover { color: #fff; background: rgba(255,255,255,.07); }
.ox-close svg   { width: 18px; height: 18px; pointer-events: none; }

/* ── Body (message list) ─────────────────────────────────────────────────── */
.ox-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(229,160,0,.03), transparent 70%),
    #060f0b;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ox-body::-webkit-scrollbar { width: 4px; }
.ox-body::-webkit-scrollbar-thumb { background: rgba(229,160,0,.2); border-radius: 4px; }

/* ── Messages ───────────────────────────────────────────────────────────── */
.ox-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  margin-bottom: 3px;
}
.ox-msg--me   { align-self: flex-end;  align-items: flex-end; }
.ox-msg--them { align-self: flex-start; align-items: flex-start; }

.ox-bubble {
  padding: 8px 11px 6px;
  border-radius: 14px;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  transition: opacity .2s;
}
.ox-msg--me .ox-bubble {
  background: linear-gradient(135deg, #e5a000, #c58a00);
  color: #0a1812;
  border-bottom-right-radius: 4px;
}
.ox-msg--them .ox-bubble {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
  border-bottom-left-radius: 4px;
}
.ox-bubble--pending { opacity: .65; }
.ox-bubble--failed  { opacity: .5;  border: 1px solid rgba(214,43,43,.4); }

.ox-bubble-text {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ox-bubble-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  justify-content: flex-end;
}
.ox-time {
  font-size: 10px;
  line-height: 1;
  opacity: .65;
}
.ox-msg--me .ox-time   { color: rgba(10,24,18,.75); }
.ox-msg--them .ox-time { color: rgba(255,255,255,.45); }

/* ticks */
.ox-tick { display: flex; align-items: center; flex-shrink: 0; }
.ox-tick svg { width: 14px; height: 14px; }
.ox-tick--sent  { color: rgba(10,24,18,.5); }
.ox-tick--seen  { color: #0a6cf5; }

/* date separator */
.ox-date-sep {
  align-self: center;
  font-size: 11px;
  color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.05);
  border-radius: 10px;
  padding: 3px 10px;
  margin: 8px 0 4px;
  pointer-events: none;
  user-select: none;
}

/* empty / loading states */
.ox-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(255,255,255,.45);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  padding: 28px 20px;
  gap: 10px;
  line-height: 1.6;
}
.ox-empty small { font-size: 12px; opacity: .7; }
.ox-empty-icon  { font-size: 34px; }
.ox-empty--err  { color: rgba(214,43,43,.75); }
.ox-login-link {
  display: inline-block;
  margin-top: 6px;
  background: var(--gold, #e5a000);
  color: #0a1812;
  padding: 8px 20px;
  border-radius: 8px;
  text-decoration: none;
  font: 600 11px/1 'Cinzel', serif;
  letter-spacing: .1em;
}
.ox-spinner {
  width: 26px; height: 26px;
  border: 2px solid rgba(229,160,0,.2);
  border-top-color: var(--gold, #e5a000);
  border-radius: 50%;
  animation: oxSpin .7s linear infinite;
}
@keyframes oxSpin { to { transform: rotate(360deg); } }

/* ── Typing indicator ────────────────────────────────────────────────────── */
.ox-typing-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 4px;
  flex-shrink: 0;
}
.ox-typing-label {
  font-size: 11px;
  color: rgba(255,255,255,.4);
}
.ox-typing-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}
.ox-typing-dots span {
  width: 5px; height: 5px;
  background: var(--gold, #e5a000);
  border-radius: 50%;
  opacity: .5;
  animation: oxBounce 1.2s ease-in-out infinite;
}
.ox-typing-dots span:nth-child(2) { animation-delay: .2s; }
.ox-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes oxBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40%           { transform: translateY(-4px); opacity: 1; }
}

/* ── Footer / input bar ──────────────────────────────────────────────────── */
.ox-foot {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border-top: 1px solid rgba(229, 160, 0, .14);
  background: #0a1812;
  flex-shrink: 0;
}
.ox-foot textarea {
  flex: 1;
  resize: none;
  min-height: 38px;
  max-height: 100px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  font: 14px/1.45 'Inter', system-ui, sans-serif;
  outline: none;
  transition: border-color .15s;
  -webkit-overflow-scrolling: touch;
}
.ox-foot textarea:focus  { border-color: rgba(229,160,0,.5); }
.ox-foot textarea::placeholder { color: rgba(255,255,255,.3); }

.ox-send {
  width: 40px; height: 40px; flex-shrink: 0;
  background: linear-gradient(135deg, #e5a000, #b87e00);
  color: #0a1812;
  border: 0; border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.ox-send:hover  { opacity: .9; }
.ox-send:active { transform: scale(.94); }
.ox-send:disabled { opacity: .4; cursor: not-allowed; }
.ox-send svg { width: 18px; height: 18px; pointer-events: none; }

/* ── Mobile overrides ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #oxChatBtn  { bottom: 78px; right: 14px; }
  #oxChatPanel {
    bottom: 0; right: 0; left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    height: 90svh;
    max-height: 90svh;
  }
  #oxChatPanel.ox-panel--open {
    animation: oxSlideUpMobile .22s cubic-bezier(.4,0,.2,1) both;
  }
  @keyframes oxSlideUpMobile {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }
}
