/* ==========================================
   JUAN PATRIOTA WIDGET - Argenville Shop
   Diseño idéntico al actual de argenville.shop
   Solo se agrega clase .msg-agent para panel operador
   ========================================== */

/* ================= WIDGET JUAN PATRIOTA MASTER ================= */
.juan-float { 
  position: fixed; 
  bottom: 0; 
  right: 30px; 
  z-index: 3000; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
}

.juan-img { 
  height: 320px; 
  width: auto; 
  cursor: pointer; 
  filter: drop-shadow(0 15px 30px rgba(0,0,0,0.35)); 
  transition: 0.3s; 
  margin-right: 0; 
}

.juan-img:hover { 
  transform: scale(1.03) translateY(-10px); 
}

.juan-dialog { 
  background: white; 
  padding: 15px 25px; 
  border-radius: 30px; 
  border: 3px solid #d4a017; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
  margin-top: -20px; 
  font-weight: 800; 
  color: #020617; 
  font-size: 1rem; 
  position: relative; 
  text-align: center; 
  max-width: 280px;
}

.btn-close-juan { 
  position: absolute; 
  top: -10px; 
  left: -10px; 
  background: #ef4444; 
  color: white; 
  width: 28px; 
  height: 28px; 
  border-radius: 50%; 
  border: 3px solid white; 
  font-weight: 900; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  box-shadow: 0 4px 10px rgba(0,0,0,0.2); 
  font-size: 14px; 
}

#btnReopenJuan { 
  position: fixed; 
  bottom: 30px; 
  right: 30px; 
  z-index: 2900; 
  display: none; 
  background: #d4a017; 
  color: #020617; 
  border: none; 
  padding: 15px 30px; 
  border-radius: 50px; 
  font-weight: 900; 
  font-size: 1.1rem; 
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5); 
  transition: 0.3s; 
  cursor: pointer; 
}

/* ================= CHAT PANEL ================= */
.chat-panel { 
  position: fixed; 
  bottom: 100px; 
  right: 20px; 
  width: 320px; 
  max-height: 440px; 
  background-color: rgba(15, 23, 42, 0.98); 
  border-radius: 18px; 
  border: 1px solid rgba(148, 163, 184, 0.5); 
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.9); 
  display: none; 
  flex-direction: column; 
  overflow: hidden; 
  z-index: 10000; 
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.chat-panel.active { 
  display: flex; 
}

.chat-header { 
  padding: 12px 15px; 
  background: linear-gradient(90deg, #0ea5e9, #1d4ed8); 
  color: white; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  font-size: 14px; 
  font-weight: 600; 
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-left: 10px;
}

.chat-header-name {
  font-size: 14px;
  font-weight: 700;
}

.chat-header-status {
  font-size: 11px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-header-status::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
}

.chat-close { 
  background: none; 
  border: none; 
  cursor: pointer; 
  font-size: 20px; 
  color: white; 
  transition: 0.2s;
}

.chat-close:hover { 
  color: #d4a017; 
  transform: scale(1.1); 
}

.chat-messages { 
  padding: 15px; 
  font-size: 13px; 
  color: #e5f3ff; 
  flex: 1; 
  overflow-y: auto; 
  background: #020617; 
  min-height: 250px; 
}

.msg { 
  margin-bottom: 8px; 
  max-width: 90%; 
  line-height: 1.4; 
  animation: fadeInMsg 0.3s ease;
}

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

.msg-user { 
  text-align: right; 
  margin-left: auto; 
}

.msg-user .bubble { 
  background: linear-gradient(90deg, #0ea5e9, #3b82f6); 
  color: white; 
  border-radius: 14px 14px 0 14px; 
  padding: 8px 12px; 
  display: inline-block; 
  font-weight: 600;
}

.msg-bot .bubble { 
  background: rgba(30, 41, 59, 0.95); 
  border-radius: 14px 14px 14px 0; 
  padding: 8px 12px; 
  display: inline-block; 
  border: 1px solid rgba(148, 163, 184, 0.5); 
}

/* Mensaje del operador humano (nuevo pero con estilo igual al bot) */
.msg-agent .bubble {
  background: rgba(30, 41, 59, 0.95); 
  border-radius: 14px 14px 14px 0; 
  padding: 8px 12px; 
  display: inline-block; 
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.msg-agent .bubble::before {
  content: '👤 ';
}

.msg-time {
  font-size: 10px;
  opacity: 0.5;
  margin-top: 3px;
  display: block;
}

.chat-input-row { 
  display: flex; 
  gap: 8px; 
  padding: 10px; 
  border-top: 1px solid rgba(148, 163, 184, 0.45); 
  background-color: #020617; 
}

.chat-input-row input { 
  flex: 1; 
  border-radius: 999px; 
  border: 1px solid #4b5563; 
  background: #0f172a; 
  color: white; 
  font-size: 13px; 
  padding: 8px 12px; 
  outline: none;
}

.chat-input-row input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-input-row button { 
  border-radius: 999px; 
  border: none; 
  padding: 8px 15px; 
  font-size: 13px; 
  font-weight: 600; 
  cursor: pointer; 
  background: linear-gradient(90deg, #0ea5e9, #3b82f6); 
  color: white; 
}

.chat-input-row button:hover {
  transform: scale(1.05);
}

.chat-footer { 
  padding: 10px; 
  border-top: 1px solid rgba(148, 163, 184, 0.45); 
  background-color: #020617; 
  text-align: center; 
}

.chat-whatsapp { 
  border-radius: 999px; 
  border: none; 
  padding: 8px 15px; 
  font-size: 13px; 
  font-weight: 600; 
  cursor: pointer; 
  background: #22c55e; 
  color: white; 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  text-decoration: none;
}

.chat-whatsapp:hover {
  background: #16a34a;
  transform: scale(1.03);
}

/* Typing indicator */
.typing-indicator {
  display: none;
  padding: 10px 15px;
}

.typing-indicator.active {
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: #0ea5e9;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Formulario de datos del visitante */
.visitor-form-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #020617;
  flex: 1;
  justify-content: center;
}

.visitor-form-panel h3 {
  color: white;
  text-align: center;
  margin: 0 0 5px 0;
  font-size: 15px;
}

.visitor-form-panel p {
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin: 0 0 15px;
  font-size: 12px;
}

.visitor-form-panel input {
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #0f172a;
  color: white;
  font-size: 13px;
  padding: 10px 15px;
  outline: none;
}

.visitor-form-panel input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.visitor-form-panel input:focus {
  border-color: #0ea5e9;
}

.visitor-form-panel button {
  border-radius: 999px;
  border: none;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(90deg, #0ea5e9, #3b82f6);
  color: white;
  margin-top: 5px;
}

.visitor-form-panel button:hover {
  transform: scale(1.03);
}

/* Scrollbar personalizada */
.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #0ea5e9;
  border-radius: 3px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 640px) {
  .juan-float { 
    transform: scale(0.85); 
    transform-origin: bottom right; 
  }

  .chat-panel { 
    right: 10px; 
    left: 10px; 
    width: auto; 
    max-height: 60vh;
  }
}
