/* ============================================================
   DJBILBOX BEATS — Chat UI styles
   ============================================================ */

#aiChat {
  position: fixed;
  right: 18px;
  bottom: 62px;
  width: 360px;
  max-width: 90vw;
  height: 520px;
  max-height: 80vh;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  z-index: 1200;
  display: none;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  font-size: 0.9rem;
  transition: .2s;
}

#aiChat.open {
  display: flex;
  animation: slideUp .3s ease-out;
}

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

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.chat-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  transition: .18s;
}

.chat-close:hover {
  color: var(--text);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 3px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn .3s ease-out;
}

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

.chat-msg.user {
  align-self: flex-end;
  max-width: 85%;
}

.chat-msg.user p {
  background: var(--accent);
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  margin: 0;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-msg.bot {
  align-self: flex-start;
  max-width: 100%;
}

.chat-msg.bot p {
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  margin: 0;
  line-height: 1.45;
}

.chat-msg.bot p strong {
  font-weight: 700;
  color: var(--accent);
}

.chat-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 6px;
}

.chat-action-btn {
  background: linear-gradient(135deg, #FFE34D 0%, var(--accent) 50%, #B8960F 100%);
  color: #141414;font-weight:700;
  border: none;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: .18s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.chat-action-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.chat-contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.chat-contact-form input,
.chat-contact-form textarea {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: .18s;
}

.chat-contact-form input:focus,
.chat-contact-form textarea:focus {
  border-color: var(--accent);
  background: var(--surface-2);
}

.chat-contact-form textarea {
  resize: none;
}

.chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-input {
  flex: 1;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 11px;
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: .18s;
}

.chat-input:focus {
  border-color: var(--accent);
  background: var(--surface-2);
}

.chat-send {
  background: linear-gradient(135deg, #FFE34D 0%, var(--accent) 100%);
  color: #141414;font-weight:700;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .18s;
  font-size: 0.9rem;
}

.chat-send:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

/* Floating launcher button (bottom-right on every page) */
#aiChatFab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 1201;
  color: #141414;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFE34D 0%, var(--accent) 55%, #B8960F 100%);
  box-shadow: 0 10px 28px rgba(212, 175, 55, .45);
  transition: transform .18s, box-shadow .18s;
}

#aiChatFab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 34px rgba(212, 175, 55, .6);
}

/* When the chat is open, lift the launcher out of the way */
#aiChat.open ~ #aiChatFab {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  #aiChat {
    width: 100%;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    right: 0;
    bottom: 0;
    border-radius: 0;
  }

  .chat-msg.user {
    max-width: 90%;
  }

  .chat-actions {
    gap: 5px;
  }

  .chat-action-btn {
    padding: 6px 9px;
    font-size: 0.75rem;
  }
}
