/* ===================================================================
   Paperbacks & Pixels — Chatbot Widget Styles
   Neobrutalist design: hard shadows, thick borders, no rounded corners
   =================================================================== */

/* --- Floating bubble button (bottom-right corner) --- */
#pp-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  background: #FDE64A;
  color: #000;
  border: 3px solid #000;
  border-radius: 0;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

#pp-chat-bubble:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

/* --- Chat window --- */
#pp-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9998;
  width: 380px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  background: #FFFCF1;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000;
  font-family: 'Karla', sans-serif;
}

/* Hidden state */
#pp-chat-window.pp-chat-hidden {
  display: none;
}

/* --- Chat header --- */
#pp-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #000;
  color: #FFFCF1;
  border-bottom: 3px solid #000;
}

#pp-chat-title {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

#pp-chat-close {
  background: none;
  border: none;
  color: #FFFCF1;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

#pp-chat-close:hover {
  color: #FDE64A;
}

/* --- Messages area --- */
#pp-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 360px;
}

/* Individual message bubbles */
.pp-msg {
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 85%;
  border: 2px solid #000;
}

/* Bot messages — left-aligned, cream background */
.pp-msg-bot {
  align-self: flex-start;
  background: #fff;
  box-shadow: 2px 2px 0 #000;
}

/* User messages — right-aligned, yellow background */
.pp-msg-user {
  align-self: flex-end;
  background: #FDE64A;
  box-shadow: 2px 2px 0 #000;
}

/* Typing indicator */
.pp-msg.pp-typing {
  color: #888;
  font-style: italic;
  border-style: dashed;
  box-shadow: none;
}

/* --- Input form --- */
#pp-chat-form {
  display: flex;
  border-top: 3px solid #000;
}

#pp-chat-input {
  flex: 1;
  padding: 12px 14px;
  font-family: 'Karla', sans-serif;
  font-size: 0.9rem;
  border: none;
  outline: none;
  background: #fff;
}

#pp-chat-input:focus {
  background: #FFFCF1;
}

#pp-chat-send {
  padding: 12px 18px;
  background: #FDE64A;
  color: #000;
  font-family: 'Karla', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  border: none;
  border-left: 3px solid #000;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: background 0.15s;
}

#pp-chat-send:hover {
  background: #000;
  color: #FDE64A;
}

/* --- Download buttons and links in bot messages --- */
.pp-chat-download {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  background: #FDE64A;
  color: #000;
  font-weight: 800;
  font-size: 0.82rem;
  text-decoration: none;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}

.pp-chat-download:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

.pp-chat-link {
  color: #B8A050;
  font-weight: 700;
  text-decoration: underline;
}

.pp-chat-link:hover {
  color: #000;
}

/* --- Mobile responsive --- */
@media (max-width: 768px) {
  #pp-chat-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 88px;
    max-height: 70vh;
  }

  #pp-chat-bubble {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }

  #pp-chat-messages {
    max-height: 50vh;
  }
}
