/* Sidebar con transición */
.sidebar {
  width: 260px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #f8f8f8;
  border-right: 1px solid #e0e0e0;
  padding: 1rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  z-index: 101;
  transition: transform 0.3s ease;
  padding-top: 0;
}

/* Oculto por desplazamiento */
.sidebar.oculto {
  transform: translateX(-100%);
}

/* Main se expande si no hay sidebar */
.main-content {
  margin-left: 260px;
  transition: margin-left 0.3s ease;
}

.main-content.expandido {
  margin-left: 0;
}

#btn-cerrar-sidebar {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  color: var(--color-texto);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#btn-abrir-sidebar {
  background: none;
  border: none;
  padding: 0;
  margin-right: 0.75rem;
  border-radius: 50%;
  color: var(--color-texto);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}


#btn-abrir-sidebar:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

#btn-cerrar-sidebar:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

#btn-abrir-sidebar.oculto {
  opacity: 0;
  pointer-events: none;
}

/* Hamburguesa y cerrar sidebar */

#menu-toggle {
  font-size: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;  /* opcional, para visual */
  padding: 0rem 0rem;
  height: auto;              /* o una altura fija como 60px si querés */
}


#btn-nuevo-chat {
  color: var(--color-principal);
  padding: 0.25rem 0.75rem;
  font-size: 2rem;
}

#btn-nuevo-chat:hover {
  color: var(--color-principal-b);
}

.chat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;

}

.chat-list li {
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 0.95rem;
  color: var(--color-texto);
  word-break: break-word;  /* Rompe palabras largas */
  white-space: normal;     /* Permite saltos de línea */
}

.chat-list li:hover {
  background-color: #eaeaea;
}

.chat-list li.selected {
  background-color: var(--color-principal);
  color: white;
  font-weight: bold;
}


.sidebar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}


.chat-list .chat-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.chat-list .chat-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.btn-borrar-chat {
  display: none;
  background: none;
  border: none;
  color: #F55135;
  font-size: 1rem;
  cursor: pointer;
}

.chat-list .chat-item:hover .btn-borrar-chat {
  display: inline;
}

.message.bot details summary {
  background: #f1f1f1;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.message.bot details summary:hover {
  background: #e0e0e0;
}
