@charset "UTF-8";

/* CSS Document */
* {
	box-sizing: border-box; /* Ensures padding and border are included in the width/height */
}

html,
body {
	height: 100%;
	width: 100%;
	margin: 0;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.6;
	color: #333;
	background-color: #f5f5f5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow: hidden; /* Prevents extra scrolling */
}

.header {
	padding: 0 0 1rem;
	padding-bottom: 20px;
	border-bottom: 2px solid #e0e0e0;
}

.header,
.footer {
	text-align: center;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.container {
	background-color: #ffffff;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	padding: 30px;
	width: 95dvw;
	height: 100%;
	max-width: 1200px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start; /* Spread content vertically */
	align-items: center;
	overflow: hidden; /* Prevents extra scrolling */
}

.chat-area {
	background-color: #ffffff;
	width: 100%; /* Takes full width of the container */
	display: flex;
	flex-direction: column;
	overflow: hidden; /* Ensures no extra scrolling */
	flex-grow: 1; /* Allows chat-area to grow with content */
}

/* Conversation area now uses shared .conversation class from conversation.css */
/* Index-specific sizing for conversation area */
.chat-area .conversation {
	width: 100%;
	height: 60%; /* Takes up 60% of chat-area */
}

.input-section {
	padding-top: 20px;
	border-top: 2px solid #e0e0e0;
}

.input-container {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 10px;
	position: relative;
}

h1 {
	color: #333;
}

.header h1 {
	color: #007bff;
	font-size: 28px;
	margin: 0;
}

.header-title-row + p {
	margin-top: 10px;
}

/* Reset margins only for non-conversation elements */
.header p,
.header h1,
.header h2,
.header h3,
.header h4,
.header h5,
.header h6,
.container > h1,
.container > h2,
.container > h3,
.container > h4,
.container > h5,
.container > h6,
.container > p {
	margin: 0;
}

li:not(:last-child) {
	margin-bottom: 4.5px;
}

button {
	background-color: #007bff;
	color: white;
	border: none;
	padding: 10px 20px;
	margin: 10px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 16px;
}

button:hover {
	background-color: #0056b3;
}

button:disabled {
	background-color: #6c757d;
	cursor: not-allowed;
	opacity: 0.65;
}

.button-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #ffffff;
	border-radius: 50%;
	border-top-color: transparent;
	animation: spin 1s ease-in-out infinite;
}

input.access-key-input {
	background-color: whitesmoke;
	color: #004210;
	border: 1px solid #ccc;
	padding: 0.35rem 0.5rem;
	margin: 0 0.5rem;
	border-radius: 5px;
	font-size: 16px;
	cursor: pointer;
	min-width: 200px;
}

input.user-input {
	width: 100%;
	padding: 10px;
	margin: 10px 0;
	box-sizing: border-box;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 16px;
}

textarea.user-input {
	width: 100%;
	padding: 10px;
	margin: 10px 0 10px 10px;
	box-sizing: border-box;
	border: 1px solid #ccc;
	border-radius: 5px;
	overflow-y: auto;
	font-size: 16px;
	resize: none; /* Disable manual resizing */
	height: 50px; /* Initial height */
}

/* Center the footer */
footer {
	width: 100%;
	text-align: center;
	margin: 10px 0;
}

