/* Adelstein Chat — Warm & Persönlich (B2) */

.adelstein-chat {
  position: fixed;
  bottom: 0;
  right: 1.5rem;
  z-index: 9998;
  font-family: var(
    --font-ui,
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif
  );
}

/* Panel */
.adelstein-chat-panel {
  width: 380px;
  height: 480px;
  background: #1c1c1e;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.adelstein-chat-panel.is-minimized {
  transform: translateY(calc(100% - 52px));
}

/* Header */
.adelstein-chat-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: #2c2c2e;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.adelstein-chat-header:hover {
  background: #333335;
}

.adelstein-chat-profile {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(191, 155, 48, 0.4);
}

.adelstein-chat-header-info {
  flex: 1;
  min-width: 0;
}

.adelstein-chat-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #f5f5f0;
  display: block;
  line-height: 1.2;
}

.adelstein-chat-status {
  font-size: 0.65rem;
  color: rgba(191, 155, 48, 0.85);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.adelstein-chat-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34c759;
  display: inline-block;
  box-shadow: 0 0 4px rgba(52, 199, 89, 0.4);
}

.adelstein-chat-minimize {
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}

.adelstein-chat-minimize:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

/* Messages */
.adelstein-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #1c1c1e;
}

.adelstein-chat-messages::-webkit-scrollbar {
  width: 3px;
}

.adelstein-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Bot message with favicon */
.adelstein-chat-msg--bot-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  align-self: flex-start;
  max-width: 88%;
}

.adelstein-chat-bot-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.adelstein-chat-msg {
  padding: 0.65rem 0.9rem;
  font-size: 0.87rem;
  line-height: 1.6;
}

.adelstein-chat-msg p {
  margin: 0 0 0.35rem;
}

.adelstein-chat-msg p:last-child {
  margin: 0;
}

/* Bot */
.adelstein-chat-msg--bot {
  background: #2c2c2e;
  color: #e8e6e1;
  border-radius: 4px 16px 16px 16px;
  font-family: var(--font-body, "Source Serif 4", Georgia, serif);
}

/* User */
.adelstein-chat-msg--user {
  background: linear-gradient(135deg, #bf9b30, #d4ad3a);
  color: #1a1a1a;
  align-self: flex-end;
  border-radius: 16px 4px 16px 16px;
  max-width: 80%;
  font-weight: 500;
  padding: 0.65rem 0.9rem;
  font-size: 0.87rem;
  line-height: 1.6;
}

.adelstein-chat-msg--user p {
  margin: 0;
}

/* Typing */
.adelstein-chat-typing-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  align-self: flex-start;
}

.adelstein-chat-typing {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.85rem;
  background: #2c2c2e;
  border-radius: 4px 14px 14px 14px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bf9b30;
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.typing-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
  margin-left: 0.25rem;
}

@keyframes typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Form */
.adelstein-chat-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #2c2c2e;
  flex-shrink: 0;
}

.adelstein-chat-input {
  flex: 1;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 0.55rem 1rem;
  font-size: 0.87rem;
  font-family: var(--font-ui, "Inter", sans-serif);
  color: #f5f5f0;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.adelstein-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.adelstein-chat-input:focus {
  border-color: rgba(191, 155, 48, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.adelstein-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.15s;
}

.adelstein-chat-send.has-text {
  background: #bf9b30;
  color: #1a1a1a;
}

.adelstein-chat-send.has-text:hover {
  background: #d4ad3a;
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 480px) {
  .adelstein-chat {
    right: 0;
    left: 0;
  }

  .adelstein-chat-panel {
    width: 100%;
    height: 70vh;
    border-radius: 20px 20px 0 0;
  }
}
