/* TalkTalk Examples - shadcn/ui Style Framework */

/* CSS Variables for Design System */
:root {
	/* Colors */
	--background: 0 0% 100%;
	--foreground: 222.2 84% 4.9%;
	--card: 0 0% 100%;
	--card-foreground: 222.2 84% 4.9%;
	--popover: 0 0% 100%;
	--popover-foreground: 222.2 84% 4.9%;
	--primary: 221.2 83.2% 53.3%;
	--primary-foreground: 210 40% 98%;
	--secondary: 210 40% 96%;
	--secondary-foreground: 222.2 84% 4.9%;
	--muted: 210 40% 96%;
	--muted-foreground: 215.4 16.3% 46.9%;
	--accent: 210 40% 96%;
	--accent-foreground: 222.2 84% 4.9%;
	--destructive: 0 84.2% 60.2%;
	--destructive-foreground: 210 40% 98%;
	--border: 214.3 31.8% 91.4%;
	--input: 214.3 31.8% 91.4%;
	--ring: 221.2 83.2% 53.3%;
	--radius: 0.5rem;
}

/* Dark mode */
.dark {
	--background: 222.2 84% 4.9%;
	--foreground: 210 40% 98%;
	--card: 222.2 84% 4.9%;
	--card-foreground: 210 40% 98%;
	--popover: 222.2 84% 4.9%;
	--popover-foreground: 210 40% 98%;
	--primary: 217.2 91.2% 59.8%;
	--primary-foreground: 222.2 84% 4.9%;
	--secondary: 217.2 32.6% 17.5%;
	--secondary-foreground: 210 40% 98%;
	--muted: 217.2 32.6% 17.5%;
	--muted-foreground: 215 20.2% 65.1%;
	--accent: 217.2 32.6% 17.5%;
	--accent-foreground: 210 40% 98%;
	--destructive: 0 62.8% 30.6%;
	--destructive-foreground: 210 40% 98%;
	--border: 217.2 32.6% 17.5%;
	--input: 217.2 32.6% 17.5%;
	--ring: 224.3 76.3% 94.1%;
}

/* Reset */
* {
	border: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* Base */
body {
	background-color: hsl(var(--background));
	color: hsl(var(--foreground));
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-feature-settings: "rlig" 1, "calt" 1;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1rem;
}

.page-container {
	min-height: 100vh;
	background: linear-gradient(to bottom right, hsl(var(--primary)), hsl(var(--primary-foreground)));
	padding: 2rem 0;
}

/* Typography */
h1 {
	font-size: 3rem;
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1;
	margin-bottom: 1rem;
}

h2 {
	font-size: 1.875rem;
	font-weight: 600;
	letter-spacing: -0.025em;
	line-height: 1.25;
	margin-bottom: 0.75rem;
}

h3 {
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.25;
	margin-bottom: 0.5rem;
}

p {
	color: hsl(var(--muted-foreground));
	line-height: 1.7;
}

/* Cards */
.card {
	background-color: hsl(var(--card));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) + 2px);
	box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
	color: hsl(var(--card-foreground));
	overflow: hidden;
}

.card-header {
	padding: 1.5rem 1.5rem 0;
}

.card-content {
	padding: 1.5rem;
}

.card-footer {
	align-items: center;
	border-top: 1px solid hsl(var(--border));
	display: flex;
	padding: 1.5rem;
}

/* Buttons */
.btn {
	align-items: center;
	border-radius: var(--radius);
	cursor: pointer;
	display: inline-flex;
	font-size: 0.875rem;
	font-weight: 500;
	height: 2.5rem;
	justify-content: center;
	padding: 0 1rem;
	position: relative;
	text-decoration: none;
	transition: all 0.2s ease-in-out;
	white-space: nowrap;
	border: 1px solid transparent;
}

.btn:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.btn-primary {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
	background-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
	background-color: hsl(var(--secondary));
	color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
	background-color: hsl(var(--secondary) / 0.8);
}

.btn-destructive {
	background-color: hsl(var(--destructive));
	color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
	background-color: hsl(var(--destructive) / 0.9);
}

.btn-outline {
	background-color: transparent;
	border: 1px solid hsl(var(--border));
	color: hsl(var(--foreground));
}

.btn-outline:hover {
	background-color: hsl(var(--accent));
	color: hsl(var(--accent-foreground));
}

.btn-ghost {
	background-color: transparent;
	color: hsl(var(--foreground));
}

.btn-ghost:hover {
	background-color: hsl(var(--accent));
	color: hsl(var(--accent-foreground));
}

.btn-sm {
	height: 2rem;
	padding: 0 0.75rem;
	font-size: 0.75rem;
}

.btn-lg {
	height: 3rem;
	padding: 0 2rem;
	font-size: 1rem;
}

