/** @format */

body {
	background-color: #121212;
	color: #e0e0e0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
		Arial, sans-serif;
	margin: 0;
	display: flex;
	flex-direction: column;
	height: 100dvh; /* Dynamic viewport height for mobile */
}

#header {
	background-color: #1e1e1e;
	padding: 15px;
	text-align: center;
	font-weight: bold;
	border-bottom: 1px solid #333;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#status {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: #555; /* Offline gray */
	display: inline-block;
}

#status.online {
	background-color: #4caf50; /* Online green */
	box-shadow: 0 0 5px #4caf50;
}

#messages {
	flex: 1;
	overflow-y: auto;
	padding: 15px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.message {
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 18px;
	line-height: 1.4;
	word-wrap: break-word;
	position: relative;
}

.message.me {
	align-self: flex-end;
	background-color: #007aff; /* iOS Blue */
	color: white;
	border-bottom-right-radius: 4px;
}

.message.riley {
	align-self: flex-start;
	background-color: #2c2c2e;
	color: white;
	border-bottom-left-radius: 4px;
}

.message.system {
	align-self: center;
	background-color: transparent;
	color: #888;
	font-size: 0.8em;
	padding: 5px;
}

#input-area {
	padding: 10px;
	background-color: #1e1e1e;
	border-top: 1px solid #333;
	display: flex;
	gap: 10px;
}

#input {
	flex: 1;
	padding: 12px;
	border-radius: 20px;
	border: 1px solid #333;
	background-color: #2c2c2e;
	color: white;
	font-size: 16px; /* Prevents zoom on iOS */
	outline: none;
}

#input:focus {
	border-color: #007aff;
}

button {
	background-color: #007aff;
	color: white;
	border: none;
	padding: 0 20px;
	border-radius: 20px;
	cursor: pointer;
	font-size: 1rem;
}

button:disabled {
	background-color: #555;
	cursor: not-allowed;
}

/* Auth Modal */
#auth-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #121212;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	z-index: 1000;
	gap: 12px;
	padding: 20px;
	box-sizing: border-box;
}

#auth-modal h2 {
	margin: 0;
	font-size: 1.5em;
}

#auth-modal p {
	margin: 0;
	color: #888;
	font-size: 0.9em;
	text-align: center;
}

#auth-modal #auth-btn {
	padding: 14px 28px;
	font-size: 1em;
	margin-top: 10px;
}

#auth-modal .error {
	color: #ff6b6b;
	font-size: 0.85em;
	max-width: 280px;
	text-align: center;
}

.hidden {
	display: none !important;
}

/* Typing Indicator */
#typing-indicator {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 15px;
	color: #888;
	font-size: 0.85em;
}

#typing-indicator.hidden {
	display: none;
}

#typing-indicator .dot {
	width: 6px;
	height: 6px;
	background-color: #888;
	border-radius: 50%;
	animation: typingBounce 1.4s ease-in-out infinite;
}

#typing-indicator .dot:nth-child(1) {
	animation-delay: 0s;
}

#typing-indicator .dot:nth-child(2) {
	animation-delay: 0.2s;
}

#typing-indicator .dot:nth-child(3) {
	animation-delay: 0.4s;
}

#typing-indicator .typing-text {
	margin-left: 8px;
}

@keyframes typingBounce {
	0%,
	60%,
	100% {
		transform: translateY(0);
		opacity: 0.4;
	}
	30% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

/* Tool Indicators */
.tool-stack {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 4px 0;
	justify-content: flex-start;
}

.tool-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	background-color: #2a2a2a;
	border: 1px solid #444;
	border-radius: 12px;
	font-size: 0.75em;
	color: #888;
	cursor: default;
	transition: background-color 0.2s;
}

.tool-badge:hover {
	background-color: #333;
	color: #aaa;
}

.tool-icon {
	font-size: 0.9em;
	opacity: 0.7;
}

.tool-name {
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
