/* ============================================
   VASPAR AI CHATBOT - Complete Stylesheet
   ============================================ */

#vaspar-chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, #9B7C2E 0%, #C9A84C 60%, #E8C97A 100%);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(201,168,76,0.45), 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
  outline: none;
}

#vaspar-chat-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 32px rgba(201,168,76,0.55), 0 4px 12px rgba(0,0,0,0.25);
}

#vaspar-chat-launcher svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  transition: opacity 0.2s;
}

#vaspar-chat-launcher .icon-close { display: none; }
#vaspar-chat-launcher.open .icon-chat { display: none; }
#vaspar-chat-launcher.open .icon-close { display: block; }

#vaspar-chat-launcher::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,0.4);
  animation: vp-pulse 2.4s ease-out infinite;
}

@keyframes vp-pulse {
  0%   { opacity: 1; transform: scale(1); }
  70%  { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; }
}

#vaspar-chat-window {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 385px;
  height: 580px;
  background: #FAF8F3;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22), 0 4px 20px rgba(201,168,76,0.12);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(201,168,76,0.25);
  transform: scale(0.88) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(.34,1.4,.64,1), opacity 0.25s ease;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
}

#vaspar-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.vpc-header {
  background: linear-gradient(135deg, #1A1612 0%, #2C2520 100%);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(201,168,76,0.2);
  flex-shrink: 0;
}

.vpc-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #9B7C2E, #E8C97A);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #1A1612;
  flex-shrink: 0;
  position: relative;
}

.vpc-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #3ECF6E;
  border-radius: 50%;
  border: 2px solid #1A1612;
}

.vpc-header-info { flex: 1; }

.vpc-header-name {
  font-size: 15px;
  font-weight: 600;
  color: #E8C97A;
  line-height: 1.2;
}

.vpc-header-status {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

.vpc-header-close {
  background: rgba(255,255,255,0.08);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.55);
  transition: background 0.2s, color 0.2s;
}

.vpc-header-close:hover { background: rgba(201,168,76,0.25); color: #E8C97A; }
.vpc-header-close svg { width: 15px; height: 15px; fill: currentColor; }

/* Lead form */
.vpc-lead {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 26px;
}

.vpc-lead.hide { display: none; }

.vpc-lead h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1A1612;
  text-align: center;
  margin: 0 0 6px;
}

.vpc-divider {
  width: 36px;
  height: 2px;
  background: linear-gradient(90deg, #9B7C2E, #E8C97A);
  border-radius: 2px;
  margin: 0 auto 14px;
}

.vpc-lead p {
  font-size: 13px;
  color: #6B6460;
  text-align: center;
  line-height: 1.5;
  margin: 0 0 22px;
}

.vpc-field { width: 100%; margin-bottom: 13px; }

.vpc-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #9B7C2E;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 5px;
}

.vpc-field input {
  width: 100%;
  padding: 11px 14px;
  background: #ffffff;
  border: 1.5px solid rgba(201,168,76,0.3);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  color: #1A1612;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.vpc-field input:focus {
  border-color: #C9A84C;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

.vpc-field input::placeholder { color: #B0A89E; }
.vpc-field input.error { border-color: #e05555; }

.vpc-start {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #9B7C2E, #C9A84C, #E8C97A);
  border: none;
  border-radius: 11px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #1A1612;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.vpc-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.4);
}

/* Messages */
.vpc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.vpc-messages.hide { display: none; }
.vpc-messages::-webkit-scrollbar { width: 3px; }
.vpc-messages::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.3); border-radius: 3px; }

.vpc-msg {
  display: flex;
  gap: 8px;
  animation: msgIn 0.25s ease both;
}

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

.vpc-msg.user { flex-direction: row-reverse; }

.vpc-msg-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9B7C2E, #E8C97A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #1A1612;
  flex-shrink: 0;
  align-self: flex-end;
}

.vpc-msg.user .vpc-msg-av {
  background: #2C2520;
  color: #E8C97A;
}

.vpc-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #1A1612;
}

.vpc-msg.bot .vpc-bubble {
  background: #ffffff;
  border: 1px solid rgba(201,168,76,0.2);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.vpc-msg.user .vpc-bubble {
  background: linear-gradient(135deg, #9B7C2E, #C9A84C);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Typing */
.vpc-typing .vpc-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 13px 16px;
}

.vpc-dot {
  width: 7px;
  height: 7px;
  background: #C9A84C;
  border-radius: 50%;
  animation: dotBounce 1.2s ease-in-out infinite;
}

.vpc-dot:nth-child(2) { animation-delay: 0.2s; }
.vpc-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick replies */
.vpc-qr {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
  flex-shrink: 0;
}

.vpc-qr.hide { display: none; }

.vpc-qr button {
  padding: 6px 12px;
  background: #ffffff;
  border: 1.5px solid rgba(201,168,76,0.3);
  border-radius: 20px;
  font-family: inherit;
  font-size: 11.5px;
  color: #9B7C2E;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.vpc-qr button:hover {
  background: #C9A84C;
  border-color: #C9A84C;
  color: #1A1612;
}

/* Input */
.vpc-input {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(201,168,76,0.2);
  background: #ffffff;
  display: flex;
  gap: 9px;
  align-items: flex-end;
  flex-shrink: 0;
}

.vpc-input.hide { display: none; }

.vpc-input textarea {
  flex: 1;
  padding: 10px 13px;
  background: #FAF8F3;
  border: 1.5px solid rgba(201,168,76,0.25);
  border-radius: 11px;
  font-family: inherit;
  font-size: 13px;
  color: #1A1612;
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 100px;
  min-height: 40px;
  transition: border-color 0.2s;
}

.vpc-input textarea:focus { border-color: #C9A84C; }
.vpc-input textarea::placeholder { color: #B0A89E; }

.vpc-send {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #9B7C2E, #E8C97A);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(201,168,76,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.vpc-send:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(201,168,76,0.45); }
.vpc-send:active { transform: scale(0.95); }
.vpc-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.vpc-send svg { width: 17px; height: 17px; fill: #1A1612; }

.vpc-footer {
  text-align: center;
  font-size: 10px;
  color: #9B9490;
  padding: 5px 0 8px;
  flex-shrink: 0;
}

.vpc-footer a { color: #9B7C2E; text-decoration: none; font-weight: 500; }

@media (max-width: 480px) {
  #vaspar-chat-window {
    bottom: 0; right: 0;
    width: 100%; height: 100dvh;
    border-radius: 0; border: none;
  }
}
