/* RESET GERAL */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f9f9f9;
}

/* Ocultar elementos */
.hidden {
  display: none !important;
}

/* Botão flutuante */
#assistantToggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: background 0.3s;
}
#assistantToggle:hover {
  background: #333;
}

/* Popover */
.popover {
  position: fixed;
  box-sizing: border-box;
  bottom: 80px;
  right: 20px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  width: 450px;
  height: 70vh;
}

/* Modo expandido */
.popover.expanded {
  width: 60vw;
  height: 90vh;
}

/* Cabeçalho */
.popover-header {
  background: #eb722d;
  color: #fff;
  padding: 10px 14px;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Botão expandir */
#toggleSizeBtn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* Terminal */
.terminal {
  display: flex;
  background-color: #f8f8f8;
  flex-direction: column;
  flex: 1;
  height: 100%;
  box-sizing: border-box;
  padding: 10px;
  gap: 6px;
  overflow: hidden;
}

.ticket-sidebar {
  width: 240px;
  padding: 12px;
  background: #fdfdfd54; /* mais suave que #f8f8f8 */
  box-shadow: inset -1px 0 0 #ddd; /* substitui a borda com sombra sutil */
}



.output {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* Área de entrada */
.chat-input-area {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

/* Campo de texto */
.chat-input-area textarea,
#promptInput {
  width: 100%;
  height: 56px;
  max-height: 56px;
  resize: none;
  overflow-y: auto;
  font-size: 14px;
  padding: 8px 10px;
  border: none;
  outline: none;
  background: #fff;
  color: #333;
  border-radius: 10px;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

/* Linha de botões abaixo do textarea */
.input-tools-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

/* Botões da esquerda */
.input-tools-left {
  display: flex;
  gap: 6px;
}

/* Botões da direita */
.input-tools-right {
  display: flex;
  gap: 6px;
}

/* Botão textual simples */
.tool-button {
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.2s;
  border-radius: 6px;
}
.tool-button:hover {
  background: #f0f0f0;
  color: #000;
}

/* Botão circular */
.icon-button {
  background: #f2f2f2;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}
.icon-button svg {
  width: 18px;
  height: 18px;
}

/* Botão enviar */
.icon-button.send {
  background: #000;
}
.icon-button.send svg {
  fill: #fff;
}

.tools-wrapper {
	position: relative;
}

.tools-popup {
	position: absolute;
	bottom: 120%;
	left: 0; /* <-- MUDE de right: 0 para left: 0 */
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	padding: 8px;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 200px;
	white-space: nowrap;
}


.tools-popup.hidden {
	display: none;
}



.tools-popup button {
  width: 100%;
  font-size: 14px;
  padding: 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.tools-popup.hidden {
  display: none;
}

/* Botão limpar histórico */
#clearStorageBtn {
  background-color: #94eb9b;
  color: rgb(51, 51, 51);
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
#clearStorageBtn:hover {
  background-color: #7ac480;
}

/* #loginBtn {
  background-color: #94eb9b;
  color: rgb(51, 51, 51);
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
#loginBtn:hover {
  background-color: #7ac480;
} */

/* Estilo das mensagens */
.message {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  font-family: Arial, sans-serif;
}

.message .meta {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

.message.user {
  background: #f2f2f2;
  border-left: 4px solid #888;
}

.message.assistant {
  background: #fff;
  border-left: 4px solid #eb722d;
}

.message.agent {
  background: #fff;
  border-left: 4px solid #eb722d;
}

.message.error {
  color: #d32f2f;
  font-weight: bold;
}


.message .text {
	white-space: pre-wrap; /* respeita quebras de linha e espaços */
	word-wrap: break-word;
}


.icon-button.listening {
	background-color: #eb722d;
	color: white;
	animation: pulse 1.2s infinite;
}

@keyframes pulse {
	0% { box-shadow: 0 0 0 0 rgba(235, 114, 45, 0.7); }
	70% { box-shadow: 0 0 0 10px rgba(235, 114, 45, 0); }
	100% { box-shadow: 0 0 0 0 rgba(235, 114, 45, 0); }
}


.icon-button.mic.listening {
	background-color: #ff5252;
	color: #fff;
	box-shadow: 0 0 8px #ff5252aa;
}


/* Responsivo para telas pequenas (ex: celular) */
@media (max-width: 600px) {
  .popover {
    width: 90vw;
    height: 90vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
    border: none;
     z-index: 1000; /* abaixo do toggle */
  }

  .popover.expanded {
    width: 90vw;
    height: 90vh;
  }

#assistantToggle {
    position: fixed;
    z-index: 1100; /* maior que .popover */
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .chat-input-area textarea,
  #promptInput {
    font-size: 16px;
  }

  .message {
    font-size: 15px;
  }

  .message .meta {
    font-size: 11px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .icon-button svg {
    width: 20px;
    height: 20px;
  }
}


#closePopoverBtn {
  display: none;
  background: transparent;
  border: none;
  font-size: 18px;
  color: #fff;
  margin-left: 8px;
  cursor: pointer;
}

@media (max-width: 600px) {
  #closePopoverBtn {
    display: inline;
  }

  #toggleSizeBtn {
    display: none;
  }
}

@media (max-width: 600px) {
  body.popover-open #assistantToggle {
    display: none !important;
  }
}



/* Novos css a aprtir de 10.07.2025 */

.image-preview {
	display: flex;
	align-items: center;
	margin-top: 6px;
	gap: 6px;
	flex-wrap: wrap;
}

.image-thumb {
	position: relative;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
}

.file-thumb-preview {
	width: 44px;
	height: 44px;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2px;
	box-sizing: border-box;
}

.image-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #ccc;
}