/* Form Elements */
.form-group {
	margin-bottom: 1rem;
}

.form-label {
	color: hsl(var(--foreground));
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 0.375rem;
}

.form-input {
	background-color: hsl(var(--background));
	border: 1px solid hsl(var(--input));
	border-radius: var(--radius);
	color: hsl(var(--foreground));
	display: flex;
	font-size: 0.875rem;
	height: 2.5rem;
	padding: 0.5rem 0.75rem;
	transition: border-color 0.2s ease-in-out;
	width: 100%;
}

.form-input:focus {
	border-color: hsl(var(--ring));
	outline: none;
	ring: 2px solid hsl(var(--ring));
}

.form-input::placeholder {
	color: hsl(var(--muted-foreground));
}

.form-textarea {
	background-color: hsl(var(--background));
	border: 1px solid hsl(var(--input));
	border-radius: var(--radius);
	color: hsl(var(--foreground));
	font-size: 0.875rem;
	min-height: 5rem;
	padding: 0.5rem 0.75rem;
	resize: vertical;
	transition: border-color 0.2s ease-in-out;
	width: 100%;
}

.form-textarea:focus {
	border-color: hsl(var(--ring));
	outline: none;
	ring: 2px solid hsl(var(--ring));
}

/* Status */
.status {
	align-items: center;
	border-radius: var(--radius);
	display: flex;
	font-size: 0.875rem;
	font-weight: 500;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
}

.status-connected {
	background-color: hsl(142.1 76.2% 36.3% / 0.1);
	color: hsl(142.1 76.2% 36.3%);
}

.status-disconnected {
	background-color: hsl(var(--destructive) / 0.1);
	color: hsl(var(--destructive));
}

.status-connecting {
	background-color: hsl(47.9 95.8% 53.1% / 0.1);
	color: hsl(47.9 95.8% 53.1%);
}

/* Section */
.section {
	background-color: hsl(var(--card));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) + 2px);
	margin-bottom: 1.5rem;
	overflow: hidden;
}

.section-header {
	border-bottom: 1px solid hsl(var(--border));
	padding: 1.5rem;
}

.section-content {
	padding: 1.5rem;
}

/* Navigation Tabs */
.tabs {
	border-bottom: 1px solid hsl(var(--border));
	display: flex;
}

.tab {
	background-color: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	color: hsl(var(--muted-foreground));
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 500;
	padding: 0.75rem 1rem;
	transition: all 0.2s ease-in-out;
}

.tab:hover {
	color: hsl(var(--foreground));
}

.tab.active {
	border-bottom-color: hsl(var(--primary));
	color: hsl(var(--foreground));
}

.tab-content {
	display: none;
	padding: 1.5rem;
}

.tab-content.active {
	display: block;
}

/* Message List */
.message-list {
	background-color: hsl(var(--muted) / 0.3);
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	height: 300px;
	overflow-y: auto;
	padding: 1rem;
}

.message {
	background-color: hsl(var(--card));
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	margin-bottom: 0.75rem;
	padding: 0.75rem;
}

.message-header {
	align-items: center;
	display: flex;
	font-size: 0.75rem;
	gap: 0.5rem;
	margin-bottom: 0.25rem;
}

.message-author {
	color: hsl(var(--primary));
	font-weight: 600;
}

.message-time {
	color: hsl(var(--muted-foreground));
}

.message-content {
	color: hsl(var(--foreground));
	font-size: 0.875rem;
	line-height: 1.5;
}

/* Message Bubbles (shadcn-like) */
.message-item {
	max-width: 78%;
	background-color: hsl(var(--card));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) + 6px);
	padding: 0.625rem 0.75rem;
	margin: 0.5rem 0;
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
	word-wrap: break-word;
	word-break: break-word;
}

