/* ── GRČIĆ GOLD CHATBOT WIDGET ── */
:root {
  --cb-gold: #b8973a;
  --cb-dark: #1a1613;
  --cb-ivory: #f7f3ec;
  --cb-radius: 16px;
}

#gc-chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9998;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--cb-dark);
  border: 2px solid var(--cb-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(26,22,19,.35);
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
}
#gc-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(184,151,58,.35);
}
#gc-chat-btn svg {
  width: 26px;
  height: 26px;
  color: var(--cb-gold);
  transition: opacity .2s;
}
#gc-chat-btn .icon-close { display: none; }
#gc-chat-btn.open .icon-chat { display: none; }
#gc-chat-btn.open .icon-close { display: block; }

/* unread badge */
#gc-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cb-gold);
  color: var(--cb-dark);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: opacity .2s, transform .2s;
}
#gc-chat-badge.show {
  opacity: 1;
  transform: scale(1);
}

/* panel */
#gc-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 9997;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100svh - 120px);
  background: var(--cb-ivory);
  border: 1px solid rgba(184,151,58,.3);
  border-radius: var(--cb-radius);
  box-shadow: 0 12px 48px rgba(26,22,19,.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.97);
  pointer-events: none;
  transition: opacity .28s cubic-bezier(.4,0,.2,1),
              transform .28s cubic-bezier(.4,0,.2,1);
}
#gc-chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* header */
#gc-chat-header {
  background: var(--cb-dark);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#gc-chat-header .hd-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(184,151,58,.15);
  border: 1.5px solid var(--cb-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#gc-chat-header .hd-avatar svg {
  width: 18px;
  height: 18px;
  color: var(--cb-gold);
}
#gc-chat-header .hd-info { flex: 1; }
#gc-chat-header .hd-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--cb-ivory);
  letter-spacing: .04em;
}
#gc-chat-header .hd-status {
  font-size: 11px;
  color: rgba(247,243,236,.55);
  display: flex;
  align-items: center;
  gap: 5px;
}
#gc-chat-header .hd-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4caf8a;
  display: inline-block;
}
#gc-chat-header .hd-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: rgba(247,243,236,.5);
  transition: color .2s;
}
#gc-chat-header .hd-close:hover { color: var(--cb-ivory); }
#gc-chat-header .hd-close svg { width: 18px; height: 18px; }

/* messages */
#gc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#gc-chat-messages::-webkit-scrollbar { width: 4px; }
#gc-chat-messages::-webkit-scrollbar-track { background: transparent; }
#gc-chat-messages::-webkit-scrollbar-thumb { background: rgba(184,151,58,.3); border-radius: 4px; }

.gc-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  animation: gcMsgIn .22s ease;
}
@keyframes gcMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gc-msg.bot {
  background: #fff;
  color: var(--cb-dark);
  border: 1px solid rgba(184,151,58,.18);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.gc-msg.user {
  background: var(--cb-dark);
  color: var(--cb-ivory);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* typing indicator */
.gc-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 13px;
  background: #fff;
  border: 1px solid rgba(184,151,58,.18);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  animation: gcMsgIn .22s ease;
}
.gc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cb-gold);
  animation: gcDot 1.2s ease-in-out infinite;
}
.gc-typing span:nth-child(2) { animation-delay: .2s; }
.gc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes gcDot {
  0%, 80%, 100% { transform: scale(.7); opacity: .4; }
  40%            { transform: scale(1); opacity: 1; }
}

/* quick replies */
#gc-quick-wrap {
  padding: 6px 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.gc-quick-btn {
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid rgba(184,151,58,.45);
  background: transparent;
  color: var(--cb-dark);
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s;
  font-family: inherit;
}
.gc-quick-btn:hover {
  background: var(--cb-dark);
  color: var(--cb-gold);
  border-color: var(--cb-dark);
}

/* input area */
#gc-chat-form {
  padding: 12px 14px;
  border-top: 1px solid rgba(184,151,58,.2);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}
#gc-chat-input {
  flex: 1;
  border: 1px solid rgba(184,151,58,.3);
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--cb-ivory);
  color: var(--cb-dark);
  outline: none;
  resize: none;
  height: 38px;
  max-height: 100px;
  overflow-y: auto;
  transition: border-color .2s;
  line-height: 1.4;
}
#gc-chat-input:focus { border-color: var(--cb-gold); }
#gc-chat-input::placeholder { color: rgba(26,22,19,.38); }

#gc-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cb-dark);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
}
#gc-chat-send:hover { background: var(--cb-gold); }
#gc-chat-send:active { transform: scale(.92); }
#gc-chat-send svg { width: 16px; height: 16px; color: var(--cb-ivory); }
#gc-chat-send:disabled { opacity: .45; cursor: default; }

/* mobile */
@media (max-width: 480px) {
  #gc-chat-panel {
    right: 12px;
    bottom: 90px;
    width: calc(100vw - 24px);
    height: calc(100svh - 110px);
    max-height: none;
  }
  #gc-chat-btn {
    right: 16px;
    bottom: 20px;
  }
}
