/**
 * The following styles get applied both on the front of your site
 * and in the editor.
 *
 * Replace them with your own styles or remove the file completely.
 */


.contentoracle-ai_chat_root {
	padding: 0.25rem;

	.contentoracle-ai_chat_conversation {
		height: 10rem;
		overflow-y: auto;
		margin: 0.5rem 0;
		padding: 0.25rem 0.75rem;
		background-color: rgba(0, 0, 0, 0.1);

		.contentoracle-ai_chat_greeter_container {
			font-size: larger;
			display: grid;
			place-items: center;
			height: 100%;

			.contentoracle-ai_chat_greeter {
				text-align: center;

				.contentoracle-ai_chat_message_seeder {
					display: flex;
					flex-direction: row;
					gap: 0.5rem;
					flex-wrap: wrap;
					justify-content: center;
					align-items: center;

					.contentoracle-ai_chat_message_seeder_item {
						padding: 0.5rem;
						border-radius: 0.5rem;
						background-color: rgba(0, 0, 0, 0.1);

						&:hover {
							cursor: pointer;
							scale: 1.05;
						}

						&:active {
							scale: 0.95;
						}
					}
				}
			}
		}

		.contentoracle-ai_chat_bubble {
			margin: 0.25rem 0;
			padding: 0.5rem;
			border-radius: 0.5rem;
			max-width: 85%;
			clear: both;

			/* responsive design on narrow screens*/
			@media(max-width: 768px) {
				max-width: 100%;
			}

			&.contentoracle-ai_chat_bubble_user {
				float: right;
				animation: fadeIn 1s ease-in-out;
			}

			&.contentoracle-ai_chat_bubble_bot {
				float: left;
				animation: fadeIn 1s ease-in-out;
			}

			&.contentoracle-ai_chat_bubble_error {
				float: left;
				background-color: rgb(201, 16, 16);
				color: white;
			}

			&.contentoracle-ai_chat_bubble_typing {
				float: left;
				display: flex;
				justify-content: center;
				align-items: center;

				span {
					font-size: 2rem;

					&:nth-child(1) {
						animation-delay: 0s;
					}

					&:nth-child(2) {
						animation-delay: 0.15s;
					}

					&:nth-child(3) {
						animation-delay: 0.3s;
					}

					animation: pulse 1s infinite;
				}

			}

			.contentoracle-ai_chat_bubble_bot_main_idea {
				text-decoration: underline;
			}

			/* citations */
			.contentoracle-inline_citation {
				vertical-align: super;
				/*mimic the <sup> tag*/
				font-size: smaller;
				text-decoration: none;
			}

			/* featured content */
			.coai_chat-featured_content {
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				align-items: center;
				font-size: larger;
				padding: 0.5rem;
				margin-bottom: 0.5rem;

				.coai_chat-featured_content_inner {
					display: flex;
					flex-direction: row;
					align-items: center;
					padding: 0.5rem;

					p {
						margin: 0 0.5rem;
					}

					img {
						max-height: 5rem;
					}

				}

				.coai_chat-featured_content_btn {
					text-align: center;
					text-decoration: none;
					padding: 1rem;
				}

			}

			.contentoracle-source_list {
				width: 100%;

				.contentoracle-footer_citation {
					margin: 0.75rem 0;
					padding: 0 0.5rem;
					font-size: 1.125em;

					.contentoracle-footer_citation_link {
						text-decoration: none;
						float: right;
					}
				}

			}

			/* action */
			.contentoracle-action_container {
				display: grid;
				place-items: center;
				min-height: 4rem;
				padding: 1rem;
				width: 100%;
				box-sizing: border-box;

				.contentoracle-action_label {
					font-size: larger;
				}

				.contentoracle-action_image {
					width: 100%;
					max-width: 100%;
					height: auto;
					margin: 0.5rem 0;
					box-sizing: border-box;
				}

				.contentoracle-action_text {
					margin: 0.5rem 0;
					padding: 1rem 0;
				}

				.contentoracle-action_button {
					margin: 1.5rem 0;

					&.contentoracle-ai_chat_button {
						padding: 1rem;
						font-size: larger;
						border: none;

						&:hover {
							cursor: pointer;
							scale: 1.05;
						}

						&:active {
							scale: 0.95;
						}
					}
				}



			}


		}

	}

	.contentoracle-ai_chat_input_container {
		display: flex;
		align-items: center;
		padding: 2px;

		.contentoracle-ai_chat_input_wrapper {
			flex-grow: 1;

			/* grow to fill the remaining space */
			.contentoracle-ai_chat_input {
				width: 100%;
				padding: 1rem 0.4rem;
				font-size: var(--wp--preset--font-size--medium);
				border-width: 0;

				&:disabled {
					opacity: 0.5;
					cursor: not-allowed;
				}
			}
		}

		.contentoracle-ai_chat_button {
			padding: 1rem;
			font-size: var(--wp--preset--font-size--medium);
			margin-left: 0.25rem;
			border: none;
			z-index: 1;

			&:hover {
				cursor: pointer;
				scale: 1.05;
			}

			&:active {
				scale: 0.95;
			}
		}
	}
}

/* animations */
@keyframes pulse {
	0% {
		opacity: 0;
	}

	50% {
		opacity: 1;
	}

	100% {
		opacity: 0;
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-3rem);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}