/* ==============================================================================
   PEACOCKVIS IA - CHATBOX WIDGET STYLES (Steam & Cyberpunk Theme)
   ============================================================================== */

/* Floating Launcher Button */
.peacock-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #101c29 0%, #173852 50%, #0077c8 100%);
  border: 1px solid #66c0f4;
  border-radius: 50px;
  padding: 10px 18px 10px 12px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 119, 200, 0.4), 0 0 16px rgba(102, 192, 244, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.peacock-chat-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 119, 200, 0.6), 0 0 24px rgba(102, 192, 244, 0.5);
  border-color: #a4d7f5;
}

.peacock-launcher-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, #66c0f4 0%, #1b2838 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.3);
  position: relative;
}

.peacock-launcher-avatar::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #2ecc71;
  border: 2px solid #101c29;
  border-radius: 50%;
  box-shadow: 0 0 8px #2ecc71;
}

.peacock-launcher-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.peacock-launcher-title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}

.peacock-launcher-subtitle {
  font-size: 0.72rem;
  color: #66c0f4;
  font-weight: 500;
}

/* Chatbox Window Container */
.peacock-chat-window {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 99998;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #171a21;
  border: 1px solid #2a475e;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(102, 192, 244, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Motiva Sans', 'Roboto', sans-serif;
}