.image-thumb button {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 18px;
	height: 18px;
	font-size: 12px;
	line-height: 16px;
	background: #111;
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.loading-indicator {
	font-style: italic;
	color: #888;
	margin-top: 8px;
	animation: pulse 1s infinite;
}

@keyframes pulse {
	0%   { opacity: 0.3; }
	50%  { opacity: 1; }
	100% { opacity: 0.3; }
}

.image-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.chat-thumbnail {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 6px;
	cursor: pointer;
	transition: transform 0.2s ease;
}
.chat-thumbnail:hover {
	transform: scale(1.1);
}

.image-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.modal-image {
	max-width: 90%;
	max-height: 90%;
	border-radius: 10px;
	box-shadow: 0 0 10px #000;
}

.close-image-modal {
	position: absolute;
	top: 20px;
	right: 30px;
	background: #fff;
	border: none;
	font-size: 24px;
	padding: 4px 12px;
	cursor: pointer;
	border-radius: 4px;
}

.file-label {
	display: inline-block;
	font-size: 12px;
	padding: 6px;
	background: #f4f4f4;
	border-radius: 4px;
	border: 1px solid #ccc;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
	max-width: 120px;
}


.file-list {
	list-style: none;
	padding: 0;
	margin: 6px 0 0 0;
}

.file-list li {
	font-size: 13px;
	background: #f1f1f1;
	display: inline-block;
	margin: 4px;
	padding: 4px 8px;
	border-radius: 6px;
	border: 1px solid #ccc;
}



.file-icon-image {
	width: 24px;
	height: 24px;
	object-fit: contain;
}


.file-name {
	font-size: 9px;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 36px;
}




.message-content {
	display: flex;
	flex-direction: column;
	align-items: flex-start; /* <<< Isso força tudo à esquerda */
	gap: 6px;
}


.message-content .text {
	flex: 1 1 auto;
}
.message-content .image-preview {
	flex-shrink: 0;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}


.message-content {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.prompt-text {
	max-width: calc(100% - 100px); /* espaço pro anexo */
	word-break: break-word;
	white-space: pre-wrap;
	flex: 1;
}

.attachment-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.file-line {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #f9f9f9;
	border: 1px solid #ccc;
	border-radius: 8px;
	padding: 6px 10px;
	max-width: 260px;
}

.file-line-name {
	font-size: 13px;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 180px;
}


.attachment-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}


.ticket-item {
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.ticket-item.selected {
  background: #ffc18f;
  border: 1px solid #ebebeb;
}


.ticket-item:hover {
	background: #e9e9e9;
}

.ticket-date {
	font-size: 12px;
	color: #888;
}

.ticket-title {
	font-weight: bold;
	font-size: 13px;
	margin-top: 4px;
}


.text a {
  display: inline-block;
  margin-top: 6px;
  color: #007bff;
  text-decoration: none;
}

.text a:hover {
  text-decoration: underline;
}
