/* ─── KONOCOMPANY — Chat Widget ─────────────────── */

#kc-chat-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transition: transform 0.2s, background 0.2s;
  border: none;
}
#kc-chat-bubble:hover { transform: scale(1.08); background: #f0f0f0; }
#kc-chat-bubble svg { width: 24px; height: 24px; color: #000; }

/* Badge notif */
#kc-chat-badge {
  position: absolute;
  top: 2px; right: 2px;
  width: 12px; height: 12px;
  background: #000;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}
#kc-chat-badge.visible { display: block; }

/* Panel */
#kc-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 360px;
  max-height: 520px;
  background: #000000;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 9998;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  transform: scale(0.9) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s, opacity 0.2s;
  font-family: Arial, sans-serif;
  overflow: hidden;
}
#kc-chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
#kc-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #000;
}
.kc-chat-avatar {
  width: 36px; height: 36px;
  background: #FFFFFF;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #000;
  flex-shrink: 0;
}
.kc-chat-title { flex: 1; }
.kc-chat-title strong {
  display: block;
  font-size: 13px; font-weight: 700; color: #FFFFFF;
}
.kc-chat-title span {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}
#kc-chat-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4); padding: 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: color 0.2s;
}
#kc-chat-close:hover { color: #FFFFFF; }

/* Messages */
#kc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
#kc-chat-messages::-webkit-scrollbar { width: 4px; }
#kc-chat-messages::-webkit-scrollbar-track { background: transparent; }
#kc-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.kc-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.kc-msg.user {
  background: #FFFFFF;
  color: #000000;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.kc-msg.bot {
  background: rgba(255,255,255,0.07);
  color: #FFFFFF;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
}
.kc-msg.typing {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.4);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  font-style: italic;
}

/* Input */
#kc-chat-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 8px;
  background: #000;
}
#kc-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 13px;
  color: #FFFFFF;
  font-size: 13px;
  font-family: Arial, sans-serif;
  outline: none;
  resize: none;
  max-height: 90px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
#kc-chat-input::placeholder { color: rgba(255,255,255,0.3); }
#kc-chat-input:focus { border-color: rgba(255,255,255,0.4); }

#kc-chat-send {
  width: 40px; height: 40px;
  background: #FFFFFF;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
  align-self: flex-end;
}
#kc-chat-send:hover { background: #e0e0e0; }
#kc-chat-send:disabled { background: rgba(255,255,255,0.2); cursor: not-allowed; }
#kc-chat-send svg { width: 16px; height: 16px; color: #000; }

/* Responsive */
@media (max-width: 480px) {
  #kc-chat-panel { width: calc(100vw - 32px); right: 16px; bottom: 88px; }
  #kc-chat-bubble { right: 16px; bottom: 16px; }
}
