/*
===============================================================================
  GENESIS AI v2.0 - HISTÓRICO DE CONVERSAS
===============================================================================
  Estilos isolados do histórico no menu lateral esquerdo.
  Classes com prefix .hist-* para não conflitar.
*/

/* Botão "+" (nova conversa) no título da seção */
.hist-new-btn{
  width: 22px;
  height: 22px;
  background: transparent;
  border: 1px solid rgba(0, 240, 255, .4);
  color: var(--pri);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  padding: 0;
  flex-shrink: 0;
}
.hist-new-btn:hover{
  background: rgba(0, 240, 255, .2);
  box-shadow: 0 0 10px var(--pri);
  transform: rotate(90deg);
}

/* Campo de busca */
.hist-search-wrap{
  position: relative;
  margin-bottom: 10px;
}
.hist-search-icon{
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: .6;
  pointer-events: none;
}
.hist-search{
  width: 100%;
  padding: 8px 10px 8px 30px;
  background: rgba(0, 240, 255, .05);
  border: 1px solid rgba(0, 240, 255, .25);
  color: var(--pri);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  letter-spacing: .5px;
  border-radius: 6px;
  outline: none;
  transition: .2s;
}
.hist-search:focus{
  border-color: var(--pri);
  background: rgba(0, 240, 255, .1);
  box-shadow: 0 0 10px rgba(0, 240, 255, .3);
}
.hist-search::placeholder{
  color: rgba(0, 240, 255, .4);
}

/* Lista de conversas - altura fixa para EXATAMENTE 5 itens visíveis,
   com scroll vertical interno para ver além do 5º item */
.hist-list{
  /* 5 itens × ~68px altura + 4px margin + 4px padding = ~360px */
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-bottom: 6px;
  scroll-behavior: smooth;
  /* Borda sutil para indicar container scrollável */
  border: 1px solid rgba(0, 240, 255, .12);
  border-radius: 6px;
  padding: 6px;
  background: rgba(0, 0, 0, .25);
}

/* Mensagem vazia */
.hist-empty{
  font-family: 'Orbitron';
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(0, 240, 255, .4);
  text-align: center;
  padding: 16px 8px;
  border: 1px dashed rgba(0, 240, 255, .2);
  border-radius: 6px;
}

/* Item de conversa - altura uniforme (~68px) para caberem 5 visíveis */
.hist-item{
  position: relative;
  padding: 8px 28px 8px 10px;
  margin-bottom: 4px;
  background: rgba(0, 240, 255, .04);
  border: 1px solid rgba(0, 240, 255, .15);
  border-radius: 6px;
  cursor: pointer;
  transition: .2s;
  overflow: hidden;
  min-height: 58px;
  box-sizing: border-box;
}
.hist-item:hover{
  background: rgba(0, 240, 255, .12);
  border-color: rgba(0, 240, 255, .4);
  transform: translateX(3px);
  box-shadow: 0 0 10px rgba(0, 240, 255, .2);
}
.hist-item.active{
  background: rgba(255, 0, 255, .1);
  border-color: rgba(255, 0, 255, .4);
  box-shadow: 0 0 10px rgba(255, 0, 255, .25);
}
.hist-title{
  font-size: 12px;
  color: #e0f7ff;
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-date{
  font-family: 'Orbitron';
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--pri);
  opacity: .75;
}
.hist-count{
  font-family: 'Orbitron';
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(0, 240, 255, .6);
  margin-left: 6px;
}

/* Botão apagar conversa individual (aparece no hover) */
.hist-del{
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  background: transparent;
  border: 1px solid rgba(255, 0, 85, .3);
  color: #f05;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: .2s;
}
.hist-item:hover .hist-del{
  opacity: 1;
}
.hist-del:hover{
  background: rgba(255, 0, 85, .25);
  box-shadow: 0 0 8px #f05;
}

/* Match highlight no texto pesquisado */
.hist-highlight{
  background: rgba(255, 0, 255, .3);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}

/* Scrollbar específica da lista */
.hist-list::-webkit-scrollbar{ width: 4px; }
.hist-list::-webkit-scrollbar-thumb{ background: rgba(0, 240, 255, .3); }

/* Responsivo: no drawer mobile, replicar com mesmas classes */
.drawer .hist-section{
  padding: 10px 6px;
}
