/* HISTÓRICO DE CONVERSAS */
.histhory-sidebar {
  position: fixed;
  right: -400px;
  top: 0;
  width: 350px;
  height: 100%;
  background: var(--secondary-color);
  box-shadow: -5px 0 20px rgba(0,0,0,0.5);
  transition: 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.history-header {
  background-image: url('../images/carta.png');
  background-size: cover;
  background-position: center;
  backgrounyd-repetat: no-repeat;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.history-item {
  background: var(--secondary-hover-color);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-item:hover {
  background: #a8c;
}

.history-title {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  margin-left: 8px;
}

.delete-history {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
}

.closehistory {
  border: none;
  color: var(--text-color);
}

/* ======== BARRA DE PESQUISA ===========*/
.search-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--secondary-hover-color);
  border-radius: 12px;
  padding: 6px 8px;
  margign-right: 8px;
}

.search-wrapper input {
  flex: 1;
  background: var(--secondary-color);
  border: none;
  outline: none;
  color: var(--text-color);
  font-size: 14px;
  padding: 6px;
  border-radius: 8px;
}

.search-wrapper input::placeholder {
  color: var(--text-color);
}

.search-wrapper .search-icon {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding-left: 4px;
  display: flex;
  align-items: center;
}


.history-content {
  display: flex;
  flex-direction: column;
  margin-left: 8px;
  flex: 1;
}

.history-time {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 2px;
  margin-left: 10px;
}

/* NOVO HISTÓRICO */
.history-sidebar {
  position: fixed;
  left: -320px;
  top: 0;
  width: 300px;
  height: 100%;
  background: var(--secondary-color);
  display: flex;
  flex-direction: column;
  transition: 0.3s;
  z-index: 9999;
}

.history-sidebar.active {
  left: 0;
}

/* ===== TOPO ===== */
.history-top {
  padding: 15px;
}

/* Pesquisa */
.search-wrapper {
  border: 3px solid #1d7efd;
  display: flex;
  align-items: center;
  background: var(--secondary-hover-color);
  padding: 8px 12px;
  border-radius: 12px;
  margin-bottom: 15px;
}

.search-wrapper input {
  background: transparent;
  border: none;
  outline: none;
  color: #1d7efd;
  margin-left: 8px;
  width: 100%;
}

/* ===== MENU ===== */
.history-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
  color: var(--text-color);
  font-size: 15px;
}

.menu-item:hover {
  background: #1d7efd;
  color: white;
}

/* ===== LISTA ===== */
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

/* ===== USER FOOTER ===== */
.history-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: #1d7efd;
}

.history-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.history-user span {
  font-size: 14px;
  color: #fff;
}

.histgory-overlay {
  position: fixed;
  inset: 0;
  background: var(--secondary-color);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 9998;
}

.hisvtory-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.history-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0; /* 👈 ESSA LINHA RESOLVE */
}

.history-title {
  font-size: 14px;
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* EMPURAR */
/* Conteúdo principal */
.main-content {
  transition: transform 0.3s ease;
}

/* Quando sidebar estiver ativo */
.main-content.shifted {
  transform: translateX(300px); /* mesma largura do sidebar */
}

/* Overlay escuro */
.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 9998;
}

.history-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.history-sidebar.active {
  box-shadow: 5px 0 30px rgba(0,0,0,0.5);
}

/* Badge Premium no menu */
.premium-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.premium-badge {
  background: linear-gradient(135deg, gold, orange);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* Badge new no menu */
.novo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.novo-badge {
  background: linear-gradient(to right, #1d7efd, #8f6fff);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  box-gshadow: 0 0 8px rgba(255, 215, 0, 0.6);
}
