/**
 * Sinergéticos LATAM — Chat Widget Styles
 * Archivo: /public_html/chat.css
 */

/* ── FAB ──────────────────────────────────────────────────────────────────── */
#chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #c8231e;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(200,35,30,0.35);
  z-index: 9998;
  transition: transform 0.2s, opacity 0.2s;
}
#chat-fab:hover { transform: scale(1.08); }
#chat-fab.chat-fab--hidden { opacity: 0; pointer-events: none; }

/* ── Panel ───────────────────────────────────────────────────────────────── */
#chat-panel {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: 600px;
  border-radius: 14px;
  background: #fafaf8;
  border: 1px solid #d0d0cc;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
#chat-panel.chat-panel--open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
#chat-header {
  background: #0f1410;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#chat-header-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #c8231e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  font-family: Georgia, serif;
}
#chat-header-info { flex: 1; }
#chat-header-name {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: Georgia, serif;
}
#chat-header-status {
  color: #9fa89b;
  font-size: 11px;
  margin-top: 1px;
  font-family: Georgia, serif;
}
#chat-close {
  background: none;
  border: none;
  color: #9fa89b;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}
#chat-close:hover { color: #fff; }

/* ── Body ────────────────────────────────────────────────────────────────── */
#chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafaf8;
  scroll-behavior: smooth;
}

/* ── Burbujas ────────────────────────────────────────────────────────────── */
.chat-row {
  display: flex;
  gap: 7px;
  align-items: flex-end;
}
.chat-row--user { flex-direction: row-reverse; }

.chat-av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0f1410;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #fff;
  font-weight: bold;
  letter-spacing: -0.3px;
  font-family: Georgia, serif;
}

.chat-bbl {
  max-width: 84%;
  padding: 9px 12px;
  line-height: 1.5;
  font-size: 13px;
  font-family: Georgia, serif;
}
.chat-bbl--bot {
  background: #fff;
  border: 0.5px solid #d0d0cc;
  border-radius: 10px 10px 10px 3px;
  color: #1a1a18;
}
.chat-bbl--user {
  background: #0d6e4a;
  color: #fff;
  border-radius: 10px 10px 3px 10px;
}
.chat-bbl--sys {
  background: rgba(196,136,42,0.12);
  border: 0.5px solid rgba(196,136,42,0.3);
  border-radius: 8px;
  font-style: italic;
  color: #7a5a10;
  font-size: 12px;
  text-align: center;
  padding: 7px 12px;
  max-width: 100%;
  font-family: Georgia, serif;
}

/* ── Typing ──────────────────────────────────────────────────────────────── */
.chat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 2px;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d0d0cc;
  display: inline-block;
  animation: chatBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

/* ── Botones de opciones ─────────────────────────────────────────────────── */
.chat-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 0 2px 31px;
}
.chat-btn-op {
  background: #fff;
  border: 0.5px solid #0d6e4a;
  color: #0d6e4a;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  font-family: Georgia, serif;
  transition: background 0.15s, color 0.15s;
}
.chat-btn-op:hover  { background: #0d6e4a; color: #fff; }
.chat-btn-op:disabled { opacity: 0.38; cursor: default; }

/* ── Redes ───────────────────────────────────────────────────────────────── */
.chat-redes-wrap { padding: 0 0 4px 31px; }
.chat-redes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 5px;
}
.chat-red-link {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f5f5f2;
  border: 0.5px solid #d0d0cc;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12px;
  text-decoration: none;
  color: #1a1a18;
  font-family: Georgia, serif;
  transition: background 0.15s;
}
.chat-red-link:hover { background: #ebebea; }
.chat-red-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  flex-shrink: 0;
}

/* ── Input inline ────────────────────────────────────────────────────────── */
.chat-inp-inline { padding: 0 0 4px 31px; }
.chat-inp-row {
  display: flex;
  gap: 5px;
  margin-bottom: 4px;
}
.chat-inp-row input {
  flex: 1;
  border: 0.5px solid #d0d0cc;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  font-family: Georgia, serif;
  color: #1a1a18;
  background: #fafaf8;
  outline: none;
}
.chat-inp-row input:focus  { border-color: #0d6e4a; }
.chat-inp-row button {
  background: #0d6e4a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: Georgia, serif;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-inp-row button:hover { background: #0a5a3d; }
.chat-inp-hint {
  font-size: 11px;
  color: #aaa;
  font-family: Georgia, serif;
  margin: 0;
}

/* ── Progreso encuesta ───────────────────────────────────────────────────── */
.chat-prog-wrap {
  padding: 2px 0 6px 31px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-prog-bar {
  flex: 1;
  height: 3px;
  background: #d0d0cc;
  border-radius: 2px;
  overflow: hidden;
}
.chat-prog-fill {
  height: 100%;
  background: #c4882a;
  border-radius: 2px;
  transition: width 0.3s;
}
.chat-prog-txt {
  font-size: 11px;
  color: #aaa;
  flex-shrink: 0;
  font-family: Georgia, serif;
}

/* ── Tags inline ─────────────────────────────────────────────────────────── */
.chat-tag {
  display: inline-block;
  background: rgba(13,110,74,0.1);
  color: #0d6e4a;
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 6px;
}
.chat-tag-do {
  display: inline-block;
  background: rgba(196,136,42,0.12);
  color: #7a5a10;
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 6px;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 14px 14px 0 0;
  }
  #chat-fab {
    bottom: 20px;
    right: 20px;
  }
}
