/**
 * 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_header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 0.5rem;

		h3 {
			margin: 0;
			flex-grow: 1;
		}

		.contentoracle-ai_chat_reset_button {
			background: none;
			border: none;
			cursor: pointer;
			padding: 4px;
			margin-left: 8px;
			opacity: 0.7;
			transition: opacity 0.2s, transform 0.2s;
			border-radius: 4px;
			color: inherit;

			&:hover {
				opacity: 1;
				transform: scale(1.1);
			}

			&:active {
				transform: scale(0.95);
			}

			svg {
				width: 16px;
				height: 16px;
			}
		}
	}

	.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;
			overflow-y: auto;
			overflow-x: auto;
			/* allow horizontal scrolling, to handle overflowing code blocks gracefully */

			/* 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;
				}
			}

			@media screen and (max-width: 782px) {
				.coai_chat-featured_content {
					flex-direction: column;
					gap: 1rem;
					text-align: center;

					.coai_chat-featured_content_inner {
						flex-direction: column;
						gap: 0.5rem;

						img {
							max-width: 90%;
						}

						padding: 0.5rem 0;

					}

					.coai_chat-featured_content_btn {
						max-width: 90%;
					}
				}
			}

			.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);
	}
}