/**
 * OpenCO2net Chat Flows — public chat widget styles.
 * All selectors are prefixed .oc2cf- to avoid theme collisions.
 */

.oc2cf-root {
	--oc2cf-primary: #00c5e4;
	--oc2cf-primary-dark: #13b7e0;
	--oc2cf-text: #405764;
	--oc2cf-radius: 16px;
}

/* ---------- Launcher ---------- */

.oc2cf-launcher {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: var(--oc2cf-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.oc2cf-launcher:hover {
	transform: scale(1.08);
	background: var(--oc2cf-primary-dark);
}

.oc2cf-launcher svg {
	display: block;
	pointer-events: none;
}

.oc2cf-launcher .oc2cf-icon-close {
	display: none;
}

.oc2cf-root.oc2cf-open .oc2cf-launcher .oc2cf-icon-chat {
	display: none;
}

.oc2cf-root.oc2cf-open .oc2cf-launcher .oc2cf-icon-close {
	display: block;
}

/* ---------- Panel ---------- */

.oc2cf-panel {
	position: fixed;
	right: 24px;
	bottom: 100px;
	z-index: 99999;
	width: 370px;
	max-width: calc(100vw - 48px);
	max-height: min(600px, calc(100vh - 140px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: var(--oc2cf-radius);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px);
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.oc2cf-root.oc2cf-open .oc2cf-panel {
	opacity: 1;
	transform: translateY(0);
	visibility: visible;
	pointer-events: auto;
}

/* ---------- Header ---------- */

.oc2cf-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: linear-gradient(135deg, var(--oc2cf-primary), var(--oc2cf-primary-dark));
	color: #fff;
	flex-shrink: 0;
}

.oc2cf-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.oc2cf-close {
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	padding: 4px;
	line-height: 0;
	border-radius: 8px;
	flex-shrink: 0;
	transition: background-color 0.15s ease;
}

.oc2cf-close:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* ---------- Messages ---------- */

.oc2cf-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #fff;
	scroll-behavior: smooth;
}

.oc2cf-msg {
	max-width: 85%;
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--oc2cf-text);
	word-break: break-word;
}

.oc2cf-bot {
	align-self: flex-start;
	background: #f1f5f7;
	border-radius: var(--oc2cf-radius);
	border-bottom-left-radius: 4px;
}

.oc2cf-user {
	align-self: flex-end;
	background: var(--oc2cf-primary);
	color: #fff;
	border-radius: var(--oc2cf-radius);
	border-bottom-right-radius: 4px;
}

/* ---------- Typing indicator ---------- */

.oc2cf-typing {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 14px;
}

.oc2cf-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9fb2bc;
	animation: oc2cf-pulse 1s ease-in-out infinite;
}

.oc2cf-dot:nth-child(2) {
	animation-delay: 0.15s;
}

.oc2cf-dot:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes oc2cf-pulse {
	0%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}
	50% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

/* ---------- Option chips ---------- */

.oc2cf-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-self: flex-start;
	max-width: 100%;
	padding: 2px 0;
}

.oc2cf-chip {
	border: 1px solid var(--oc2cf-primary);
	background: #fff;
	color: var(--oc2cf-primary);
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 13px;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.oc2cf-chip:hover {
	background: var(--oc2cf-primary);
	color: #fff;
}

.oc2cf-chip-selected,
.oc2cf-chip-selected:hover {
	background: var(--oc2cf-primary);
	color: #fff;
}

/* ---------- Star rating ---------- */

.oc2cf-stars {
	flex-wrap: nowrap;
	gap: 4px;
	align-items: center;
}

.oc2cf-star {
	border: 0;
	background: transparent;
	padding: 0 2px;
	font-size: 30px;
	line-height: 1;
	color: #c3c4c7;
	cursor: pointer;
	transition: color 0.15s ease, transform 0.15s ease;
}

.oc2cf-star:hover {
	transform: scale(1.1);
}

.oc2cf-star-hover {
	color: #dba617;
}

.oc2cf-star:focus-visible {
	outline: 2px solid var(--oc2cf-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Stars echoed in the visitor's bubble inherit the bubble text color. */

/* ---------- Link button ---------- */

.oc2cf-link-row {
	align-self: flex-start;
	padding: 2px 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.oc2cf-link-btn {
	display: inline-block;
	background: var(--oc2cf-primary);
	color: #fff;
	text-decoration: none;
	border: 2px solid var(--oc2cf-primary);
	border-radius: 999px;
	padding: 9px 20px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.01em;
	transition: background-color 0.15s ease, border-color 0.15s ease,
		color 0.15s ease, transform 0.15s ease;
}

.oc2cf-link-btn:hover {
	background: var(--oc2cf-primary-dark);
	border-color: var(--oc2cf-primary-dark);
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
}

.oc2cf-link-btn:focus-visible {
	outline: 2px solid var(--oc2cf-primary-dark);
	outline-offset: 2px;
}

/* Secondary: outlined, clearly lighter than the primary action */
.oc2cf-link-btn.oc2cf-link-btn--secondary {
	background: #fff;
	color: var(--oc2cf-primary-dark);
	border-color: var(--oc2cf-primary);
}

.oc2cf-link-btn.oc2cf-link-btn--secondary:hover {
	background: rgba(0, 197, 228, 0.1);
	color: var(--oc2cf-primary-dark);
	border-color: var(--oc2cf-primary-dark);
	transform: translateY(-1px);
}

/* ---------- Footer / confirm ---------- */

.oc2cf-footer {
	flex-shrink: 0;
}

.oc2cf-footer:not(:empty) {
	padding: 12px 16px;
	border-top: 1px solid #e7edf0;
	background: #fff;
}

.oc2cf-confirm {
	width: 100%;
	border: 0;
	background: var(--oc2cf-primary);
	color: #fff;
	border-radius: 999px;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.oc2cf-confirm:hover:not(:disabled) {
	background: var(--oc2cf-primary-dark);
}

.oc2cf-confirm:disabled {
	opacity: 0.5;
	cursor: default;
}

/* ---------- Restart row ---------- */

.oc2cf-restart-row {
	align-self: center;
	padding: 6px 0 2px;
}

.oc2cf-restart {
	border: 1px solid var(--oc2cf-primary);
	background: transparent;
	color: var(--oc2cf-primary);
	border-radius: 999px;
	padding: 8px 18px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.oc2cf-restart:hover {
	background: var(--oc2cf-primary);
	color: #fff;
}

/* ---------- Mobile ---------- */

@media (max-width: 480px) {
	.oc2cf-panel {
		left: 12px;
		right: 12px;
		bottom: 90px;
		width: auto;
		max-width: none;
	}
}
