/**
 * CSFX Social Widget styles.
 * Classes are prefixed with .csfx- to avoid clashing with theme styles.
 */

:root {
	--csfx-sw-brand: #00FF00;           /* outer circle for every button */
	--csfx-sw-brand-ink: #000000;       /* icon color on every button */
	--csfx-sw-hover-bg: #000000;        /* outer circle becomes solid black on hover */
	--csfx-sw-shadow: 0 8px 20px rgba(0, 0, 0, .3);
	--csfx-sw-btn-size: 42px;
	--csfx-sw-icon-size: 18px;
	--csfx-sw-gap: 10px;
	--csfx-sw-offset: 24px;
}

.csfx-social-widget {
	position: fixed;
	right: var(--csfx-sw-offset);
	bottom: var(--csfx-sw-offset);
	display: flex;
	flex-direction: column-reverse; /* toggle stays anchored at bottom, items stack upward */
	align-items: center;
	gap: var(--csfx-sw-gap);
	z-index: 9999;
}

.csfx-social-widget.csfx-sw-left {
	right: auto;
	left: var(--csfx-sw-offset);
}

.csfx-sw-btn {
	width: var(--csfx-sw-btn-size);
	height: var(--csfx-sw-btn-size);
	border-radius: 50%;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--csfx-sw-shadow);
	background: var(--csfx-sw-brand);
	color: var(--csfx-sw-brand-ink);
	padding: 0;
	font-family: inherit;
	transition: background-color .2s ease, transform .2s ease;
}

/* Every button (toggle + channel items) fills solid black on hover/focus. */
.csfx-sw-btn:hover,
.csfx-sw-btn:focus-visible {
	background-color: var(--csfx-sw-hover-bg);
}

.csfx-sw-btn svg {
	width: var(--csfx-sw-icon-size);
	height: var(--csfx-sw-icon-size);
}

/* Toggle button */
.csfx-sw-toggle {
	position: relative;
}
.csfx-sw-toggle:hover {
	transform: scale(1.06);
}

.csfx-sw-toggle .icon-chat,
.csfx-sw-toggle .icon-close {
	position: absolute;
	transition: opacity .2s ease, transform .2s ease, color .2s ease;
}
.csfx-sw-toggle .icon-close {
	opacity: 0;
	transform: rotate(-45deg) scale(.6);
}
.csfx-sw-toggle .icon-chat {
	opacity: 1;
	transform: rotate(0) scale(1);
}

/* Keep the toggle icon visible on hover instead of vanishing into the black fill. */
.csfx-sw-toggle:hover .icon-chat,
.csfx-sw-toggle:hover .icon-close {
	color: var(--csfx-sw-brand);
}

.csfx-social-widget.open .csfx-sw-toggle .icon-chat {
	opacity: 0;
	transform: rotate(45deg) scale(.6);
}
.csfx-social-widget.open .csfx-sw-toggle .icon-close {
	opacity: 1;
	transform: rotate(0) scale(1);
}

/* Menu items — same green outer / black icon theme as the toggle, uniform across every channel */
.csfx-sw-item {
	opacity: 0;
	transform: translateY(12px) scale(.7);
	pointer-events: none;
	transition: opacity .22s ease, transform .22s ease, background-color .2s ease;
	text-decoration: none;
	position: relative;
}

.csfx-social-widget.open .csfx-sw-item {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	transition-delay: .04s; /* one flat delay — robust regardless of how many channels are enabled */
}

@media (max-width: 600px) {
	:root {
		--csfx-sw-btn-size: 36px;
		--csfx-sw-icon-size: 15px;
		--csfx-sw-gap: 8px;
		--csfx-sw-offset: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.csfx-sw-toggle,
	.csfx-sw-item,
	.csfx-sw-toggle .icon-chat,
	.csfx-sw-toggle .icon-close {
		transition: none;
	}
}

/* ---------- Click to Call modal ---------- */
.csfx-sw-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.csfx-sw-modal[hidden] {
	display: none;
}
.csfx-sw-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 20, 35, .55);
	border: none;
	cursor: pointer;
}
.csfx-sw-modal-panel {
	position: relative;
	background: #fff;
	border-radius: 12px;
	max-width: 420px;
	width: 100%;
	max-height: 86vh;
	overflow: auto;
	padding: 32px 24px 24px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.csfx-sw-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: #f1f2f4;
	color: #1c2027;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}
.csfx-sw-modal-close:hover {
	background: #e4e6e9;
}