.message-item.my-message {
	margin-left: auto;
	background-color: hsl(var(--primary));
	border-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

.message-item.other-message {
	margin-right: auto;
	background-color: hsl(var(--card));
	border-color: hsl(var(--border));
}

.message-item .message-author {
	font-size: 0.75rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
	color: hsl(var(--primary));
}

.message-item.my-message .message-author {
	color: hsl(var(--primary-foreground));
	opacity: 0.9;
}

.message-item .message-content {
	color: inherit;
	font-size: 0.9rem;
	line-height: 1.5;
}

.message-item .message-time {
	margin-top: 0.25rem;
	font-size: 0.72rem;
	color: hsl(var(--muted-foreground));
	text-align: right;
}

.message-item.my-message .message-time {
	color: hsl(var(--primary-foreground) / 0.8);
}

/* Actions within message */
.message-actions {
	margin-top: 0.375rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
}

.message-actions .btn {
	height: 2rem;
	padding: 0 0.75rem;
	border-radius: 9999px;
	/* pill */
}

.file-actions {
	margin-top: 0.375rem;
	font-size: 0.75rem;
	color: hsl(var(--muted-foreground));
}

/* Utility Classes */
.flex {
	display: flex;
}

.items-center {
	align-items: center;
}

.justify-center {
	justify-content: center;
}

.justify-between {
	justify-content: space-between;
}

.gap-2 {
	gap: 0.5rem;
}

.gap-4 {
	gap: 1rem;
}

.grid {
	display: grid;
}

.grid-cols-1 {
	grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mt-4 {
	margin-top: 1rem;
}

.mt-8 {
	margin-top: 2rem;
}

.mb-4 {
	margin-bottom: 1rem;
}

.mb-6 {
	margin-bottom: 1.5rem;
}

.ml-2 {
	margin-left: 0.5rem;
}

.ml-4 {
	margin-left: 1rem;
}

.mr-4 {
	margin-right: 1rem;
}

.p-4 {
	padding: 1rem;
}

.space-y-1>*+* {
	margin-top: 0.25rem;
}

.space-y-2>*+* {
	margin-top: 0.5rem;
}

.text-center {
	text-align: center;
}

.text-sm {
	font-size: 0.875rem;
}

.text-xs {
	font-size: 0.75rem;
}

.font-medium {
	font-weight: 500;
}

.font-semibold {
	font-weight: 600;
}

.font-bold {
	font-weight: 700;
}

.font-mono {
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.text-muted {
	color: hsl(var(--muted-foreground));
}

.text-primary {
	color: hsl(var(--primary));
}

.text-green-600 {
	color: #16a34a;
}

.bg-muted {
	background-color: hsl(var(--muted));
}

.border {
	border: 1px solid hsl(var(--border));
}

.rounded {
	border-radius: var(--radius);
}

.shadow {
	box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.shadow-lg {
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Header Styles */
.header {
	background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.8));
	color: hsl(var(--primary-foreground));
	padding: 3rem 1.5rem;
	text-align: center;
	border-radius: calc(var(--radius) + 2px) calc(var(--radius) + 2px) 0 0;
}

.header h1 {
	color: hsl(var(--primary-foreground));
	margin-bottom: 0.5rem;
}

.header p {
	color: hsl(var(--primary-foreground) / 0.8);
	font-size: 1.125rem;
}

/* Example Cards Grid */
.example-grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	margin-top: 2rem;
}

.example-card {
	background-color: hsl(var(--card));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) + 2px);
	overflow: hidden;
	transition: all 0.2s ease-in-out;
}

.example-card:hover {
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
	transform: translateY(-2px);
}

.example-card-header {
	padding: 1.5rem;
	border-bottom: 1px solid hsl(var(--border));
}

.example-card-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
}

.example-card-description {
	color: hsl(var(--muted-foreground));
	font-size: 0.875rem;
	line-height: 1.5;
}

.example-card-content {
	padding: 1.5rem;
}

.example-buttons {
	display: flex;
	gap: 0.75rem;
}

/* Badge */
.badge {
	align-items: center;
	border-radius: calc(var(--radius) / 2);
	display: inline-flex;
	font-size: 0.75rem;
	font-weight: 500;
	padding: 0.25rem 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.025em;
}

.badge-primary {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

.badge-secondary {
	background-color: hsl(var(--secondary));
	color: hsl(var(--secondary-foreground));
}

.badge-recommended {
	background-color: hsl(142.1 76.2% 36.3%);
	color: white;
}

/* Responsive */
@media (max-width: 768px) {
	.container {
		padding: 0 0.75rem;
	}

	.page-container {
		padding: 1rem 0;
	}

	.header {
		padding: 2rem 1rem;
	}

	.header h1 {
		font-size: 2rem;
	}

	.example-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.example-buttons {
		flex-direction: column;
	}

	.btn {
		width: 100%;
	}
}

/* Loading States */
.loading {
	position: relative;
}

.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1rem;
	height: 1rem;
	margin: -0.5rem 0 0 -0.5rem;
	border: 2px solid hsl(var(--muted));
	border-top: 2px solid hsl(var(--primary));
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* Log Output */
.log-output {
	background-color: hsl(var(--muted) / 0.3);
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
	font-size: 0.75rem;
	height: 200px;
	line-height: 1.4;
	overflow-y: auto;
	padding: 0.75rem;
	white-space: pre-wrap;
}

.log-entry {
	margin-bottom: 0.25rem;
}

.log-error {
	color: hsl(var(--destructive));
}

.log-success {
	color: hsl(142.1 76.2% 36.3%);
}

.log-info {
	color: hsl(var(--primary));
}