/* ═══════════════════════════════════════
   chatbot-messages.css — RTS Ferries
═══════════════════════════════════════ */

.chat-msgs { padding:16px 14px; gap:10px; background:#fff; }

/* Bubbles */
.msg {
  max-width:86%; font-size:13.5px; line-height:1.5;
  padding:10px 14px; border-radius:14px;
  animation:msgIn .15s ease-out;
  font-family:var(--font-body); overflow-wrap:anywhere;
}
@keyframes msgIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }

.msg-bot {
  background:#fff; color:var(--text);
  border:1px solid var(--grey-light);
  border-bottom-left-radius:4px; align-self:flex-start;
}
.msg-user {
  background:var(--navy); color:#fff;
  border-bottom-right-radius:4px; align-self:flex-end;
}

/* Content formatting */
.msg p                       { margin:2px 0; line-height:1.4; }
.msg h1,.msg h2,.msg h3,.msg h4 { margin:4px 0 2px; font-size:13px; }
.msg ul,.msg ol              { margin:2px 0; padding-left:16px; }
.msg li                      { margin:1px 0; line-height:1.4; }
.msg > *:first-child         { margin-top:0 !important; }
.msg > *:last-child          { margin-bottom:0 !important; }
.msg a                       { color:var(--accent); font-weight:600; text-decoration:underline; word-break:break-all; }
.msg table                   { display:block; width:100%; overflow-x:auto; border-collapse:collapse; margin:4px 0; font-size:12px; }
.msg th,.msg td              { padding:6px 10px; border:1px solid var(--grey-light); text-align:left; white-space:nowrap; }
.msg th                      { background:var(--off-white); font-weight:600; }
#chat-window a               { color:var(--accent); text-decoration:underline; font-weight:600; transition:color .15s; }
#chat-window a:hover         { color:var(--accent-dark); }

/* Typing */
.typing {
  display:flex; gap:5px; align-items:center;
  padding:10px 14px; background:#fff;
  border:1px solid var(--grey-light); border-radius:14px;
  border-bottom-left-radius:4px; align-self:flex-start; width:fit-content;
}
.typing span { width:6px; height:6px; background:var(--grey-mid); border-radius:50%; animation:typeBlink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay:.2s; }
.typing span:nth-child(3) { animation-delay:.4s; }
@keyframes typeBlink { 0%,80%,100%{opacity:.3} 40%{opacity:1} }

/* Spinner */
.chat-spinner { display:flex; align-items:center; gap:5px; padding:10px 14px; }
.cs-dot { width:6px; height:6px; border-radius:50%; background:var(--grey-mid); animation:csDot .9s ease-in-out infinite; }
.cs-dot:nth-child(2) { animation-delay:.15s; }
.cs-dot:nth-child(3) { animation-delay:.30s; }
@keyframes csDot { 0%,80%,100%{transform:scale(.7);opacity:.4} 40%{transform:scale(1);opacity:1} }

/* Quick options */
.qlabel {
  font-size:10px; color:var(--grey-text); margin-bottom:5px; font-weight:700;
  text-transform:uppercase; letter-spacing:.7px;
}
.quick-options { display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; background:transparent; animation:msgIn .2s ease-out; }
@media (max-width:380px) { .quick-options { grid-template-columns:1fr; } }

.opt-btn {
  background:#fff; border:1px solid var(--grey-light);
  color:var(--text); padding:12px 12px; border-radius:12px;
  font-size:13px; font-weight:500; cursor:pointer;
  font-family:var(--font-body);
  transition:border-color .15s, box-shadow .15s, transform .15s;
  display:flex; align-items:center; gap:10px;
  width:100%; text-align:left; position:relative;
}
.opt-btn:hover         { border-color:var(--accent); box-shadow:0 6px 16px rgba(11,37,69,.1); transform:translateY(-1px); }
.opt-btn:hover::after  { color:var(--accent); }
.opt-btn.selected      { border-color:var(--accent); background:var(--off-white); }
.opt-btn::after {
  content:'›'; position:absolute; right:12px;
  color:var(--grey-mid); font-size:16px; line-height:1; transition:color .15s;
}
.opt-btn span:not(.opt-icon) { position:relative; }

.opt-icon {
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  width:28px; height:28px; border-radius:9px;
  background:rgba(11,37,69,.07); color:var(--navy);
}
/* Distinct tint per position — same idea as the IndiGo reference's varied
   icon colors, done via nth-child so it works with any language's option
   labels/icons without editing the multi-language content data. */
.quick-options .opt-btn:nth-child(1) .opt-icon { background:rgba(59,125,216,.12); color:var(--accent-dark); }
.quick-options .opt-btn:nth-child(2) .opt-icon { background:rgba(11,37,69,.08);   color:var(--navy); }
.quick-options .opt-btn:nth-child(3) .opt-icon { background:rgba(124,58,237,.1); color:#6d28d9; }
.quick-options .opt-btn:nth-child(4) .opt-icon { background:rgba(13,148,136,.1); color:#0d9488; }

.chat-back {
  background:var(--off-white); border:1px solid var(--grey-light);
  color:var(--navy); font-size:12px; padding:7px 15px;
  border-radius:10px; cursor:pointer; font-family:var(--font-body);
  align-self:flex-start; transition:background .15s; font-weight:600;
}
.chat-back:hover { background:var(--grey-light); }

/* Feedback */
.msg-feedback { display:flex; gap:6px; margin-top:5px; align-self:flex-start; }
.fb-btn {
  background:#fff; border:1px solid var(--grey-light);
  border-radius:18px; padding:4px 10px;
  font-size:13px; cursor:pointer; color:var(--grey-text); transition:all .15s;
}
.fb-btn:hover          { border-color:var(--navy); color:var(--navy); }
.fb-btn.fb-active-up   { background:#F0FDF4; border-color:#86EFAC; color:#16A34A; }
.fb-btn.fb-active-down { background:#FEF2F2; border-color:#FCA5A5; color:#DC2626; }

/* Agent buttons */
.talk-agent-btn {
  display:flex; align-items:center; gap:8px; width:100%; margin-top:10px;
  padding:11px 16px; background:#fff;
  border:1px solid var(--navy); border-radius:10px;
  color:var(--navy); font-family:inherit; font-size:13px; font-weight:600;
  cursor:pointer; transition:background .15s, color .15s;
}
.talk-agent-btn:hover { background:var(--navy); color:#fff; }

.talk-agent-inline-btn {
  display:inline-flex; align-items:center; gap:6px; margin-left:6px;
  padding:6px 13px; background:#fff;
  border:1px solid var(--navy); border-radius:18px;
  color:var(--navy); font-family:inherit; font-size:12px; font-weight:600;
  cursor:pointer; transition:background .15s, color .15s; vertical-align:middle;
}
.talk-agent-inline-btn:hover:not(:disabled) { background:var(--navy); color:#fff; }
.talk-agent-inline-btn:disabled              { cursor:not-allowed; opacity:.6; }

.see-all-btn {
  display:block; width:100%; margin-top:10px;
  background:#fff; border:1px solid var(--grey-light);
  border-radius:12px; padding:10px 16px;
  color:var(--navy); font-size:12.5px; font-weight:600;
  font-family:var(--font-body); cursor:pointer; text-align:center;
  transition:border-color .15s, background .15s;
}
.see-all-btn:hover { border-color:var(--navy); background:var(--off-white); }