/* Chat-style AI Resume Builder */
body.chat-page {
	background: #f7f7f8;
}

.chat-app {
	display: flex;
	flex-direction: column;
	height: calc(100vh - 280px);
	min-height: 480px;
	max-width: 820px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.chat-header {
	padding: 16px 20px;
	border-bottom: 1px solid #ececec;
	background: linear-gradient(135deg, #34006b 0%, #5a1a9e 100%);
	color: #fff;
	flex-shrink: 0;
}

.chat-header h1 {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 600;
	font-family: "Poppins", sans-serif;
}

.chat-header .login_id {
	font-weight: 600;
}

.chat-header p {
	margin: 0;
	font-size: 12px;
	opacity: 0.9;
	line-height: 1.45;
}

.chat-progress {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 12px;
}

.chat-progress-bar {
	flex: 1;
	height: 4px;
	background: rgba(255, 255, 255, 0.25);
	border-radius: 999px;
	overflow: hidden;
}

.chat-progress-fill {
	height: 100%;
	background: #fff;
	border-radius: 999px;
	transition: width 0.4s ease;
	width: 0%;
}

.chat-progress-label {
	font-size: 11px;
	opacity: 0.85;
	white-space: nowrap;
}

.chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 24px 20px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	scroll-behavior: smooth;
}

.chat-msg {
	display: flex;
	gap: 12px;
	max-width: 100%;
	animation: chatFadeIn 0.35s ease;
}

@keyframes chatFadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
	flex-direction: row-reverse;
}

.chat-avatar {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
}

