/* ================================================
   Pedro Floating Button + Chat Drawer
================================================ */

.pedro-float-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #c9a84c, #a88a2e);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(196,169,98,0.35);
  z-index: 90;
  transition: transform 0.15s, box-shadow 0.15s;
  border: none;
  padding: 0;
}
.pedro-float-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(196,169,98,0.45);
}
.pedro-float-btn .pedro-icon {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px;
  color: #0d0f12;
  font-weight: 700;
  line-height: 1;
}
.pedro-float-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid #0d0f12;
}
.pedro-float-dot.hidden { display: none; }

/* Backdrop */
.pedro-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 94;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.pedro-backdrop.open {
  display: block;
  opacity: 1;
}

/* Drawer */
.pedro-drawer {
  position: fixed;
  bottom: 0;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 20px);
  height: 70vh;
  max-height: 600px;
  background: var(--bg, #0d0f12);
  border: 1px solid var(--border, #252a33);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.pedro-drawer.open { transform: translateY(0); }

@media (max-width: 600px) {
  .pedro-drawer { right: 0; border-radius: 16px 16px 0 0; width: 100vw; }
}

/* Header */
.pedro-drawer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #252a33);
  flex-shrink: 0;
}
.pedro-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #c9a84c, #a88a2e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 16px;
  color: #0d0f12;
  font-weight: 700;
  flex-shrink: 0;
}
.pedro-title-block { flex: 1; min-width: 0; }
.pedro-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 15px;
  color: var(--text, #e8e4dc);
  line-height: 1.2;
}
.pedro-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  margin-top: 2px;
}
.pedro-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}
.pedro-close {
  background: none;
  border: none;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  line-height: 1;
}
.pedro-close:hover { color: var(--text, #e8e4dc); }

/* Quick chips */
.pedro-chips {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border, #252a33);
  flex-shrink: 0;
  scrollbar-width: none;
}
.pedro-chips::-webkit-scrollbar { display: none; }
.pedro-chip {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 5px 10px;
  background: var(--bg3, #1a1e25);
  border: 1px solid var(--border, #252a33);
  color: var(--text-dim, #9ca3af);
  cursor: pointer;
  white-space: nowrap;
  border-radius: 12px;
  transition: all 0.15s;
}
.pedro-chip:hover {
  border-color: var(--gold-dim, #8a6f33);
  color: var(--gold, #c9a84c);
}

/* Messages */
.pedro-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pedro-msg {
  display: flex;
  gap: 8px;
  max-width: 85%;
  font-size: 12px;
  line-height: 1.55;
}
.pedro-msg.from-pedro { align-self: flex-start; }
.pedro-msg.from-user { align-self: flex-end; flex-direction: row-reverse; }
.pedro-msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #c9a84c, #a88a2e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 12px;
  color: #0d0f12;
  font-weight: 700;
  flex-shrink: 0;
}
.pedro-msg.from-user .pedro-msg-avatar { display: none; }
.pedro-msg-bubble {
  background: var(--bg3, #1a1e25);
  border: 1px solid var(--border, #252a33);
  color: var(--text, #e8e4dc);
  padding: 8px 12px;
  border-radius: 12px;
}
.pedro-msg.from-user .pedro-msg-bubble {
  background: var(--gold-faint, rgba(201,168,76,0.08));
  border-color: var(--gold-dim, #8a6f33);
  color: var(--text, #e8e4dc);
}
.pedro-msg-bubble.typing {
  display: flex;
  gap: 4px;
  align-items: center;
}
.pedro-msg-bubble.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted, #6b7280);
  animation: pedro-dot 1.2s infinite ease-in-out;
}
.pedro-msg-bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.pedro-msg-bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pedro-dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Input */
.pedro-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border, #252a33);
  flex-shrink: 0;
  background: var(--bg2, #13161b);
}
.pedro-input {
  flex: 1;
  background: var(--bg3, #1a1e25);
  border: 1px solid var(--border, #252a33);
  color: var(--text, #e8e4dc);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  outline: none;
}
.pedro-input:focus { border-color: var(--gold-dim, #8a6f33); }
.pedro-input::placeholder { color: var(--text-muted, #6b7280); }
.pedro-send {
  background: linear-gradient(135deg, #c9a84c, #a88a2e);
  border: none;
  color: #0d0f12;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 14px;
  cursor: pointer;
  border-radius: 10px;
  font-weight: 600;
}
.pedro-send:hover { filter: brightness(1.1); }
.pedro-send:disabled { opacity: 0.5; cursor: not-allowed; }
