/* public/chat-widget.css - Widget de chat Arcring Perú */

#arcring-chat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
}

/* Launcher (botón flotante) */
#arcring-chat-launcher {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #0057b7 0%, #00478f 100%);
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 87, 183, 0.4);
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
#arcring-chat-launcher:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 25px rgba(0, 87, 183, 0.55);
}
#arcring-chat-badge {
  position: absolute; top: -4px; right: -4px;
  background: #e63946; color: white;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px;
  font-size: 12px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}

/* Panel de chat */
#arcring-chat-panel {
  position: absolute; bottom: 75px; right: 0;
  width: 360px; height: 540px; max-height: 80vh;
  background: white;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: arcringSlideUp .25s ease-out;
}
@keyframes arcringSlideUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
  #arcring-chat-panel {
    position: fixed; bottom: 0; right: 0; left: 0; top: 0;
    width: 100%; height: 100vh; max-height: 100vh; border-radius: 0;
  }
}

/* Header */
#arcring-chat-header {
  background: linear-gradient(135deg, #0057b7 0%, #00478f 100%);
  color: white;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
#arcring-chat-title { display: flex; flex-direction: column; }
#arcring-chat-title strong { font-size: 15px; }
#arcring-chat-title small { font-size: 12px; opacity: .8; margin-top: 2px; }
#arcring-chat-title small.ok::before {
  content: '●'; color: #4ade80; margin-right: 5px;
}
#arcring-chat-actions { display: flex; gap: 8px; align-items: center; }
#arcring-chat-actions a, #arcring-chat-actions button {
  background: transparent; border: 0; color: white; cursor: pointer;
  padding: 6px; border-radius: 6px; display: flex; align-items: center;
  transition: background .15s;
}
#arcring-chat-actions a:hover, #arcring-chat-actions button:hover {
  background: rgba(255,255,255,.15);
}
#arcring-chat-close { font-size: 16px; font-weight: bold; }

/* Mensajes */
#arcring-chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px; background: #f6f8fb;
  display: flex; flex-direction: column; gap: 8px;
}
.arcring-chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px; line-height: 1.4;
  word-wrap: break-word;
  animation: arcringFadeIn .2s;
}
@keyframes arcringFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.arcring-chat-bubble.bot {
  align-self: flex-start;
  background: white;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.arcring-chat-bubble.user {
  align-self: flex-end;
  background: #0057b7;
  color: white;
  border-bottom-right-radius: 4px;
}
.arcring-chat-bubble b { font-weight: 600; }
.arcring-chat-bubble a { color: #0057b7; }
.arcring-chat-bubble.user a { color: #fff; text-decoration: underline; }

/* Quick replies */
.arcring-chat-quickreplies {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-self: flex-start;
  max-width: 90%;
  margin-top: 2px;
}
.arcring-chat-quickreplies button {
  background: white;
  border: 1.5px solid #0057b7;
  color: #0057b7;
  padding: 7px 12px;
  border-radius: 18px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.arcring-chat-quickreplies button:hover {
  background: #0057b7; color: white;
}

/* Typing indicator */
#arcring-chat-typing {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 16px 4px 20px; background: #f6f8fb;
}
#arcring-chat-typing span {
  width: 7px; height: 7px; background: #999;
  border-radius: 50%;
  animation: arcringTyping 1.2s infinite;
}
#arcring-chat-typing span:nth-child(2) { animation-delay: .15s; }
#arcring-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes arcringTyping {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Input */
#arcring-chat-input-row {
  padding: 10px; border-top: 1px solid #e5e7eb;
  display: flex; gap: 8px; background: white;
}
#arcring-chat-input {
  flex: 1; border: 1px solid #d1d5db; border-radius: 20px;
  padding: 10px 14px; font-size: 14px; outline: none;
  transition: border-color .15s;
}
#arcring-chat-input:focus { border-color: #0057b7; }
#arcring-chat-send {
  background: #0057b7; color: white; border: 0;
  width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#arcring-chat-send:hover { background: #003f7f; }

/* Footer */
#arcring-chat-footer {
  padding: 6px 12px; background: white;
  font-size: 11px; color: #6b7280; text-align: center;
  border-top: 1px solid #f3f4f6;
}
#arcring-chat-footer a { color: #0057b7; text-decoration: none; }
