/* ══════════════════════════════════════════════════════════════
   TICKCLIP ISO Agent — Generative AI Chat UI
   Inspired by ChatGPT / Perplexity / Claude
   ══════════════════════════════════════════════════════════════ */

/* ── Hero override for chat page ──────────────────────────── */
.tc-iso-hero {
	text-align: center;
	padding: 2.5rem 1rem 0.5rem;
}
.tc-iso-hero__title {
	font-size: 1.8rem;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 0.4rem;
}
.tc-iso-hero__sub {
	color: #64748b;
	font-size: 0.95rem;
	max-width: 520px;
	margin: 0 auto;
	line-height: 1.5;
}

/* ── Chat container ───────────────────────────────────────── */
.tc-chat {
	max-width: 760px;
	margin: 1.5rem auto 2rem;
	background: #ffffff;
	border-radius: 20px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.04);
	overflow: hidden;
	position: relative;
}

/* ── Messages area ────────────────────────────────────────── */
.tc-chat__messages {
	padding: 24px 28px;
	min-height: 200px;
	max-height: 520px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
	scroll-behavior: smooth;
}

/* Custom scrollbar */
.tc-chat__messages::-webkit-scrollbar { width: 6px; }
.tc-chat__messages::-webkit-scrollbar-track { background: transparent; }
.tc-chat__messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.tc-chat__messages::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Messages ─────────────────────────────────────────────── */
.tc-chat__msg {
	line-height: 1.65;
	font-size: 0.92rem;
	word-wrap: break-word;
	animation: tc-msg-in 0.3s ease-out;
}

@keyframes tc-msg-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* User message — right-aligned pill */
.tc-chat__msg--user {
	align-self: flex-end;
	background: #0f172a;
	color: #f8fafc;
	padding: 10px 18px;
	border-radius: 18px 18px 4px 18px;
	max-width: 75%;
	font-weight: 450;
}

/* Assistant message — full width, no bubble */
.tc-chat__msg--assistant {
	align-self: flex-start;
	color: #1e293b;
	padding: 4px 0;
	max-width: 100%;
	font-size: 0.93rem;
}

.tc-chat__msg--assistant strong {
	color: #0f172a;
	font-weight: 650;
}

.tc-chat__msg--assistant em {
	color: #475569;
	font-style: italic;
}

.tc-chat__msg--assistant a {
	color: #3b82f6;
	text-decoration: none;
	border-bottom: 1px solid #93c5fd;
}
.tc-chat__msg--assistant a:hover {
	color: #1d4ed8;
	border-color: #1d4ed8;
}

/* System message */
.tc-chat__msg--system {
	align-self: center;
	background: #fef3c7;
	color: #92400e;
	padding: 8px 16px;
	border-radius: 10px;
	font-size: 0.82rem;
	text-align: center;
	max-width: 80%;
}

/* ── Thinking indicator (with rotating status text) ─────── */
.tc-chat__msg--thinking {
	align-self: flex-start;
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 12px 16px;
	background: #f8fafc;
	border-radius: 14px;
	border: 1px solid #e2e8f0;
	animation: tc-msg-in 0.3s ease-out;
}

.tc-chat__think-dots {
	display: flex;
	gap: 4px;
	align-items: center;
	flex-shrink: 0;
}

.tc-chat__dot {
	width: 7px;
	height: 7px;
	background: #3b82f6;
	border-radius: 50%;
	animation: tc-pulse 1.4s ease-in-out infinite;
}
.tc-chat__dot:nth-child(2) { animation-delay: 0.16s; }
.tc-chat__dot:nth-child(3) { animation-delay: 0.32s; }

.tc-chat__think-text {
	font-size: 0.85rem;
	color: #64748b;
	font-style: italic;
	transition: opacity 0.2s ease;
}

@keyframes tc-pulse {
	0%, 80%, 100% { transform: scale(0.5); opacity: 0.35; }
	40% { transform: scale(1.1); opacity: 1; }
}

/* ── Legacy typing (keep for thread loading) ─────────────── */
.tc-chat__msg--typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	align-items: center;
	padding: 10px 4px;
}

/* ── Suggestion chips ─────────────────────────────────────── */
.tc-chat__suggestions {
	display: flex;
	gap: 8px;
	padding: 4px 28px 16px;
	flex-wrap: wrap;
	justify-content: center;
}

.tc-chat__chip {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 24px;
	padding: 8px 18px;
	font-size: 0.84rem;
	color: #475569;
	cursor: pointer;
	transition: all 0.2s;
	font-weight: 450;
}
.tc-chat__chip:hover {
	background: #0f172a;
	color: #f8fafc;
	border-color: #0f172a;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(15,23,42,0.15);
}

/* ── Input form — bottom of chat ──────────────────────────── */
.tc-chat__form {
	display: flex;
	align-items: center;
	border-top: 1px solid #f1f5f9;
	background: #fafbfc;
	padding: 4px;
	margin: 0 12px 12px;
	border-radius: 16px;
	border: 1px solid #e2e8f0;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.tc-chat__form:focus-within {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.tc-chat__input {
	flex: 1;
	border: none;
	padding: 12px 16px;
	font-size: 0.93rem;
	background: transparent;
	outline: none;
	color: #1e293b;
	font-family: inherit;
}
.tc-chat__input::placeholder {
	color: #94a3b8;
	font-weight: 400;
}

