/* ── CHAT WIDGET ─────────────────────────────────────── */

.chat-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  font-family: 'Noto Sans Georgian', sans-serif;
}

/* ── TOGGLE BUTTON ───────────────────────────────────── */

.chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a84c, #e0b95a);
  border: 2px solid rgba(201,168,76,0.4);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.chat-toggle:hover {
  transform: scale(1.08);
  border-color: #c9a84c;
  box-shadow: 0 12px 36px rgba(0,0,0,0.3);
}

/* ── CHAT BOX ────────────────────────────────────────── */

.chat-box {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 340px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 520px;

  /* animation */
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.chat-box.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── HEADER ──────────────────────────────────────────── */

.chat-header {
  background: linear-gradient(135deg, #1a3a2a, #2d5a3d);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(201,168,76,0.2);
  border: 2px solid rgba(201,168,76,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.chat-header-title {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}
.chat-header-status {
  color: rgba(255,255,255,0.55);
  font-size: 0.72rem;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf7d;
  display: inline-block;
}
.chat-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-close:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ── MESSAGES ────────────────────────────────────────── */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* ── BUBBLES ─────────────────────────────────────────── */

.msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: msgIn 0.2s ease both;
}
.msg.bot { align-self: flex-start; }
.msg.user { align-self: flex-end; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.55;
}
.msg.bot .msg-bubble {
  background: #f0f4f2;
  color: #1a2a1e;
  border-bottom-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: linear-gradient(135deg, #1a3a2a, #2d5a3d);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-time {
  font-size: 0.68rem;
  color: #aaa;
  margin-top: 3px;
  padding: 0 4px;
}
.msg.user .msg-time { text-align: right; }

/* ── TYPING INDICATOR ────────────────────────────────── */

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: #f0f4f2;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2d5a3d;
  opacity: 0.4;
  animation: typing 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ── SUGGESTED QUESTIONS ─────────────────────────────── */

.chat-suggestions {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.chat-suggestions-label {
  font-size: 0.7rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.suggestion-btn {
  background: #f5f0e8;
  border: 1px solid #e8dfc8;
  color: #1a3a2a;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
  font-family: 'Noto Sans Georgian', sans-serif;
  font-weight: 500;
}
.suggestion-btn:hover {
  background: #1a3a2a;
  color: #fff;
  border-color: #1a3a2a;
}

/* ── INPUT ───────────────────────────────────────────── */

.chat-input-wrap {
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: 'Noto Sans Georgian', sans-serif;
  outline: none;
  transition: 0.2s;
  background: #fafafa;
}
.chat-input:focus {
  border-color: #2d5a3d;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(45,90,61,0.08);
}
.chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a3a2a, #2d5a3d);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-send:hover { transform: scale(1.08); opacity: 0.9; }
.chat-send:disabled { opacity: 0.4; cursor: default; transform: none; }

/* ── ANIMATIONS ──────────────────────────────────────── */

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes typing {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(-4px); }
}

/* ── MOBILE ──────────────────────────────────────────── */

@media (max-width: 480px) {
  .chat-widget { bottom: 16px; right: 16px; }
  .chat-box { width: calc(100vw - 32px); right: 0; }
}