.chat-msg.assistant .chat-avatar {
	background: linear-gradient(135deg, #34006b, #7c3aed);
	color: #fff;
}

.chat-msg.user .chat-avatar {
	background: #5436da;
	color: #fff;
}

.chat-bubble {
	padding: 12px 16px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.55;
	max-width: min(100%, 560px);
}

.chat-msg.assistant .chat-bubble {
	background: #f4f4f5;
	color: #1a1a2e;
	border-top-left-radius: 4px;
}

.chat-msg.user .chat-bubble {
	background: #34006b;
	color: #fff;
	border-top-right-radius: 4px;
}

.chat-bubble .q-note {
	display: block;
	margin-top: 8px;
	font-size: 12px;
	opacity: 0.75;
	font-style: italic;
}

.chat-bubble .q-section {
	display: inline-block;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #7c3aed;
	margin-bottom: 6px;
}

.chat-typing {
	display: flex;
	gap: 4px;
	padding: 14px 18px;
}

.chat-typing span {
	width: 7px;
	height: 7px;
	background: #999;
	border-radius: 50%;
	animation: chatBounce 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

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

/* Composer */
.chat-composer {
	border-top: 1px solid #ececec;
	padding: 16px 20px;
	background: #fff;
	flex-shrink: 0;
}

.chat-composer-inner {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.chat-composer-note {
	font-size: 12px;
	color: #888;
	font-style: italic;
}

.chat-input-row {
	display: flex;
	gap: 10px;
	align-items: flex-end;
}

.chat-input-row input[type="text"],
.chat-input-row input[type="date"],
.chat-input-row input[type="number"],
.chat-input-row select,
.chat-input-row textarea {
	flex: 1;
	padding: 12px 14px;
	border: 1px solid #d9d9e3;
	border-radius: 10px;
	font-size: 14px;
	font-family: "Poppins", sans-serif;
	resize: none;
	min-height: 44px;
	background: #fff;
}

.chat-input-row textarea {
	min-height: 80px;
}

.chat-input-row input:focus,
.chat-input-row select:focus,
.chat-input-row textarea:focus {
	outline: none;
	border-color: #34006b;
	box-shadow: 0 0 0 3px rgba(52, 0, 107, 0.1);
}

.chat-send-btn {
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 10px;
	background: #34006b;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.2s;
}

.chat-send-btn:hover { background: #2a0056; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-send-btn svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

/* Option chips */
.chat-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.chat-option-btn {
	padding: 9px 16px;
	border: 1px solid #d9d9e3;
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	cursor: pointer;
	font-family: "Poppins", sans-serif;
	color: #333;
	transition: all 0.15s;
}

.chat-option-btn:hover {
	border-color: #34006b;
	background: #f8f5fc;
}

.chat-option-btn.selected {
	border-color: #34006b;
	background: #34006b;
	color: #fff;
}

.chat-yes-no {
	display: flex;
	gap: 10px;
}

.chat-yes-no .chat-option-btn {
	min-width: 80px;
	text-align: center;
}

.chat-multi-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 4px;
}

.chat-multi-hint {
	font-size: 12px;
	color: #888;
}

.chat-done-btn {
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	background: #34006b;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: "Poppins", sans-serif;
}

.chat-done-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.chat-composer-row {
	display: flex;
	gap: 10px;
}

.chat-composer-row select {
	flex: 1;
	padding: 12px;
	border: 1px solid #d9d9e3;
	border-radius: 10px;
	font-size: 14px;
}

.chat-lang-grid {
	display: grid;
	gap: 8px;
	font-size: 13px;
}

.chat-lang-row {
	display: grid;
	grid-template-columns: 100px 1fr 1fr 1fr;
	gap: 8px;
	align-items: center;
}

.chat-lang-row.header {
	font-weight: 600;
	color: #34006b;
	font-size: 12px;
}

.chat-lang-row label {
	display: flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
}

.chat-composer-disabled {
	text-align: center;
	color: #999;
	font-size: 13px;
	padding: 8px;
}

/* Resume result panel */
.chat-resume-panel {
	display: none;
	max-width: 820px;
	margin: 20px auto 40px;
	padding: 0 20px;
}

.chat-resume-panel.visible {
	display: block;
}

.chat-resume-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
}

.chat-resume-btn {
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: "Poppins", sans-serif;
	border: 1px solid #34006b;
	background: #fff;
	color: #34006b;
}

.chat-resume-btn.primary {
	background: #34006b;
	color: #fff;
	border: none;
}

.resume-preview-paper {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 40px 44px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	font-family: Georgia, "Times New Roman", serif;
	font-size: 13px;
	line-height: 1.55;
	color: #222;
}

.resume-preview-header {
	text-align: center;
	border-bottom: 2px solid #34006b;
	padding-bottom: 14px;
	margin-bottom: 18px;
}

.resume-preview-header h2 {
	margin: 0 0 4px;
	font-size: 22px;
	color: #1a1a2e;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.resume-preview-header p {
	margin: 2px 0;
	font-size: 12px;
	color: #555;
}

.resume-preview-section {
	margin-bottom: 16px;
}

.resume-preview-section h3 {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #34006b;
	border-bottom: 1px solid #e8e0f0;
	padding-bottom: 4px;
	margin: 0 0 8px;
	font-family: "Poppins", sans-serif;
}

.resume-preview-section ul {
	margin: 0;
	padding-left: 18px;
}

.resume-preview-summary {
	font-style: italic;
	color: #444;
}

.resume-preview-scheme {
	margin-top: 16px;
	padding: 10px 14px;
	background: #f0fdf4;
	border-left: 3px solid #16a34a;
	font-size: 12px;
	color: #166534;
}

.resume-page-wrap {
	padding: 20px;
	min-height: calc(100vh - 280px);
}

@media (max-width: 768px) {
	.chat-app {
		height: calc(100vh - 160px);
		border-radius: 0;
		border-left: none;
		border-right: none;
	}

	.chat-lang-row {
		grid-template-columns: 80px 1fr 1fr 1fr;
		font-size: 11px;
	}

	.resume-preview-paper {
		padding: 24px 18px;
	}
}

@media print {
	.header_container,
	.chat-app,
	.chat-resume-actions,
	.footer_container {
		display: none !important;
	}

	.chat-resume-panel {
		display: block !important;
		margin: 0;
		padding: 0;
	}

	.resume-preview-paper {
		box-shadow: none;
		border: none;
	}
}
