/* ── Chat Widget ─────────────────────────────────────────────────────────── */
.cc-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d3b44, #1a6b5a);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.cc-chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
}
.cc-chat-fab i { font-size: 28px; }
.cc-chat-fab .cc-chat-fab__badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #ff5722;
  border: 2px solid #fff;
  display: none;
}

/* ── Panel ─────────────────────────────────────────────────────────────── */
.cc-chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: none;           /* toggled by JS */
  flex-direction: column;
  overflow: hidden;
  font-family: 'Lato', sans-serif;
}
.cc-chat-panel.is-open { display: flex; }

/* Header */
.cc-chat-header {
  background: linear-gradient(135deg, #0d3b44, #1a6b5a);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.cc-chat-header__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.cc-chat-header__info { flex: 1; min-width: 0; }
.cc-chat-header__name { font-weight: 700; font-size: 15px; }
.cc-chat-header__status { font-size: 12px; opacity: .8; }
.cc-chat-header__new {
  background: none; border: none; color: #fff; cursor: pointer;
  padding: 4px; line-height: 1;
  opacity: .6; transition: opacity .15s;
  border-radius: 4px;
}
.cc-chat-header__new:hover { opacity: 1; background: rgba(255,255,255,.12); }
.cc-chat-header__close {
  background: none; border: none; color: #fff; cursor: pointer;
  font-size: 22px; padding: 0; line-height: 1;
  opacity: .7; transition: opacity .15s;
}
.cc-chat-header__close:hover { opacity: 1; }

/* Messages area */
.cc-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f6f8;
}

/* Bubble */
.cc-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.cc-chat-msg--user {
  align-self: flex-end;
  background: #0d3b44;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.cc-chat-msg--assistant {
  align-self: flex-start;
  background: #fff;
  color: #333;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}
.cc-chat-msg--assistant strong,
.cc-chat-msg--assistant b { color: #0d3b44; }

/* Typing indicator */
.cc-chat-typing {
  align-self: flex-start;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  display: none;
}
.cc-chat-typing.is-visible { display: flex; gap: 4px; align-items: center; }
.cc-chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #9e9e9e;
  animation: ccBounce .6s infinite alternate;
}
.cc-chat-typing span:nth-child(2) { animation-delay: .2s; }
.cc-chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ccBounce {
  to { opacity: .3; transform: translateY(-4px); }
}

/* Input area */
.cc-chat-footer {
  padding: 10px 12px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  background: #fff;
}
.cc-chat-footer textarea {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  outline: none;
  transition: border-color .15s;
}
.cc-chat-footer textarea:focus { border-color: #0d3b44; }
.cc-chat-footer button {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #0d3b44;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.cc-chat-footer button:hover { background: #1a6b5a; }
.cc-chat-footer button:disabled { background: #bbb; cursor: default; }
.cc-chat-footer button i { font-size: 20px; }

/* Welcome message */
.cc-chat-welcome {
  text-align: center;
  padding: 20px 10px 8px;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}
.cc-chat-welcome strong { color: #0d3b44; }

/* Suggestions */
.cc-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px;
}
.cc-chat-suggestions button {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  width: auto;
  height: auto;
}
.cc-chat-suggestions button:hover { background: #c8e6c9; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cc-chat-panel {
    right: 8px;
    bottom: 80px;
    width: calc(100vw - 16px);
    height: calc(100vh - 100px);
    border-radius: 12px;
  }
  .cc-chat-fab { bottom: 16px; right: 16px; }
}