pre {
	background-color: #f9f9f9;
	padding: 10px;
	border-radius: 5px;
	color: green;
	white-space: pre-wrap; /* Maintains whitespace but wraps text */
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.parental-topic {
	color: green;
	font-weight: bold; /* This will bold */
}

.cursor {
	color: green;
	font-weight: normal;
}

.topic {
	color: green;
	font-weight: normal;
}

.content {
	color: blue;
	font-style: normal;
}

.elaborate {
	color: darkblue;
	font-style: normal;
}

.green-normal {
	color: green;
	font-weight: normal;
}

.green-bold {
	color: green;
	font-weight: bold; /* This will bold */
}

.darkgreen-normal {
	color: darkgreen;
	font-weight: normal;
}

.darkgreen-bold {
	color: darkgreen;
	font-weight: bold; /* This will bold */
}

.orange-normal {
	color: orange;
	font-weight: normal;
}
.orange-bold {
	color: orange;
	font-weight: bold;
}

.blue-normal {
	color: blue;
	font-weight: normal;
}

.blue-bold {
	color: blue;
	font-weight: bold;
}

.darkblue-normal {
	color: darkblue;
	font-weight: normal;
}

.darkblue-bold {
	color: darkblue;
	font-weight: bold;
}

.purple-normal {
	color: rebeccapurple;
	font-weight: normal;
}

.purple-bold {
	color: rebeccapurple;
	font-weight: bold;
}

.red-normal {
	color: red;
	font-weight: normal;
}

.red-bold {
	color: red;
	font-weight: bold;
}

.pink-normal {
	color: deeppink;
	font-weight: normal;
}

.pink-bold {
	color: deeppink;
	font-weight: bold;
}

.gray-normal {
	color: darkslategray;
	font-weight: normal;
}

.gray-bold {
	color: darkslategray;
	font-weight: bold;
}

select {
	background-color: whitesmoke;
	color: #004210;
	border: 1px solid #ccc;
	padding: 0.35rem 0.5rem;
	margin: 0 0.5rem;
	border-radius: 5px;
	font-size: 16px;
	cursor: pointer;
	min-width: 200px;
}

select:hover {
	background-color: #e6e6e6;
}

.thinkingIndicator {
	margin-right: 10px;
}

/* Loader styles */
.loader {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #3498db;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	animation: spin 2s linear infinite;
	margin-left: 10px; /* Space between input and loader */
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* DIALOG */

dialog {
	width: 420px;
	min-height: 240px;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 1.5rem 1.5rem;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	border-radius: 0.5rem;
	border: none;
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
	margin: 0;
}

dialog[open] {
	display: flex;
}

dialog,
dialog[open]::backdrop {
	visibility: hidden;
	opacity: 0;
	transition: visibility 0s ease-in-out 300ms, opacity 300ms ease-in-out;
}

dialog[open].fade-in,
dialog[open].fade-in::backdrop {
	transition-delay: 0s;
}

dialog[open].fade-in,
dialog[open].fade-in::backdrop {
	opacity: 1;
	visibility: visible;
}

dialog::backdrop {
	backdrop-filter: blur(3px);
	background-color: rgba(0, 0, 0, 0.35);
}

#submissionStatus {
	margin-top: 1rem;
	display: none;
	text-align: center;
}

/* =============================================================================
   Status Indicator Styles
   ============================================================================= */

.header-title-row {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: nowrap;
}

.header-title-row h1 {
	flex-shrink: 0;
	display: inline;
	width: auto;
}

.status-indicator {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.2s ease;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
}

.status-indicator:hover {
	background-color: #f0f0f0;
	color: #333;
}

.status-icon {
	width: 20px;
	height: 20px;
	min-width: 20px;
	min-height: 20px;
	max-width: 20px;
	max-height: 20px;
	transition: opacity 0.2s ease, stroke 0.3s ease;
	flex-shrink: 0;
	stroke: #6c757d; /* Gray default, updated by JS */
}

.status-icon.status-pulse {
	animation: statusPulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-dot {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: #6c757d;
	border: 1.5px solid white;
	transition: background-color 0.3s ease;
}

.status-dot.status-pulse {
	animation: statusPulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes statusPulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.4;
	}
}

/* Mobile responsiveness */
@media (max-width: 600px) {
	.header-title-row {
		gap: 4px;
	}

	.status-indicator {
		padding: 3px;
		width: 24px;
		height: 24px;
	}

	.status-icon {
		width: 16px;
		height: 16px;
		min-width: 16px;
		min-height: 16px;
		max-width: 16px;
		max-height: 16px;
	}

	.status-dot {
		width: 6px;
		height: 6px;
		top: 1px;
		right: 1px;
	}
}