/* Cruguide Chat Widget */
:root {
  --cg-primary:   #0066cc;
  --cg-bg:        #ffffff;
  --cg-msg-user:  #0066cc;
  --cg-msg-bot:   #f0f4f8;
  --cg-radius:    12px;
  --cg-shadow:    0 4px 24px rgba(0,0,0,.15);
}

/* ── Widget (embedded bubble) ─────────────────────────────────────── */
.cg-bubble {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 52px; height: 52px;
  background: var(--cg-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--cg-shadow);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: transform .2s;
}
.cg-bubble:hover { transform: scale(1.08); }
.cg-bubble svg   { width: 26px; fill: #fff; }

.cg-window {
  position: fixed;
  bottom: 88px; right: 24px;
  width: 380px; max-height: 600px;
  background: var(--cg-bg);
  border-radius: var(--cg-radius);
  box-shadow: var(--cg-shadow);
  display: flex; flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  transition: opacity .2s, transform .2s;
}
.cg-window.hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }

/* ── Page mode (full page chat.html) ─────────────────────────────── */
body.page-mode {
  margin: 0; padding: 0;
  font-family: system-ui, sans-serif;
  background: #f0f4f8;
  display: flex; justify-content: center; align-items: flex-start;
  min-height: 100vh;
}
.cg-page {
  width: 100%; max-width: 700px;
  min-height: 100vh;
  background: var(--cg-bg);
  display: flex; flex-direction: column;
  box-shadow: var(--cg-shadow);
}

/* ── Shared layout ────────────────────────────────────────────────── */
.cg-header {
  background: var(--cg-primary);
  color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 16px;
}
.cg-logo { width: 28px; height: 28px; border-radius: 4px; }

.cg-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}

.cg-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--cg-radius);
  font-size: 14px; line-height: 1.5;
  white-space: pre-wrap;
}
.cg-msg.user {
  align-self: flex-end;
  background: var(--cg-msg-user);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.cg-msg.bot {
  align-self: flex-start;
  background: var(--cg-msg-bot);
  color: #1a1a2e;
  border-bottom-left-radius: 4px;
}
.cg-msg a { color: var(--cg-primary); }

/* Typing indicator */
.cg-typing { display: flex; gap: 4px; padding: 12px 14px; }
.cg-typing span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #aaa; animation: cg-bounce .9s infinite;
}
.cg-typing span:nth-child(2) { animation-delay: .15s; }
.cg-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes cg-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* ── Excursion cards ──────────────────────────────────────────────── */
.cg-cards {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: thin;
}
.cg-card {
  min-width: 200px; max-width: 220px;
  border: 1px solid #e0e7ef;
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
  flex-shrink: 0;
  text-decoration: none; color: inherit;
  transition: box-shadow .2s;
}
.cg-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.cg-card img   { width: 100%; height: 110px; object-fit: cover; }
.cg-card-body  { padding: 8px 10px; }
.cg-card-title { font-weight: 600; margin-bottom: 4px; }
.cg-card-meta  { color: #666; font-size: 12px; }

/* ── Input row ────────────────────────────────────────────────────── */
.cg-input-row {
  display: flex; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e8edf3;
  background: #fff;
}
#cg-input {
  flex: 1;
  resize: none;
  border: 1px solid #d0d9e6;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
}
#cg-input:focus { border-color: var(--cg-primary); }
#cg-send {
  background: var(--cg-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 40px;
  cursor: pointer;
  font-size: 18px;
  transition: background .2s;
}
#cg-send:hover   { background: #0052a3; }
#cg-send:disabled{ background: #aaa; cursor: default; }
