/*
* ai-chat-bot-home-page.css
* AI Chat Bot
* Arquivo inclui a home do sistema paginas principais 
******************************************************************************/	
	.thinking-shimmer {
	  font-family: sans-serif;
	  font-weight: bold;
	  color: #888; 
	  
	  background: linear-gradient(
		90deg, 
		#888 0%, 
		#888 40%, 
		#ffffff 50%, 
		#888 60%, 
		#888 100%
	  );
	  
	  background-size: 200% auto;
	  
	  -webkit-background-clip: text;
	  background-clip: text;
	  -webkit-text-fill-color: transparent;
	  
	  animation: shine 1.8s linear infinite;
	}

	@keyframes shine {
	  to {
		background-position: -200% center;
	  }
	}
	
	#f5h-chat-box::-webkit-scrollbar {
		width: 10px;
	}

	#f5h-chat-box::-webkit-scrollbar-track {
		background: #1E1E1E;
		border-radius: 2px;
	}

	#f5h-chat-box::-webkit-scrollbar-thumb {
		background-color: #E9ECEF;
		border-radius: 2px;
		border: 3px solid #1E1E1E;
	}

	/* Bolha Flutuante */
	#f5h-chat-bubble {
		position: fixed;
		bottom: 20px;
		right: 20px;
		width: 60px;
		height: 60px;
		background-image: linear-gradient(-225deg, #FF057C 0%, #8D0B93 50%, #321575 100%);
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
		z-index: 999;
		transition: transform 0.2s, opacity 0.3s;
	}

	#f5h-chat-bubble:hover {
		transform: scale(1.1);
	}

	#f5h-chat-bubble img {
		width: 42px;
		height: 42px;
		fill: white;
	}

	body.f5h-expanded #f5h-chat-bubble {
		opacity: 0;
		pointer-events: none;
	}

	/* Container Principal */
	.f5h-chat-container {
		position: fixed;
		bottom: 90px;
		right: 20px;
		width: 380px;
		height: 600px;
		max-height: 80vh;
		background: #2b2b2b;
		box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
		display: flex;
		flex-direction: column;
		border-radius: 12px;
		overflow: hidden;
		z-index: 998;
		opacity: 0;
		visibility: hidden;
		transform: translateY(20px);
		transition: all 0.3s ease;
	}

	.f5h-chat-container.open {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	/* Modo Expandido */
	body.f5h-expanded .f5h-chat-container {
		top: 50%;
		left: 50%;
		bottom: auto;
		right: auto;
		transform: translate(-50%, -46.5%);
		width: 90vw;
		max-width: 960px;
		height: 88vh;
		max-height: 88vh;
		border-radius: 16px;
		z-index: 1001;
	}

	#f5h-expand-overlay {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.65);
		z-index: 1000;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s;
	}

	body.f5h-expanded #f5h-expand-overlay {
		opacity: 1;
		visibility: visible;
	}

	/* Header */
	.f5h-chat-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: #76b900;
		color: white;
		padding: 10px 12px;
		font-weight: bold;
		font-size: 0.95em;
		flex-shrink: 0;
	}

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

	.f5h-header-left img {
		width: 30px;
	}

	.f5h-header-actions {
		display: flex;
		gap: 4px;
		align-items: center;
	}

	.f5h-header-btn {
		background: rgba(255, 255, 255, 0.2);
		border: none;
		color: white;
		padding: 7px;
		border-radius: 50%;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: background 0.2s;
	}

	.f5h-header-btn:hover {
		background: rgba(255, 255, 255, 0.4);
	}

	/* Select de modelo */
	#f5h-model-select-wrap {
		display: none;
	}

	#f5h-model-select-wrap.visible {
		display: flex;
		align-items: center;
		gap: 5px;
	}

	#f5h-model-select {
		background: rgba(255, 255, 255, 0.15);
		border: 1px solid rgba(255, 255, 255, 0.3);
		color: white;
		border-radius: 8px;
		padding: 6px 6px;
		font-size: 0.75em;
		cursor: pointer;
		outline: none;
		max-width: 150px;
	}

	#f5h-model-select option {
		background: #333;
		color: white;
	}

	/* Chat Box */
	#f5h-chat-box {
		flex: 1;
		padding: 14px;
		overflow-y: auto;
		display: flex;
		flex-direction: column;
		gap: 14px;
		background: #1e1e1e;
	}

	/* Mensagens */
	.f5h-msg-row {
		display: flex;
		align-items: flex-end;
		gap: 8px;
		max-width: 92%;
	}

	.f5h-msg-row.user-row {
		align-self: flex-end;
		flex-direction: row-reverse;
	}

	.f5h-msg-row.bot-row {
		align-self: flex-start;
	}

	.f5h-avatar {
		width: 32px;
		height: 32px;
		border-radius: 50%;
		object-fit: cover;
		flex-shrink: 0;
	}

	.f5h-msg-wrapper {
		display: flex;
		flex-direction: column;
		min-width: 0;
	}

	.user-row .f5h-msg-wrapper {
		align-items: flex-end;
	}

	.bot-row .f5h-msg-wrapper {
		align-items: flex-start;
	}

	.f5h-msg-bubble {
		padding: 9px 13px;
		border-radius: 16px;
		word-wrap: break-word;
		line-height: 1.45;
		font-size: 0.88em;
		max-width: 100%;
	}

	.f5h-msg-user {
		background: #28c76f14;
		color: white;
		border-bottom-right-radius: 4px;
		white-space: pre-wrap;
	}

	.f5h-msg-bot {
		background: #2d2d2d;
		color: #f0f0f0;
		border-bottom-left-radius: 4px;
	}

	/* Animação de Typing (Bolinhas) */
	.typing-dots {
		display: flex;
		align-items: center;
		gap: 4px;
		padding: 4px 0;
	}

	.typing-dots span {
		display: inline-block;
		width: 8px;
		height: 8px;
		background: #76b900;
		border-radius: 50%;
		animation: bounce 1.2s infinite;
	}

	.typing-dots span:nth-child(2) {
		animation-delay: 0.2s;
	}

	.typing-dots span:nth-child(3) {
		animation-delay: 0.4s;
	}

	@keyframes bounce {

		0%,
		80%,
		100% {
			transform: translateY(0);
		}

		40% {
			transform: translateY(-6px);
		}
	}

	/* Bloco de Código */
	.f5h-code-wrap {
		width: 100%;
		margin: 4px 0;
		border-radius: 8px;
		overflow: hidden;
		border: 1px solid #444;
	}

	.f5h-code-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: #1E1E1E;
		padding: 5px 10px;
		font-size: 0.75em;
		color: #aaa;
	}
	
	.cm-s-dracula .CodeMirror-gutters, .cm-s-dracula.CodeMirror {
		background-color: rgba(0, 0, 0, 0.5) !important;
		color: #f8f8f2 !important;
		border: none;
	}

	.f5h-code-header .lang-label {
		color: #76b900;
		font-weight: 600;
	}
	
	.f5h-code-wrap-live pre {
		margin: 0;
		padding: 10px;
		background: #1E1E1E;
		color: #f8f8f2;
		overflow: auto;
		font-size: 0.9em;
		line-height: 1.45;
		white-space: pre;
	}

	.f5h-code-copy-btn {
		background: rgba(255, 255, 255, 0.1);
		border: none;
		color: #ccc;
		padding: 3px 8px;
		border-radius: 4px;
		cursor: pointer;
		font-size: 0.8em;
		transition: background 0.2s;
	}

	.f5h-code-copy-btn:hover {
		background: rgba(255, 255, 255, 0.25);
		color: white;
	}

	.CodeMirror {
		height: auto !important;
		max-height: 400px;
		font-size: 0.82em;
		border-radius: 0;
	}

	.CodeMirror-scroll {
		max-height: 400px;
	}

	/* Markdown */
	.f5h-msg-bot h1,
	.f5h-msg-bot h2,
	.f5h-msg-bot h3,
	.f5h-msg-bot h4 {
		color: #e0e0e0;
		margin: 10px 0 5px;
		line-height: 1.3;
	}

	.f5h-msg-bot h1 {
		font-size: 1.15em;
	}

	.f5h-msg-bot h2 {
		font-size: 1.05em;
	}

	.f5h-msg-bot h3 {
		font-size: 0.98em;
	}

	.f5h-msg-bot p {
		margin: 5px 0;
	}

	.f5h-msg-bot ul,
	.f5h-msg-bot ol {
		margin: 5px 0 5px 18px;
		padding: 0;
	}

	.f5h-msg-bot li {
		margin: 3px 0;
	}

	.f5h-msg-bot strong {
		color: #fff;
	}

	.f5h-msg-bot em {
		color: #ccc;
	}

	.f5h-msg-bot hr {
		border: none;
		border-top: 1px solid #444;
		margin: 10px 0;
	}

	.f5h-msg-bot a {
		color: #76b900;
		text-decoration: underline;
	}

	/* Tabelas */
	.f5h-msg-bot table {
		border-collapse: collapse;
		width: 100%;
		font-size: 0.82em;
		margin: 8px 0;
	}

	.f5h-msg-bot th {
		background: #1E1E1E;
		color: #ccc;
		padding: 6px 10px;
		text-align: left;
		border: 1px solid #444;
	}

	.f5h-msg-bot td {
		padding: 5px 10px;
		border: 1px solid #3a3a3a;
		color: #ddd;
		vertical-align: top;
	}

	.f5h-msg-bot tr:nth-child(even) td {
		background: #252525;
	}

	/* Blockquote */
	.f5h-msg-bot blockquote {
		border-left: 3px solid #76b900;
		margin: 6px 0;
		padding: 4px 10px;
		color: #aaa;
		background: #252525;
		border-radius: 0 6px 6px 0;
	}

	.image-preview-container {
		max-width: 200px;
		margin-bottom: 4px;
	}

	.image-preview-container img {
		width: 100%;
		border-radius: 8px;
		border: 1px solid #555;
	}

	.f5h-timestamp {
		font-size: 0.62em;
		color: #666;
		margin-top: 3px;
		padding: 0 4px;
	}

	/* Status */
	#f5h-status {
		font-size: 0.78em;
		color: #888;
		padding: 6px 14px;
		text-align: center;
		display: none;
		background: #1e1e1e;
		border-top: 0px solid #333;
		flex-shrink: 0;
	}

	/* Input */
	.f5h-input-area {
		padding: 8px 10px;
		background: #1E1E1E;
		border-top: 1px solid #1E1E1E;
		flex-shrink: 0;
	}

	.f5h-composer {
		display: flex;
		align-items: flex-end;
		gap: 4px;
		width: 100%;
		padding: 4px;
		background: #333;
		border: 1px solid #444;
		border-radius: 22px;
		box-sizing: border-box;
		transition: border-color 0.2s;
	}

	.f5h-composer:focus-within {
		border-color: #76b900;
	}

	.f5h-attach-btn {
		background: transparent;
		border: none;
		cursor: pointer;
		padding: 5px;
		display: flex;
		color: #777;
		transition: color 0.2s;
	}

	.f5h-attach-btn:hover,
	.f5h-attach-btn.active {
		color: #76b900;
	}
	
	/* ---- Preview de imagem antes de enviar ---- */
	#f5h-image-preview-bar {
		display: flex;
		padding: 6px 12px 0;
	}

	#f5h-image-preview-wrap {
		position: relative;
		display: inline-block;
	}

	#f5h-image-preview-thumb {
		width: 56px;
		height: 56px;
		object-fit: cover;
		border-radius: 8px;
		border: 2px solid #444;
		display: block;
	}

	#f5h-image-remove-btn {
		position: absolute;
		top: -6px;
		right: -6px;
		width: 18px;
		height: 18px;
		border-radius: 50%;
		background: #e53935;
		color: #fff;
		border: none;
		cursor: pointer;
		font-size: 10px;
		line-height: 18px;
		text-align: center;
		padding: 0;
		transition: background 0.2s;
	}

	#f5h-image-remove-btn:hover {
		background: #b71c1c;
	}
	
	/* ---- Mensagem de erro dentro do bubble ---- */
	.f5h-error-msg {
		color: #ff6b6b;
		font-size: 0.9em;
	}

	/* ---- Modal de configuração do modelo ---- */
	#f5h-model-modal-overlay {
		/* Reutiliza os mesmos estilos do #f5h-modal-overlay */
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,0.55);
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 99999;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.2s;
	}

	#f5h-model-modal-overlay.active {
		opacity: 1;
		pointer-events: all;
	}

	.f5h-model-mode-options {
		display: flex;
		flex-direction: column;
		gap: 8px;
		margin: 12px 0;
	}

	.f5h-model-option {
		display: flex;
		align-items: flex-start;
		gap: 10px;
		cursor: pointer;
		padding: 10px 12px;
		border-radius: 8px;
		border: 1px solid #333;
		transition: border-color 0.2s, background 0.2s;
	}

	.f5h-model-option:hover {
		border-color: #555;
		background: rgba(255,255,255,0.03);
	}

	.f5h-model-option input[type="radio"] {
		margin-top: 3px;
		flex-shrink: 0;
		accent-color: #7c6af7;
	}

	.f5h-model-option div {
		display: flex;
		flex-direction: column;
		gap: 2px;
	}

	.f5h-model-option strong {
		font-size: 0.9em;
	}

	.f5h-model-option span {
		font-size: 0.78em;
		opacity: 0.65;
	}

	#f5h-model-select-modal-wrap {
		margin-top: 10px;
	}

	#f5h-model-select-modal {
		width: 100%;
		padding: 8px 10px;
		border-radius: 8px;
		border: 1px solid #444;
		background: #1e1e1e;
		color: inherit;
		font-size: 0.88em;
	}
	
	#f5h-model-label {
		font-size: 0.72em;
		padding: 2px 8px;
		border-radius: 20px;
		border: 1px solid rgba(255,255,255,0.15);
		color: rgba(255,255,255,0.7);
		white-space: nowrap;
		max-width: 100px;
		overflow: hidden;
		text-overflow: ellipsis;
		cursor: default;
	}

	#f5h-user-input {
		flex: 1;
		padding: 8px 6px;
		border: none;
		border-radius: 0;
		margin: 0;
		background: transparent;
		color: white;
		outline: none;
		font-size: 0.88em;
		resize: none;
		overflow-y: hidden;
		min-height: 36px;
		max-height: 160px;
		line-height: 1.45;
		font-family: inherit;
		display: block;
	}

	#f5h-send-btn {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
		background-image: linear-gradient(-225deg, #FF057C 0%, #8D0B93 50%, #321575 100%);
		color: white;
		border: none;
		border-radius: 20px;
		cursor: pointer;
		font-weight: bold;
		width: 36px;
		height: 36px;
		font-size: 0.88em;
	}

	#f5h-send-btn:hover {
		background: #5a9000;
	}

	#f5h-send-btn.is-stopping {
		background: #ef4444;
	}

	#f5h-send-btn.is-stopping:hover {
		background: #dc2626;
	}

	.f5h-msg-actions {
		display: flex;
		gap: 6px;
		margin-top: 5px;
		padding-left: 4px;
	}

	.f5h-msg-action-btn {
		display: inline-flex;
		align-items: center;
		gap: 5px;
		border: 1px solid #444;
		background: #252525;
		color: #bbb;
		border-radius: 999px;
		padding: 4px 9px;
		font-size: 0.72em;
		cursor: pointer;
		transition: border-color 0.2s, color 0.2s, background 0.2s;
	}

	.f5h-msg-action-btn:hover {
		border-color: #76b900;
		color: #fff;
		background: #303030;
	}

	/* Modal */
	#f5h-modal-overlay {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.75);
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 1002;
		visibility: hidden;
		opacity: 0;
		transition: opacity 0.3s;
	}

	#f5h-modal-overlay.active {
		visibility: visible;
		opacity: 1;
	}

	.f5h-modal-box {
		background: #2b2b2b;
		padding: 24px;
		border-radius: 12px;
		text-align: center;
		color: #eee;
		max-width: 350px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	}

	.f5h-modal-box h3 {
		margin-top: 0;
		color: white;
	}

	.f5h-modal-box p {
		color: #aaa;
		font-size: 0.9em;
	}

	.f5h-modal-btns {
		margin-top: 18px;
		display: flex;
		justify-content: center;
		gap: 10px;
	}

	.f5h-modal-btn {
		padding: 8px 20px;
		border: none;
		border-radius: 8px;
		cursor: pointer;
		font-weight: bold;
	}

	.btn-cancel {
		background: #444;
		color: #eee;
	}

	.btn-confirm {
		background: #d9534f;
		color: white;
	}

	@media (max-width: 768px) {
		#f5h-chat-bubble {
			width: 40px;
			height: 40px;
		}

		.f5h-chat-container {
			position: fixed;
			bottom: 70px;
			right: 10px;
			width: 95%;
			height: 100%;
			max-height: 80vh;
		}

		#expand-btn {
			display: none;
		}
		#f5h-chat-bubble img {
			width: 28px;
			height: 28px;
			fill: white;
		}
	}