/* ============================================================
   YAT Executive Hotel Limited — Virtual Guest Assistant
   Widget styles. Inherits the site design system tokens
   (--forest, --gold, --cream, --serif, --sans) from styles.css.
   ============================================================ */

/* ---------- Launcher button ---------- */
.yat-assist-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px 13px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--forest, #1b3a30);
  color: var(--cream, #f8f4ec);
  font-family: var(--sans, sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(16, 26, 22, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.yat-assist-launcher:hover {
  transform: translateY(-2px);
  background: var(--forest-soft, #2c5344);
  box-shadow: 0 18px 40px rgba(16, 26, 22, 0.34);
}
.yat-assist-launcher:focus-visible {
  outline: 3px solid var(--gold, #c1913c);
  outline-offset: 3px;
}
.yat-assist-launcher .yat-assist-launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold, #c1913c);
  color: var(--forest-deep, #12281f);
  flex: 0 0 auto;
}
.yat-assist-launcher .yat-assist-launcher-icon svg { width: 15px; height: 15px; display: block; }
.yat-assist-launcher .yat-assist-launcher-label { white-space: nowrap; }

/* Unread dot */
.yat-assist-launcher .yat-assist-dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold-light, #e0b96a);
  border: 2px solid var(--forest, #1b3a30);
  display: none;
}
.yat-assist-launcher.has-unread .yat-assist-dot { display: block; }

/* ---------- Panel ---------- */
.yat-assist-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9001;
  width: 384px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  background: var(--cream, #f8f4ec);
  border: 1px solid var(--line, rgba(27, 58, 48, 0.14));
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(16, 26, 22, 0.34);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.985);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.yat-assist-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ---------- Header ---------- */
.yat-assist-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--forest, #1b3a30);
  color: var(--cream, #f8f4ec);
}
.yat-assist-head-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold, #c1913c);
  color: var(--forest-deep, #12281f);
  font-family: var(--serif, serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.yat-assist-head-text { flex: 1 1 auto; min-width: 0; }
.yat-assist-head-title {
  display: block;
  font-family: var(--serif, serif);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--cream, #f8f4ec);
}
.yat-assist-head-sub {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light, #e0b96a);
  margin-top: 2px;
}
.yat-assist-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(248, 244, 236, 0.12);
  color: var(--cream, #f8f4ec);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease;
}
.yat-assist-close:hover { background: rgba(248, 244, 236, 0.24); }
.yat-assist-close:focus-visible { outline: 2px solid var(--gold, #c1913c); outline-offset: 2px; }

/* ---------- Log ---------- */
.yat-assist-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 16px 8px;
  scroll-behavior: smooth;
}
.yat-assist-log::-webkit-scrollbar { width: 8px; }
.yat-assist-log::-webkit-scrollbar-thumb {
  background: rgba(27, 58, 48, 0.2);
  border-radius: 8px;
}

.yat-assist-msg {
  display: flex;
  margin-bottom: 12px;
  animation: yatAssistIn 0.22s ease both;
}
@keyframes yatAssistIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .yat-assist-msg { animation: none; }
  .yat-assist-panel { transition: none; }
}

.yat-assist-msg .yat-assist-bubble {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.6;
}
.yat-assist-msg.bot { justify-content: flex-start; }
.yat-assist-msg.bot .yat-assist-bubble {
  background: var(--white, #fff);
  color: var(--ink, #101a16);
  border: 1px solid var(--line, rgba(27, 58, 48, 0.14));
  border-bottom-left-radius: 3px;
}
.yat-assist-msg.guest { justify-content: flex-end; }
.yat-assist-msg.guest .yat-assist-bubble {
  background: var(--forest, #1b3a30);
  color: var(--cream, #f8f4ec);
  border-bottom-right-radius: 3px;
}
.yat-assist-bubble p { margin: 0 0 0.6em; }
.yat-assist-bubble p:last-child { margin-bottom: 0; }
.yat-assist-bubble strong { font-weight: 700; }
.yat-assist-bubble a { color: var(--forest, #1b3a30); text-decoration: underline; }
.yat-assist-msg.guest .yat-assist-bubble a { color: var(--gold-light, #e0b96a); }

/* Confirm tag inside a bubble */
.yat-assist-bubble .yat-assist-confirm {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  background: rgba(193, 145, 60, 0.16);
  border: 1px dashed rgba(193, 145, 60, 0.6);
  color: #8a6420;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Typing indicator */
.yat-assist-typing .yat-assist-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 14px 16px;
}
.yat-assist-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted, #6d7c74);
  animation: yatAssistBlink 1.2s infinite ease-in-out;
}
.yat-assist-typing span:nth-child(2) { animation-delay: 0.18s; }
.yat-assist-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes yatAssistBlink {
  0%, 60%, 100% { opacity: 0.28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .yat-assist-typing span { animation: none; opacity: 0.6; }
}

/* ---------- Quick replies ---------- */
.yat-assist-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 16px 12px;
}
.yat-assist-chip {
  border: 1px solid rgba(27, 58, 48, 0.28);
  background: transparent;
  color: var(--forest, #1b3a30);
  font-family: var(--sans, sans-serif);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.yat-assist-chip:hover {
  background: var(--forest, #1b3a30);
  border-color: var(--forest, #1b3a30);
  color: var(--cream, #f8f4ec);
}
.yat-assist-chip:focus-visible { outline: 2px solid var(--gold, #c1913c); outline-offset: 2px; }

/* ---------- Handover actions ---------- */
.yat-assist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}
.yat-assist-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 6px;
  font-family: var(--sans, sans-serif);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.yat-assist-action.primary {
  background: var(--gold, #c1913c);
  color: var(--forest-deep, #12281f);
}
.yat-assist-action.primary:hover { background: var(--gold-light, #e0b96a); }
.yat-assist-action.ghost {
  background: transparent;
  border-color: rgba(27, 58, 48, 0.3);
  color: var(--forest, #1b3a30);
}
.yat-assist-action.ghost:hover { background: rgba(27, 58, 48, 0.07); }
.yat-assist-action[aria-disabled="true"] {
  opacity: 0.72;
  cursor: not-allowed;
}
.yat-assist-action svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* ---------- Enquiry form ---------- */
.yat-assist-form {
  margin: 0 16px 12px;
  padding: 14px;
  background: var(--white, #fff);
  border: 1px solid var(--line, rgba(27, 58, 48, 0.14));
  border-radius: 8px;
}
.yat-assist-form h4 {
  margin: 0 0 4px;
  font-family: var(--sans, sans-serif);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--forest-deep, #12281f);
}
.yat-assist-form .yat-assist-form-note {
  margin: 0 0 12px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted, #6d7c74);
}
.yat-assist-field { margin-bottom: 9px; }
.yat-assist-field label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #6d7c74);
  margin-bottom: 4px;
}
.yat-assist-field input,
.yat-assist-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(27, 58, 48, 0.24);
  border-radius: 5px;
  background: var(--cream, #f8f4ec);
  color: var(--ink, #101a16);
  font-family: var(--sans, sans-serif);
  font-size: 0.88rem;
  line-height: 1.4;
}
.yat-assist-field input:focus,
.yat-assist-field textarea:focus {
  outline: 2px solid var(--gold, #c1913c);
  outline-offset: 1px;
  border-color: var(--gold, #c1913c);
}
.yat-assist-field textarea { resize: vertical; min-height: 54px; }
.yat-assist-row { display: flex; gap: 9px; }
.yat-assist-row .yat-assist-field { flex: 1 1 0; min-width: 0; }
.yat-assist-submit {
  width: 100%;
  margin-top: 4px;
  padding: 11px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--forest, #1b3a30);
  color: var(--cream, #f8f4ec);
  font-family: var(--sans, sans-serif);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease;
}
.yat-assist-submit:hover { background: var(--forest-soft, #2c5344); }
.yat-assist-submit:focus-visible { outline: 3px solid var(--gold, #c1913c); outline-offset: 2px; }
.yat-assist-form-error {
  margin: 8px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #9a2f22;
  display: none;
}
.yat-assist-form-error.is-shown { display: block; }

/* ---------- Composer ---------- */
.yat-assist-compose {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--line, rgba(27, 58, 48, 0.14));
  background: var(--white, #fff);
}
.yat-assist-compose textarea {
  flex: 1 1 auto;
  min-height: 42px;
  max-height: 110px;
  padding: 10px 12px;
  border: 1px solid rgba(27, 58, 48, 0.24);
  border-radius: 6px;
  background: var(--cream, #f8f4ec);
  color: var(--ink, #101a16);
  font-family: var(--sans, sans-serif);
  font-size: 0.9rem;
  line-height: 1.45;
  resize: none;
}
.yat-assist-compose textarea:focus {
  outline: 2px solid var(--gold, #c1913c);
  outline-offset: 1px;
  border-color: var(--gold, #c1913c);
}
.yat-assist-send {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--forest, #1b3a30);
  color: var(--cream, #f8f4ec);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease;
}
.yat-assist-send:hover { background: var(--forest-soft, #2c5344); }
.yat-assist-send:focus-visible { outline: 3px solid var(--gold, #c1913c); outline-offset: 2px; }
.yat-assist-send svg { width: 17px; height: 17px; }

/* ---------- Footer strip ---------- */
.yat-assist-foot {
  flex: 0 0 auto;
  padding: 8px 14px 10px;
  background: var(--white, #fff);
  border-top: 1px solid var(--line, rgba(27, 58, 48, 0.1));
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--muted, #6d7c74);
  text-align: center;
}

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .yat-assist-launcher {
    right: 14px;
    bottom: 14px;
    padding: 12px 16px 12px 13px;
    font-size: 0.84rem;
  }
  .yat-assist-launcher .yat-assist-launcher-label { display: none; }
  .yat-assist-launcher { padding: 13px; }
  .yat-assist-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: 0;
  }
  .yat-assist-msg .yat-assist-bubble { max-width: 92%; }
}

/* Print: never show the widget */
@media print {
  .yat-assist-launcher,
  .yat-assist-panel { display: none !important; }
}
