:root {
	--primary-color: #1da1f2;
	--primary-color-hover: #1a91da;
	--error-color: #e0245e;
	--border-color: #e1e8ed;
	--background-color: #f5f5f5;
	--text-color: #333;
	--text-color-secondary: #666;
	--surface-color: white;
	--btn-disabled-bg: #b9d3e2;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.6;
	color: var(--text-color);
	background: var(--background-color);
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.container {
	width: 100%;
	max-width: 600px;
	padding: 2rem;
}

.header {
	text-align: center;
	margin-bottom: 2rem;
}

h1 {
	margin-bottom: 0.5rem;
	color: var(--primary-color);
}

.subtitle {
	color: var(--text-color-secondary);
}

.form-container {
	background: var(--surface-color);
	border-radius: 12px;
	padding: 2rem;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.input-group {
	margin-bottom: 1rem;
}

input[type="text"] {
	width: 100%;
	padding: 1rem;
	border: 2px solid var(--border-color);
	border-radius: 8px;
	font-size: 1rem;
	transition: border-color 0.2s;
}

input[type="text"]:focus {
	outline: none;
	border-color: var(--primary-color);
}

input[type="text"].error {
	border-color: var(--error-color);
}

.error-message {
	color: var(--error-color);
	font-size: 0.875rem;
	margin-top: 0.5rem;
	display: none;
}

.error-message.visible {
	display: block;
}

.btn {
	width: 100%;
	padding: 1rem;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition:
		background-color 0.2s,
		opacity 0.2s;
}

.btn-primary {
	background: var(--primary-color);
	color: var(--surface-color);
}

.btn-primary:hover:not(:disabled) {
	background: var(--primary-color-hover);
}

.btn-primary:disabled {
	background: var(--btn-disabled-bg);
	cursor: not-allowed;
}

.spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #ffffff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin-right: 8px;
	vertical-align: middle;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.hidden {
	display: none;
}

.preview-container {
	background: var(--surface-color);
	border-radius: 12px;
	padding: 2rem;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.preview {
	background: var(--surface-color);
	border-radius: 8px;
	padding: 1rem;
}

.preview-author {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border-color);
}

.preview-author-name {
	font-weight: 700;
	margin-right: 0.5rem;
}

.preview-author-handle {
	color: var(--text-color-secondary);
}

.thread-header {
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border-color);
}

.thread-count {
	color: var(--text-color-secondary);
	font-size: 0.875rem;
}

.tweet {
	padding: 1rem 0;
	border-bottom: 1px solid var(--border-color);
}

.tweet:first-child {
	padding-top: 0;
}

.tweet:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.tweet-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.tweet-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
}

.tweet-author-info {
	display: flex;
	flex-direction: column;
}

.tweet-author-name {
	font-weight: 700;
}

.tweet-author-handle {
	color: var(--text-color-secondary);
	font-size: 0.875rem;
}

.tweet-body {
	margin-bottom: 0.75rem;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

.tweet-images {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.tweet-image {
	max-width: 100%;
	border-radius: 12px;
	border: 1px solid var(--border-color);
}

.tweet-video {
	position: relative;
	margin-bottom: 0.75rem;
}

.video-label {
	display: inline-block;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	padding: 0.25rem 0.75rem;
	border-radius: 6px;
	font-size: 0.8rem;
	margin-top: 0.5rem;
}

.tweet-timestamp {
	color: var(--text-color-secondary);
	font-size: 0.875rem;
}

.preview-actions {
	display: flex;
	gap: 1rem;
	margin-top: 1.5rem;
}

.btn-secondary {
	background: #e1e8ed;
	color: var(--text-color);
}

.btn-secondary:hover:not(:disabled) {
	background: #cfd6db;
}

.link-card {
	border: 1px solid var(--border-color);
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 0.75rem;
	cursor: pointer;
}

.link-card-image {
	width: 100%;
	display: block;
}

.link-card-content {
	padding: 0.75rem;
}

.link-card-title {
	font-weight: 700;
	font-size: 0.9375rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 0.25rem;
}

.link-card-description {
	color: var(--text-color-secondary);
	font-size: 0.875rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 0.25rem;
}

.link-card-domain {
	color: #999;
	font-size: 0.8125rem;
}

.parent-tweet {
	border-left: 3px solid #ccd6dd;
	padding-left: 1rem;
	margin-bottom: 1rem;
	font-size: 0.9375rem;
	color: #555;
}

.parent-tweet .tweet-header {
	margin-bottom: 0.5rem;
}

.parent-tweet .tweet-avatar {
	width: 36px;
	height: 36px;
}

.parent-tweet .tweet-timestamp {
	font-size: 0.8125rem;
}

.quoted-tweet {
	border: 1px solid #ccd6dd;
	border-radius: 12px;
	padding: 0.75rem;
	margin-bottom: 0.75rem;
	font-size: 0.9375rem;
}

.quoted-tweet .tweet-avatar {
	width: 20px;
	height: 20px;
}

.quoted-tweet .tweet-author-info {
	flex-direction: row;
	gap: 0.25rem;
	align-items: center;
}

.quoted-tweet .tweet-header {
	margin-bottom: 0.5rem;
}

.quoted-tweet .tweet-timestamp {
	font-size: 0.8125rem;
}

.reply-label {
	color: #999;
	font-size: 0.8125rem;
	margin-bottom: 0.5rem;
}