.tc-chat__send {
	background: #0f172a;
	color: #fff;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	font-size: 0;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.tc-chat__send::after {
	content: '';
	display: block;
	width: 0;
	height: 0;
	border-left: 8px solid #fff;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	margin-left: 2px;
}
.tc-chat__send:hover { background: #1e293b; transform: scale(1.05); }
.tc-chat__send:disabled {
	background: #cbd5e1;
	cursor: not-allowed;
	transform: none;
}

/* ── Product cards — inline in conversation ───────────────── */
.tc-chat__products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	padding: 8px 0 4px;
}

.tc-chat__product-card {
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	background: #fff;
	overflow: hidden;
	transition: all 0.2s;
}
.tc-chat__product-card:hover {
	border-color: #3b82f6;
	box-shadow: 0 4px 16px rgba(59,130,246,0.1);
	transform: translateY(-2px);
}

.tc-chat__product-img {
	width: 100%;
	height: 130px;
	object-fit: contain;
	background: #f8fafc;
	padding: 10px;
}

.tc-chat__product-body {
	padding: 12px 14px;
}

.tc-chat__product-title {
	font-size: 0.84rem;
	font-weight: 600;
	color: #1e293b;
	margin: 0 0 8px;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tc-chat__product-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.tc-chat__product-price {
	font-size: 1.1rem;
	font-weight: 750;
	color: #0f172a;
	letter-spacing: -0.02em;
}

.tc-chat__product-verdict {
	font-size: 0.68rem;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 6px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}
.tc-chat__product-verdict--tick {
	background: linear-gradient(135deg, #d1fae5, #a7f3d0);
	color: #047857;
}
.tc-chat__product-verdict--clip {
	background: linear-gradient(135deg, #fef3c7, #fde68a);
	color: #b45309;
}
.tc-chat__product-verdict--skip {
	background: linear-gradient(135deg, #fee2e2, #fecaca);
	color: #b91c1c;
}
.tc-chat__product-verdict--none {
	background: #f1f5f9;
	color: #64748b;
}

.tc-chat__product-source {
	display: block;
	font-size: 0.72rem;
	color: #94a3b8;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.tc-chat__product-cta {
	display: block;
	text-align: center;
	background: #0f172a;
	color: #fff;
	text-decoration: none;
	padding: 8px 16px;
	border-radius: 10px;
	font-size: 0.82rem;
	font-weight: 600;
	transition: all 0.2s;
}
.tc-chat__product-cta:hover {
	background: #1e293b;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(15,23,42,0.2);
}

/* ── Feedback buttons ─────────────────────────────────────── */
.tc-chat__product-feedback {
	display: flex;
	gap: 6px;
	padding: 8px 14px;
	border-top: 1px solid #f1f5f9;
}

.tc-chat__fb-btn {
	background: none;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 4px 10px;
	cursor: pointer;
	font-size: 0.8rem;
	opacity: 0.5;
	transition: all 0.2s;
}
.tc-chat__fb-btn:hover {
	opacity: 1;
	background: #f1f5f9;
	border-color: #e2e8f0;
}
.tc-chat__fb-btn--active {
	opacity: 1;
	background: #dbeafe;
	border-color: #3b82f6;
}
.tc-chat__fb-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Busy / loading state ─────────────────────────────────── */
.tc-chat--busy .tc-chat__form { opacity: 0.7; }
.tc-chat--busy .tc-chat__input { pointer-events: none; }

/* ── How-it-works (below chat) ────────────────────────────── */
.tc-iso-how {
	max-width: 760px;
	margin: 2rem auto;
	text-align: center;
}
.tc-iso-how__title {
	font-size: 1rem;
	color: #94a3b8;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 600;
	margin-bottom: 1.2rem;
}
.tc-iso-how__steps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}
.tc-iso-how__step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}
.tc-iso-how__num {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #0f172a;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.85rem;
}
.tc-iso-how__label {
	font-weight: 600;
	color: #1e293b;
	font-size: 0.9rem;
}
.tc-iso-how__desc {
	color: #64748b;
	font-size: 0.82rem;
	line-height: 1.4;
}

/* ── Auth CTA ─────────────────────────────────────────────── */
.tc-iso-auth-cta {
	text-align: center;
	padding: 1rem;
}
.tc-iso-auth-cta__text {
	color: #64748b;
	font-size: 0.88rem;
}
.tc-iso-auth-cta__text a {
	color: #3b82f6;
	font-weight: 600;
	text-decoration: none;
}
.tc-iso-auth-cta__text a:hover { text-decoration: underline; }

.tc-iso-quick-links {
	text-align: center;
	padding: 0.5rem;
}
.tc-iso-quick-link {
	color: #3b82f6;
	font-size: 0.85rem;
	text-decoration: none;
	font-weight: 500;
}
.tc-iso-quick-link:hover { text-decoration: underline; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 640px) {
	.tc-iso-hero { padding: 1.5rem 1rem 0.3rem; }
	.tc-iso-hero__title { font-size: 1.4rem; }

	.tc-chat {
		border-radius: 16px;
		margin: 1rem 0.5rem;
	}
	.tc-chat__messages {
		max-height: 380px;
		padding: 16px;
		gap: 12px;
	}
	.tc-chat__msg--user { max-width: 88%; }
	.tc-chat__suggestions { padding: 4px 16px 12px; }
	.tc-chat__chip { font-size: 0.78rem; padding: 6px 12px; }
	.tc-chat__form { margin: 0 8px 8px; }
	.tc-chat__input { padding: 10px 12px; font-size: 0.9rem; }
	.tc-chat__products { grid-template-columns: 1fr; }
	.tc-iso-how__steps { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 380px) {
	.tc-chat__msg { font-size: 0.85rem; }
	.tc-chat__product-body { padding: 10px; }
}
