/* === Główne okno czatu === */
#openai-chat-widget {
  width: 100%;
  max-width: 900px; /* +50% */
  border: 1px solid #ddd;
  border-radius: 8px;
  background: var(--window-bg, #fff); /* dynamiczne tło */
  display: flex;
  flex-direction: column;
  font-family: inherit;
  margin: 30px auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}

/* === Okno wiadomości === */
#chat-messages {
  padding: 15px;
  height: 600px; /* +50% */
  overflow-y: auto;
  background: #fafafa;
  scroll-behavior: smooth;
}

/* === Wiadomości === */
.msg {
  padding: 10px 14px;
  margin: 8px 0;
  border-radius: 10px;
  line-height: 1.5;
  max-width: 85%;
  word-wrap: break-word;
}

.msg.user {
  background: var(--user-bg, #e7f9ff); /* kolor z panelu */
  align-self: flex-end;
}

.msg.bot {
  background: var(--bot-bg, #f1f1f1); /* kolor z panelu */
  align-self: flex-start;
}

.msg.error {
  background: var(--error-bg, #ffe0e0); /* kolor z panelu */
  color: #900;
  font-style: italic;
  align-self: center;
}

/* === Pole wprowadzania tekstu === */
#chat-input {
  display: flex;
  border-top: 1px solid #ddd;
}

/* === Pole tekstowe === */
#chat-input input {
  flex: 1;
  padding: 12px;
  border: none;
  outline: none;
  font-size: 15px;
  border-radius: 0 0 0 8px;
  background: #fff;
}

/* === Przycisk wysyłania === */
#chat-input button {
  background: linear-gradient(90deg, var(--gradient-from, #0073aa), var(--gradient-to, #005f8d)); /* gradient dynamiczny */
  color: #fff;
  border: none;
  padding: 12px 22px;
  cursor: pointer;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

#chat-input button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* === Responsywność === */
@media (max-width: 480px) {
  #openai-chat-widget {
    max-width: 95%;
  }
  #chat-messages {
    height: 400px;
  }
}
