/* === Prime Chat Widget === */

#prime-chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Bąbelek z animacją Lottie */
#prime-chat-bubble {
  cursor: pointer;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
  overflow: visible;
}

#prime-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: none;
}

/* Okno czatu */
#prime-chat-window {
  width: 360px;
  max-height: 520px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity .2s, transform .2s;
}

#prime-chat-window.prime-chat-hidden {
  display: none;
}

/* Header */
#prime-chat-header {
  background: #222222;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#prime-chat-header-info {
  display: flex;
  align-items: center;
  gap: .75rem;
}

#prime-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--prime-accent, #00b7d2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

#prime-chat-title {
  color: #ffffff;
  font-weight: 600;
  font-size: .9rem;
}

#prime-chat-status {
  color: #00d084;
  font-size: .7rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}

#prime-chat-status:before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00d084;
}

#prime-chat-close {
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  opacity: .7;
  transition: opacity .2s;
}

#prime-chat-close:hover {
  opacity: 1;
}

/* Wiadomości */
#prime-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-height: 320px;
}

.prime-chat-msg {
  display: flex;
  max-width: 85%;
}

.prime-chat-msg--bot {
  align-self: flex-start;
}

.prime-chat-msg--user {
  align-self: flex-end;
}

.prime-chat-msg-content {
  padding: .625rem .875rem;
  border-radius: 12px;
  font-size: .875rem;
  line-height: 1.5;
}

.prime-chat-msg--bot .prime-chat-msg-content {
  background: #f5f5f5;
  color: #17181a;
  border-bottom-left-radius: 4px;
}

.prime-chat-msg--user .prime-chat-msg-content {
  background: #222222;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
#prime-chat-typing {
  padding: .5rem 1rem;
  display: flex;
  gap: 4px;
  align-items: center;
}

#prime-chat-typing.prime-chat-hidden {
  display: none;
}

#prime-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aaaaaa;
  animation: prime-chat-bounce .8s infinite;
}

#prime-chat-typing span:nth-child(2) { animation-delay: .15s; }
#prime-chat-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes prime-chat-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* Input */
#prime-chat-input-area {
  padding: .75rem 1rem;
  border-top: 1px solid #eeeeee;
  display: flex;
  gap: .5rem;
  align-items: center;
}

#prime-chat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: .5rem 1rem;
  font-size: .875rem;
  outline: none;
  transition: border-color .2s;
}

#prime-chat-input:focus {
  border-color: var(--prime-accent, #00b7d2);
}

#prime-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--prime-accent, #00b7d2);
  border: 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}

#prime-chat-send:hover {
  background: #009ab8;
}

#prime-chat-send:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

/* Mobile */
@media (max-width: 480px) {
  #prime-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  #prime-chat-window {
    width: calc(100vw - 32px);
    max-height: 480px;
  }
}