.peacock-chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Window Header */
.peacock-chat-header {
  background: linear-gradient(135deg, #1b2838 0%, #101c29 100%);
  border-bottom: 1px solid #2a475e;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.peacock-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.peacock-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, #66c0f4 0%, #1b2838 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.peacock-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.peacock-header-badge {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #2ecc71;
  border-radius: 50%;
  box-shadow: 0 0 6px #2ecc71;
}

.peacock-header-subtitle {
  font-size: 0.72rem;
  color: #8f98a0;
}

.peacock-chat-close {
  background: transparent;
  border: none;
  color: #8f98a0;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.peacock-chat-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Chat Body / Messages Area */
.peacock-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at 50% 0%, #1b2838 0%, #171a21 100%);
}

.peacock-chat-body::-webkit-scrollbar {
  width: 6px;
}
.peacock-chat-body::-webkit-scrollbar-thumb {
  background: #2a475e;
  border-radius: 3px;
}

/* Message Bubbles */
.peacock-msg {
  display: flex;
  gap: 8px;
  max-width: 86%;
  animation: peacockFadeIn 0.25s ease-out forwards;
}

@keyframes peacockFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.peacock-msg.assistant {
  align-self: flex-start;
}

.peacock-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.peacock-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2a475e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.peacock-msg-bubble {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.peacock-msg.assistant .peacock-msg-bubble {
  background: #1b2838;
  border: 1px solid #2a475e;
  color: #c6d4df;
  border-top-left-radius: 2px;
}

.peacock-msg.user .peacock-msg-bubble {
  background: linear-gradient(135deg, #1999ff 0%, #0077c8 100%);
  color: #fff;
  border-top-right-radius: 2px;
}

/* Quick Suggestion Chips */
.peacock-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding-left: 36px;
}

.peacock-chip-btn {
  background: rgba(102, 192, 244, 0.1);
  border: 1px solid rgba(102, 192, 244, 0.3);
  color: #66c0f4;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.peacock-chip-btn:hover {
  background: rgba(102, 192, 244, 0.25);
  border-color: #66c0f4;
  color: #fff;
}

/* Typing Indicator */
.peacock-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #1b2838;
  border: 1px solid #2a475e;
  border-radius: 8px;
  align-self: flex-start;
  width: fit-content;
}

.peacock-typing-dot {
  width: 6px;
  height: 6px;
  background: #66c0f4;
  border-radius: 50%;
  animation: peacockBounce 1.4s infinite ease-in-out both;
}

.peacock-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.peacock-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes peacockBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat Footer / Input Form */
.peacock-chat-footer {
  background: #101c29;
  border-top: 1px solid #1e2e3e;
  padding: 10px 14px 12px 14px;
}

.peacock-chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.peacock-chat-input-container {
  flex: 1;
  position: relative;
  display: flex;
}

.peacock-chat-textarea {
  width: 100%;
  min-height: 38px;
  max-height: 130px;
  background: #0d141c;
  border: 1px solid #2a475e;
  border-radius: 4px;
  padding: 9px 12px;
  color: #fff;
  font-size: 0.86rem;
  line-height: 1.4;
  outline: none;
  font-family: inherit;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.peacock-chat-textarea:focus {
  border-color: #66c0f4;
  background: #090e14;
}

.peacock-chat-textarea::-webkit-scrollbar {
  width: 5px;
}

.peacock-chat-textarea::-webkit-scrollbar-thumb {
  background: #2a475e;
  border-radius: 4px;
}

.peacock-chat-send {
  background: linear-gradient(90deg, #75b022 0%, #588a1b 100%);
  border: none;
  border-radius: 4px;
  color: #fff;
  width: 42px;
  height: 38px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.2s, transform 0.1s;
}

.peacock-chat-send:hover {
  filter: brightness(1.15);
}

.peacock-chat-send:active {
  transform: scale(0.96);
}

/* Code Blocks Styling */
.peacock-code-card {
  margin: 10px 0;
  background: #0a1017;
  border: 1px solid #22374b;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.peacock-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #121c27;
  border-bottom: 1px solid #1d2d3e;
}

.peacock-code-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.peacock-code-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #66c0f4;
  display: inline-block;
  box-shadow: 0 0 6px rgba(102, 192, 244, 0.6);
}

.peacock-code-lang {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8bb9db;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.peacock-code-copy-btn {
  background: rgba(102, 192, 244, 0.12);
  border: 1px solid rgba(102, 192, 244, 0.3);
  color: #66c0f4;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.peacock-code-copy-btn:hover {
  background: rgba(102, 192, 244, 0.25);
  border-color: #66c0f4;
  color: #fff;
}

.peacock-code-copy-btn.copied {
  background: #75b022 !important;
  border-color: #75b022 !important;
  color: #fff !important;
}

.peacock-code-pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #dce5ec;
  background: #090e15;
  tab-size: 2;
}

.peacock-code-pre code {
  font-family: inherit;
  color: inherit;
}

.peacock-code-pre::-webkit-scrollbar {
  height: 6px;
}

.peacock-code-pre::-webkit-scrollbar-thumb {
  background: #2a475e;
  border-radius: 3px;
}

/* Inline code snippet */
.peacock-inline-code {
  background: #0d151f;
  border: 1px solid #24394d;
  color: #66c0f4;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85em;
  word-break: break-word;
}

/* Contact Button inside Assistant Reply */
.peacock-contact-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 16px;
  background: linear-gradient(90deg, #75b022 0%, #588a1b 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.84rem;
  border-radius: 4px;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, filter 0.2s;
}

.peacock-contact-card-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  text-decoration: none;
}

.peacock-footer-support-hint {
  margin-top: 8px;
  text-align: center;
  font-size: 0.72rem;
  color: #8f98a0;
}

.peacock-footer-support-hint a {
  color: #66c0f4;
  text-decoration: underline;
}

/* Mobile Adaptation */
@media (max-width: 480px) {
  .peacock-chat-launcher {
    bottom: 12px;
    right: 12px;
    padding: 6px 12px 6px 8px;
    max-width: calc(100vw - 24px);
    box-shadow: 0 4px 16px rgba(0, 119, 200, 0.4);
  }
  .peacock-launcher-avatar {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
  .peacock-launcher-text strong {
    font-size: 0.76rem;
  }
  .peacock-launcher-text span {
    font-size: 0.65rem;
  }
  .peacock-chat-window {
    bottom: 64px;
    right: 8px;
    width: calc(100vw - 16px);
    max-width: 420px;
    height: calc(100vh - 76px);
  }
}
