/**
 * WeboldaltKeszittek AI Asszisztens - Frontend stílusok
 */

#wkai-widget,
#wkai-widget * {
	box-sizing: border-box;
}

#wkai-widget {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Lebegő gomb */
.wkai-toggle {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: linear-gradient(135deg, #1a4f8b 0%, #2c7be5 100%);
	color: #fff;
	box-shadow: 0 6px 20px rgba(26, 79, 139, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	margin-left: auto;
}

.wkai-toggle:hover {
	transform: scale(1.08);
	box-shadow: 0 8px 26px rgba(26, 79, 139, 0.55);
}

/* Chat ablak */
.wkai-window {
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 110px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	margin-bottom: 14px;
	animation: wkai-pop 0.25s ease;
}

@keyframes wkai-pop {
	from { opacity: 0; transform: translateY(20px) scale(0.96); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Fejléc */
.wkai-header {
	background: linear-gradient(135deg, #1a4f8b 0%, #2c7be5 100%);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.wkai-header-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wkai-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
}

.wkai-title {
	font-weight: 600;
	font-size: 15px;
}

.wkai-status {
	font-size: 12px;
	opacity: 0.9;
	display: flex;
	align-items: center;
	gap: 5px;
}

.wkai-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4ade80;
	display: inline-block;
}

.wkai-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
}

.wkai-close:hover { opacity: 1; }

/* Üzenetek */
.wkai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f4f7fb;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wkai-msg {
	max-width: 82%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	word-wrap: break-word;
}

.wkai-msg-content {
	white-space: pre-wrap;
}

.wkai-msg-time {
	display: block;
	margin-top: 5px;
	font-size: 10px;
	line-height: 1;
	text-align: right;
	color: #8a94a3;
}

.wkai-msg-bot {
	background: #fff;
	color: #1f2937;
	align-self: flex-start;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wkai-msg-user {
	background: linear-gradient(135deg, #1a4f8b 0%, #2c7be5 100%);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

.wkai-msg-user .wkai-msg-time {
	color: rgba(255, 255, 255, 0.72);
}

.wkai-msg-system {
	align-self: center;
	background: #e0e7ff;
	color: #3730a3;
	font-size: 12px;
	text-align: center;
}

.wkai-msg-system .wkai-msg-time {
	color: rgba(55, 48, 163, 0.6);
}

/* Adatkezelési és folytatási kapu */
.wkai-gate {
	flex: 1;
	padding: 18px;
	overflow-y: auto;
	background: #f4f7fb;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wkai-gate-card {
	width: 100%;
	padding: 20px;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.wkai-gate-card h3 {
	margin: 0 0 10px;
	color: #1a4f8b;
	font-size: 17px;
}

.wkai-gate-card p {
	margin: 0 0 16px;
	color: #4b5563;
	font-size: 13px;
	line-height: 1.55;
}

.wkai-privacy-check {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin-bottom: 16px;
	color: #374151;
	font-size: 12px;
	line-height: 1.45;
}

.wkai-privacy-check input {
	margin-top: 3px;
}

.wkai-privacy-check a {
	color: #1a4f8b;
	font-weight: 600;
}

.wkai-primary-action,
.wkai-secondary-action {
	width: 100%;
	padding: 10px 12px;
	border-radius: 9px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
}

.wkai-primary-action {
	border: 1px solid #2c7be5;
	background: linear-gradient(135deg, #1a4f8b 0%, #2c7be5 100%);
	color: #fff;
}

.wkai-primary-action:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.wkai-secondary-action {
	border: 1px solid #c3c4c7;
	background: #fff;
	color: #50575e;
}

.wkai-gate-actions {
	display: grid;
	gap: 9px;
}

.wkai-gate-error {
	margin-top: 10px;
	padding: 8px 10px;
	border-radius: 7px;
	background: #fee2e2;
	color: #b91c1c;
	font-size: 12px;
}

/* Gépelés jelző */
.wkai-typing {
	display: flex;
	gap: 4px;
	padding: 12px 14px;
	background: #fff;
	border-radius: 14px;
	align-self: flex-start;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wkai-typing span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #9ca3af;
	animation: wkai-blink 1.2s infinite ease-in-out;
}

.wkai-typing span:nth-child(2) { animation-delay: 0.2s; }
.wkai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wkai-blink {
	0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-4px); }
}

/* Lábléc / bevitel */
.wkai-footer {
	border-top: 1px solid #e5e7eb;
	padding: 10px 12px 8px;
	background: #fff;
}

.wkai-offer-btn {
	width: 100%;
	padding: 9px;
	margin-bottom: 8px;
	border: 1px solid #2c7be5;
	background: #eaf2fd;
	color: #1a4f8b;
	border-radius: 10px;
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
	transition: background 0.2s;
}

.wkai-offer-btn:hover { background: #d8e8fc; }

.wkai-input-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}
.wkai-honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.wkai-input {
	flex: 1;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	padding: 10px 14px;
	font-size: 14px;
	resize: none;
	max-height: 100px;
	font-family: inherit;
	outline: none;
}

.wkai-input:focus { border-color: #2c7be5; }

.wkai-send {
	width: 42px;
	height: 42px;
	min-width: 42px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, #1a4f8b 0%, #2c7be5 100%);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s;
}

.wkai-send:hover { transform: scale(1.05); }
.wkai-send:disabled { opacity: 0.5; cursor: not-allowed; }

.wkai-branding {
	text-align: center;
	font-size: 10px;
	color: #9ca3af;
	margin-top: 6px;
}

/* Adatgyűjtő form */
.wkai-form {
	flex: 1;
	overflow-y: auto;
	background: #fff;
	padding: 14px 16px;
}

.wkai-form-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	color: #1a4f8b;
	font-size: 15px;
}

.wkai-form-cancel {
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
	color: #6b7280;
	line-height: 1;
}

.wkai-form label {
	display: block;
	font-size: 13px;
	color: #374151;
	margin-bottom: 10px;
	font-weight: 500;
}

.wkai-form input[type="text"],
.wkai-form input[type="tel"],
.wkai-form input[type="email"],
.wkai-form textarea {
	width: 100%;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 14px;
	margin-top: 4px;
	font-family: inherit;
	outline: none;
}

.wkai-form input:focus,
.wkai-form textarea:focus { border-color: #2c7be5; }

.wkai-checkbox {
	display: flex !important;
	align-items: flex-start;
	gap: 8px;
	font-weight: 400 !important;
}

.wkai-checkbox input { margin-top: 3px; }

.wkai-req { color: #dc2626; }

.wkai-submit {
	width: 100%;
	padding: 11px;
	border: none;
	background: linear-gradient(135deg, #1a4f8b 0%, #2c7be5 100%);
	color: #fff;
	border-radius: 10px;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	margin-top: 6px;
}

.wkai-submit:hover { opacity: 0.93; }

.wkai-form-error {
	background: #fee2e2;
	color: #b91c1c;
	padding: 8px 10px;
	border-radius: 8px;
	font-size: 13px;
	margin-bottom: 8px;
}

/* Mobil reszponzivitás */
@media (max-width: 480px) {
	#wkai-widget {
		right: 16px;
		bottom: 16px;
	}
	.wkai-window {
		width: calc(100vw - 24px);
		height: calc(100vh - 100px);
	}
}
