/* CAMPUS GT Chatbot Widget CSS v2 - assets/css/chatbot.css */

/* ── Contenedor principal ─────────────────────────────────────────── */
#gt-chatbot {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Botón flotante ────────────────────────────────────────────────── */
#gt-toggle-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #EC4899, #3B82F6);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 4px 24px rgba(236,72,153,.45), 0 2px 8px rgba(59,130,246,.3);
  transition: transform .2s, box-shadow .2s;
  position: relative; outline: none;
}
#gt-toggle-btn:hover { transform: scale(1.1); box-shadow: 0 6px 32px rgba(236,72,153,.6); }
#gt-toggle-btn:active { transform: scale(.94); }

/* Badge */
#gt-badge {
  position: absolute; top: -2px; right: -2px;
  width: 20px; height: 20px;
  background: #EF4444; color: white; border-radius: 50%;
  font-size: 11px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  border: 2px solid white;
  animation: gt-pulse 2.2s infinite;
}
@keyframes gt-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.25)} }

/* ── Panel ─────────────────────────────────────────────────────────── */
#gt-panel {
  position: absolute; bottom: 68px; right: 0;
  width: 360px; max-height: 540px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(.86) translateY(18px);
  transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .22s ease;
}
#gt-panel.gt-open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }
[data-theme="dark"] #gt-panel { background: #1e2128; }

/* ── Header ────────────────────────────────────────────────────────── */
.gt-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #EC4899, #3B82F6);
  flex-shrink: 0;
}
.gt-header-info { display: flex; align-items: center; gap: 10px; }
.gt-bot-ico {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.gt-bot-name { color: white; font-weight: 700; font-size: 14px; }
.gt-bot-sub {
  color: rgba(255,255,255,.85); font-size: 11.5px;
  display: flex; align-items: center; gap: 5px; margin-top: 2px;
}
.gt-dot {
  width: 6px; height: 6px; background: #4ade80; border-radius: 50%;
  animation: gt-blink 2s infinite;
}
@keyframes gt-blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.gt-close-btn {
  background: rgba(255,255,255,.15); border: none; color: white;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.gt-close-btn:hover { background: rgba(255,255,255,.3); }

/* ── Mensajes ──────────────────────────────────────────────────────── */
.gt-msgs {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: #e5e7eb transparent;
}
.gt-msgs::-webkit-scrollbar { width: 4px; }
.gt-msgs::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 2px; }
[data-theme="dark"] .gt-msgs::-webkit-scrollbar-thumb { background: #374151; }

/* Animación entrada */
.gt-msg { opacity: 0; transform: translateY(8px); transition: opacity .22s, transform .22s; }
.gt-msg.gt-in { opacity: 1; transform: translateY(0); }
.gt-msg-user { display: flex; justify-content: flex-end; }
.gt-msg-bot  { display: flex; flex-direction: column; align-items: flex-start; }

/* Burbuja */
.gt-bub {
  max-width: 88%; padding: 10px 14px; border-radius: 16px;
  font-size: 13px; line-height: 1.6; word-break: break-word;
}
.gt-msg-user .gt-bub {
  background: linear-gradient(135deg, #EC4899, #3B82F6);
  color: white; border-bottom-right-radius: 4px;
}
.gt-msg-bot .gt-bub {
  background: #f3f4f6; color: #111827; border-bottom-left-radius: 4px;
}
[data-theme="dark"] .gt-msg-bot .gt-bub { background: #2d3748; color: #e2e8f0; }
.gt-msg-bot .gt-bub b { color: #EC4899; font-weight: 600; }
[data-theme="dark"] .gt-msg-bot .gt-bub b { color: #f9a8d4; }

/* Typing */
.gt-typing {
  display: flex; align-items: center; gap: 5px;
  padding: 14px 16px !important; width: auto !important;
}
.gt-typing span {
  width: 7px; height: 7px; background: #9ca3af; border-radius: 50%;
  animation: gt-bounce 1.2s infinite ease-in-out;
}
.gt-typing span:nth-child(2) { animation-delay: .2s; }
.gt-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes gt-bounce {
  0%,80%,100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-7px); opacity: 1; }
}

/* ── Botones de opciones ───────────────────────────────────────────── */
.gt-opts {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 8px; width: 100%; max-width: 320px;
}
.gt-opt-btn {
  background: white;
  border: 1.5px solid #e5e7eb;
  color: #374151;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  line-height: 1.4;
}
.gt-opt-btn:hover:not(:disabled) {
  border-color: #EC4899;
  color: #be185d;
  background: #fdf2f8;
  transform: translateX(3px);
}
[data-theme="dark"] .gt-opt-btn {
  background: #2d3748; border-color: #4a5568; color: #e2e8f0;
}
[data-theme="dark"] .gt-opt-btn:hover:not(:disabled) {
  border-color: #EC4899; color: #f9a8d4; background: #3d2535;
}
/* Estado usado/seleccionado */
.gt-opt-btn.gt-opt-used {
  opacity: .45; cursor: default; transform: none;
}
.gt-opt-btn.gt-opt-selected {
  opacity: .7; border-color: #EC4899; color: #be185d;
  background: #fdf2f8;
}
[data-theme="dark"] .gt-opt-btn.gt-opt-selected {
  border-color: #EC4899; color: #f9a8d4; background: #3d2535;
}

/* ── Input row ─────────────────────────────────────────────────────── */
.gt-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #f3f4f6;
  flex-shrink: 0; background: white;
}
[data-theme="dark"] .gt-input-row { background: #1e2128; border-top-color: #2d3748; }
#gt-input {
  flex: 1; border: 1.5px solid #e5e7eb; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; font-family: inherit;
  outline: none; background: #f9fafb; color: #111827;
  transition: border-color .15s, background .15s;
}
#gt-input:focus { border-color: #EC4899; background: white; }
#gt-input::placeholder { color: #9ca3af; }
[data-theme="dark"] #gt-input {
  background: #2d3748; border-color: #4a5568; color: #e2e8f0;
}
[data-theme="dark"] #gt-input:focus { border-color: #EC4899; background: #374151; }
#gt-send {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #EC4899, #3B82F6);
  border: none; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity .15s, transform .15s;
}
#gt-send:hover { opacity: .88; transform: scale(1.07); }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #gt-chatbot { bottom: 14px; right: 14px; }
  #gt-panel { width: calc(100vw - 28px); right: 0; bottom: 66px; max-height: 74vh; }
}