@import 'https://fonts.googleapis.com/css?family=Noto+Sans';

* {
  box-sizing: border-box;
}
body {
  font: 12px/16px 'Noto Sans', sans-serif;
}

.floating-chat {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: fixed;
  bottom: 110px;
  right: 110px;
  width: 40px;
  height: 40px;
  transform: translateY(70px);
  transition: all 250ms ease-out;
  border-radius: 50%;
  opacity: 0;
  background: -moz-linear-gradient(-45deg, #183850 0, #183850 25%, #192C46 50%, #22254C 75%, #22254C 100%);
  background: -webkit-linear-gradient(-45deg, #183850 0, #183850 25%, #192C46 50%, #22254C 75%, #22254C 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.floating-chat.enter:hover {
  box-shadow: 0 10px 20px rgba(0,0,0,.19), 0 6px 6px rgba(0,0,0,.23);
  opacity: 1;
}

.floating-chat.enter {
  transform: translateY(0);
  opacity: 0.6;
  box-shadow: 0px 1px 3px rgba(0,0,0,.12), 0px 1px 2px rgba(0,0,0,.14);
}

.floating-chat.expand {
  width: 250px;
  max-height: 400px;
  height: 400px;
  border-radius: 5px;
  cursor: auto;
  opacity: 1;
}

.floating-chat:focus {
  outline: 0;
  box-shadow: 0 0 3pt 2pt rgba(14,200,121,0.3);
}

.floating-chat button {
  background: transparent;
  border: 0;
  color: white;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
}

.floating-chat .chat {
  display: flex;
  flex-direction: column;
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  border-radius: 50%;
  transition: all 250ms ease-out;
  margin: auto;
  top: 0; left: 0; right: 0; bottom: 0;
}

.floating-chat .chat.enter {
  opacity: 1;
  border-radius: 0;
  margin: 10px;
  width: auto;
  height: auto;
}

.floating-chat .chat .header {
  flex-shrink: 0;
  padding-bottom: 10px;
  display: flex;
  background: transparent;
}

.floating-chat .chat .header .title {
  flex-grow: 1;
  flex-shrink: 1;
  padding: 0 5px;
}

.floating-chat .chat .header button {
  flex-shrink: 0;
}

.floating-chat .chat .messages {
  padding: 10px;
  margin: 0;
  list-style: none;
  overflow-y: scroll;
  overflow-x: hidden;
  flex-grow: 1;
  border-radius: 4px;
  background: transparent;
}

.floating-chat .chat .messages::-webkit-scrollbar { width: 5px; }
.floating-chat .chat .messages::-webkit-scrollbar-track {
  border-radius: 5px;
  background-color: rgba(25,147,147,0.1);
}
.floating-chat .chat .messages::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: rgba(25,147,147,0.2);
}

.floating-chat .chat .messages li {
  position: relative;
  clear: both;
  display: inline-block;
  padding: 14px;
  margin: 0 0 20px 0;
  font: 12px/16px 'Noto Sans', sans-serif;
  border-radius: 10px;
  background-color: rgba(25,147,147,0.2);
  word-wrap: break-word;
  max-width: 81%;
}

.floating-chat .chat .messages li:before {
  position: absolute;
  top: 0;
  width: 25px;
  height: 25px;
  border-radius: 25px;
  content: '';
  background-size: cover;
}

.floating-chat .chat .messages li:after {
  position: absolute;
  top: 10px;
  content: '';
  width: 0;
  height: 0;
  border-top: 10px solid rgba(25,147,147,0.2);
}

.floating-chat .chat .messages li.tedi {
  animation: show-chat-odd 0.15s 1 ease-in;
  -moz-animation: show-chat-odd 0.15s 1 ease-in;
  -webkit-animation: show-chat-odd 0.15s 1 ease-in;
  float: right;
  margin-right: 45px;
  color: #0AD5C1;
}

.floating-chat .chat .messages li.tedi:before {
  width: 45px;
  height: 45px;
  right: -50px;
  background-image: url(../img/tedi/cabeza.png);
}

.floating-chat .chat .messages li.tedi:after {
  border-right: 10px solid transparent;
  right: -10px;
}

.floating-chat .chat .messages li.self {
  animation: show-chat-even 0.15s 1 ease-in;
  -moz-animation: show-chat-even 0.15s 1 ease-in;
  -webkit-animation: show-chat-even 0.15s 1 ease-in;
  float: left;
  margin-left: 45px;
  color: #0EC879;
}

.floating-chat .chat .messages li.self:before {
  left: -45px;
  background-image: url(https://cdn-icons-png.flaticon.com/512/6017/6017051.png);
}

.floating-chat .chat .messages li.self:after {
  border-left: 10px solid transparent;
  left: -10px;
}

.floating-chat .chat .footer {
  flex-shrink: 0;
  display: flex;
  padding-top: 10px;
  max-height: 90px;
  background: transparent;
}

.floating-chat .chat .footer .text-box {
  border-radius: 3px;
  background: rgba(25,147,147,0.2);
  min-height: 100%;
  width: 100%;
  margin-right: 5px;
  color: #0EC879;
  overflow-y: auto;
  padding: 2px 5px;
}

.floating-chat .chat .footer .text-box::-webkit-scrollbar { width: 5px; }
.floating-chat .chat .footer .text-box::-webkit-scrollbar-track {
  border-radius: 5px;
  background-color: rgba(25,147,147,0.1);
}
.floating-chat .chat .footer .text-box::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: rgba(25,147,147,0.2);
}

/* ── Tooltip ─────────────────────────────────── */
.tooltip-container {
  --color: #395ea8;
  --border: rgba(255,0,0,0.25);
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 17px;
  border-radius: 10px;
}

.tooltip {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  border-radius: 15px;
  box-shadow:
    inset 5px 5px 5px rgba(0,0,0,.2),
    inset -5px -5px 15px rgba(255,255,255,.1),
    5px 5px 15px rgba(0,0,0,.3),
    -5px -5px 15px rgba(255,255,255,.1);
}

.profile {
  background: rgba(204,124,132,0.1);
  border-radius: 10px 15px;
  padding: 10px;
  border: 1px solid var(--border);
}

.tooltip-container:hover .tooltip {
  top: -150px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.icon {
  text-decoration: none;
  color: #fff;
  display: block;
  position: relative;
}

.layer {
  width: 70px;
  height: 70px;
  transition: transform 0.3s;
}

.icon:hover .layer { transform: rotate(-35deg) skew(20deg); }

.layer span {
  position: absolute;
  top: 0; left: 0;
  height: 100%; width: 100%;
  border: 2px solid #fff;
  border-radius: 50%;
  transition: all 0.3s;
  padding: 13px;
  background: #fff;
  box-shadow:
    inset 5px 5px 5px rgba(0,0,0,.2),
    inset -5px -5px 15px rgba(255,255,255,.1),
    5px 5px 15px rgba(0,0,0,.2),
    -5px -5px 10px rgba(255,255,255,.05);
}

.tooltip-container:hover .layer span {
  border-radius: 10px;
  background: var(--color);
}

.tooltip-container:hover .svg path { fill: #fff; }

.layer span, .text { color: var(--color); border-color: var(--color); }

.icon:hover.layer span { box-shadow: -1px 1px 3px var(--color); }

.icon .text {
  position: absolute;
  left: 50%;
  bottom: -5px;
  opacity: 0;
  font-weight: 700;
  transform: translateX(-50%);
  transition: bottom 0.3s ease, opacity 0.3s ease;
}

.icon:hover .text { bottom: -35px; opacity: 1; }

.icon:hover .layer span:nth-child(1) { opacity: 0.2; }
.icon:hover .layer span:nth-child(2) { opacity: 0.4; transform: translate(5px,-5px); }
.icon:hover .layer span:nth-child(3) { opacity: 0.6; transform: translate(10px,-10px); }
.icon:hover .layer span:nth-child(4) { opacity: 0.8; transform: translate(15px,-15px); }
.icon:hover .layer span:nth-child(5) { opacity: 1;   transform: translate(20px,-20px); }

.svg path { fill: var(--color); }

.user { display: flex; gap: 10px; }

.img {
  width: 50px; height: 50px;
  font-size: 20px; font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #395ea8;
}

.name { font-size: 17px; font-weight: 700; color: #ffffff; }

.details { display: flex; flex-direction: column; gap: 0; color: var(--color); }

.about { color: rgba(255,255,255,0.7); padding-top: 5px; }

/* ── Animaciones ─────────────────────────────── */
@keyframes show-chat-even {
  0%   { margin-left: -480px; }
  100% { margin-left: 0; }
}
@-moz-keyframes show-chat-even {
  0%   { margin-left: -480px; }
  100% { margin-left: 0; }
}
@-webkit-keyframes show-chat-even {
  0%   { margin-left: -480px; }
  100% { margin-left: 0; }
}
@keyframes show-chat-odd {
  0%   { margin-right: -480px; }
  100% { margin-right: 0; }
}
@-moz-keyframes show-chat-odd {
  0%   { margin-right: -480px; }
  100% { margin-right: 0; }
}
@-webkit-keyframes show-chat-odd {
  0%   { margin-right: -480px; }
  100% { margin-right: 0; }
}

@keyframes tedi-bounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: 0.5; }
  40%           { transform: translateY(-6px); opacity: 1;   }
}

/* ── Indicador de escritura ──────────────────── */
.typing-indicator {
  display: flex !important;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  min-height: 36px;
}

.typing-indicator span {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #999;
  animation: tedi-bounce 1s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.30s; }

/* ── Selector de tarjetas / resúmenes ────────── */
/* Usamos li.tedi-selector sin heredar los estilos de li.tedi */
.messages li.tedi-selector {
  float: none !important;
  clear: both !important;
  display: block !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
  margin: 0 0 20px 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Ocultar el avatar y la flecha para los selectores */
.messages li.tedi-selector:before,
.messages li.tedi-selector:after {
  display: none !important;
}

.tedi-opciones {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.btn-opcion {
  display: block;
  width: 100%;
  background: #fff;
  border: 1.5px solid #1a3a6b;
  color: #1a3a6b;
  border-radius: 8px;
  padding: 9px 13px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
  transition: background .15s, color .15s;
}

.btn-opcion:hover    { background: #1a3a6b; color: #fff; }
.btn-opcion:disabled { opacity: 0.5; cursor: default; background: #fff; color: #1a3a6b; }
