/* noch' Chat Widget */
#noch-chat-bubble {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #c3c0ff, #9d9bff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 24px rgba(195, 192, 255, 0.3);
}
#noch-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 32px rgba(195, 192, 255, 0.5);
}
#noch-chat-bubble.active {
  transform: scale(0);
  pointer-events: none;
}

#noch-chat-preview {
  display: none;
  position: fixed;
  bottom: 116px;
  right: 96px;
  background: #1c1b1b;
  color: #e6e1e5;
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  z-index: 10001;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid #2a2a2a;
  cursor: pointer;
  animation: noch-preview-in 0.3s ease;
}
#noch-chat-preview::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #1c1b1b;
  border-right: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
}

@keyframes noch-preview-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

#noch-chat-window {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 380px;
  height: 520px;
  background: #131313;
  border: 1px solid #2a2a2a;
  z-index: 10002;
  display: flex;
  flex-direction: column;
  transform: scale(0);
  transform-origin: bottom right;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  font-family: 'Inter', sans-serif;
}
#noch-chat-window.open {
  transform: scale(1);
  opacity: 1;
}

#noch-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #1c1b1b;
  border-bottom: 1px solid #2a2a2a;
  color: #c3c0ff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}
#noch-chat-close {
  background: none;
  border: none;
  color: #938f99;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
#noch-chat-close:hover { color: #e6e1e5; }

#noch-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#noch-chat-messages::-webkit-scrollbar { width: 4px; }
#noch-chat-messages::-webkit-scrollbar-track { background: transparent; }
#noch-chat-messages::-webkit-scrollbar-thumb { background: #2a2a2a; }

.noch-msg {
  max-width: 85%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  animation: noch-msg-in 0.3s ease;
}
.noch-msg-bot {
  background: #1c1b1b;
  color: #e6e1e5;
  align-self: flex-start;
  border: 1px solid #2a2a2a;
}
.noch-msg-user {
  background: #c3c0ff;
  color: #1a1040;
  align-self: flex-end;
}
.noch-msg a {
  color: #46eaed;
  text-decoration: underline;
}

@keyframes noch-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
.noch-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}
.noch-typing span {
  width: 8px;
  height: 8px;
  background: #938f99;
  border-radius: 50%;
  animation: noch-dot 1.2s infinite;
}
.noch-typing span:nth-child(2) { animation-delay: 0.2s; }
.noch-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes noch-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

#noch-chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid #2a2a2a;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.noch-chat-btn {
  background: #1c1b1b;
  color: #c3c0ff;
  border: 1px solid #c3c0ff;
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.noch-chat-btn:hover {
  background: #c3c0ff;
  color: #1a1040;
}

.noch-input-wrap {
  display: flex;
  width: 100%;
  gap: 8px;
}
.noch-chat-input {
  flex: 1;
  background: #1c1b1b;
  border: 1px solid #2a2a2a;
  color: #e6e1e5;
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
}
.noch-chat-input:focus { border-color: #c3c0ff; }
.noch-chat-input::placeholder { color: #938f99; }

.noch-chat-send {
  background: #c3c0ff;
  color: #1a1040;
  border: none;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.noch-chat-send:hover { background: #9d9bff; }

/* Mobile */
@media (max-width: 768px) {
  #noch-chat-bubble { bottom: 80px; right: 16px; width: 48px; height: 48px; }
  #noch-chat-bubble svg { width: 24px; height: 24px; }
  #noch-chat-preview { bottom: 96px; right: 72px; font-size: 13px; }
  #noch-chat-window { bottom: 0; right: 0; left: 0; width: 100%; height: 100%; max-height: 100vh; }
}
