/* Sunsol Travel Chatbot v1.1 */
:root {
  --sc-primary:   #e07b00;
  --sc-secondary: #fff8f0;
  --sc-white:     #ffffff;
  --sc-text:      #2d2d2d;
  --sc-radius:    18px;
  --sc-shadow:    0 8px 40px rgba(0,0,0,.16);
}

/* ── Botón flotante ───────────────────────────────── */
#sc-toggle-btn {
  position: fixed; bottom: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--sc-primary);
  color: var(--sc-white);
  border: none; cursor: pointer;
  box-shadow: var(--sc-shadow);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
  transition: transform .2s, box-shadow .2s;
}
#sc-toggle-btn:hover { transform: scale(1.08); }
#sc-toggle-btn svg   { width: 26px; height: 26px; }

/* ── Posiciones ───────────────────────────────────── */
.sc-pos-bottom-right #sc-toggle-btn,
.sc-pos-bottom-right #sc-window { right: 24px; }
.sc-pos-bottom-left  #sc-toggle-btn,
.sc-pos-bottom-left  #sc-window  { left: 24px; }

/* ── Ventana ──────────────────────────────────────── */
#sc-window {
  position: fixed; bottom: 96px;
  width: 360px; max-height: 560px;
  background: var(--sc-white);
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow);
  display: flex; flex-direction: column;
  z-index: 9999; overflow: hidden;
  transform: scale(.92) translateY(12px);
  opacity: 0; pointer-events: none;
  transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .22s;
}
#sc-window.sc-open {
  transform: scale(1) translateY(0);
  opacity: 1; pointer-events: all;
}

/* ── Header ───────────────────────────────────────── */
#sc-header {
  background: var(--sc-primary);
  color: var(--sc-white);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
#sc-header-title { display: flex; align-items: center; gap: 10px; }
.sc-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sc-bot-name   { font-weight: 700; font-size: 15px; }
.sc-bot-status { font-size: 11px; opacity: .85; }
#sc-close-btn  {
  background: none; border: none; color: var(--sc-white);
  cursor: pointer; font-size: 18px; padding: 4px; opacity: .8;
  transition: opacity .15s;
}
#sc-close-btn:hover { opacity: 1; }

/* ── Body / contenedor central ───────────────────── */
#sc-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ── Formulario de lead ───────────────────────────── */
#sc-lead-form { flex: 1; overflow-y: auto; }
.sc-lead-wrap {
  padding: 20px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.sc-lead-title { font-size: 17px; font-weight: 700; color: var(--sc-text); margin: 0; }
.sc-lead-sub   { font-size: 13px; color: #666; margin: 0; }
.sc-field      { display: flex; flex-direction: column; gap: 4px; }
.sc-field label {
  font-size: 12px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .5px;
}
.sc-optional   { font-weight: 400; color: #999; text-transform: none; }
.sc-field input {
  border: 1.5px solid #e0e0e0; border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .15s;
}
.sc-field input:focus { border-color: var(--sc-primary); }
.sc-lead-error { color: #c62828; font-size: 13px; margin: 0; }
.sc-lead-btn {
  background: var(--sc-primary); color: var(--sc-white);
  border: none; border-radius: 10px;
  padding: 11px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
  margin-top: 4px;
}
.sc-lead-btn:hover   { opacity: .9; }
.sc-lead-btn:disabled { opacity: .6; cursor: default; }

/* ── Chat area ───────────────────────────────────── */
#sc-chat-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

#sc-messages {
  flex: 1; overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f7f8fa;
}
#sc-messages::-webkit-scrollbar { width: 4px; }
#sc-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.sc-msg {
  max-width: 88%; padding: 10px 13px;
  border-radius: 14px; font-size: 14px; line-height: 1.55;
  word-break: break-word;
  animation: scIn .18s ease;
}
@keyframes scIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }

.sc-msg-bot {
  background: var(--sc-white);
  color: var(--sc-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.sc-msg-user {
  background: var(--sc-primary);
  color: var(--sc-white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.sc-msg-error {
  background: #fff3cd; color: #7d5a00;
  border: 1px solid #ffe082;
  align-self: flex-start; font-size: 13px;
}

/* Typing */
.sc-typing {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 13px; background: var(--sc-white);
  border-radius: 14px; border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.sc-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #bbb; display: inline-block;
  animation: scBounce 1.2s infinite;
}
.sc-typing span:nth-child(2) { animation-delay: .2s; }
.sc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes scBounce {
  0%,60%,100% { transform:translateY(0); }
  30% { transform:translateY(-6px); }
}

/* Input */
#sc-input-area {
  display: flex; padding: 10px 12px; gap: 8px;
  border-top: 1px solid #eee; background: var(--sc-white);
}
#sc-input {
  flex: 1; border: 1.5px solid #e0e0e0; border-radius: 20px;
  padding: 8px 13px; font-size: 14px; font-family: inherit;
  outline: none; resize: none; max-height: 80px;
  transition: border-color .15s;
}
#sc-input:focus { border-color: var(--sc-primary); }
#sc-send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--sc-primary); color: var(--sc-white);
  border: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .1s;
}
#sc-send-btn:hover   { opacity: .88; }
#sc-send-btn:active  { transform: scale(.93); }
#sc-send-btn:disabled { opacity: .45; cursor: default; }
#sc-send-btn svg { width: 17px; height: 17px; }

/* Footer */
#sc-footer {
  text-align: center; font-size: 11px; color: #bbb;
  padding: 4px 0 7px; background: var(--sc-white);
}

/* Responsive */
@media (max-width: 420px) {
  #sc-window { width: calc(100vw - 20px); }
  .sc-pos-bottom-right #sc-window { right: 10px; }
  .sc-pos-bottom-left  #sc-window { left: 10px; }
}
