/*
 * Floating Contact Widget — Frontend Styles
 *
 * Fixed FAB-style widget, bottom-right corner.
 * Pure CSS animations; no JavaScript dependency for visuals.
 *
 * @package WebgoolChat
 */

/* ===========================================
   1. Widget container
   =========================================== */
.wgc-widget {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

/* ===========================================
   2. Shared button base
   =========================================== */
.wgc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	text-decoration: none;
	flex-shrink: 0;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	cursor: pointer;
}

.wgc-btn:hover,
.wgc-btn:focus-visible {
	transform: scale(1.1);
	box-shadow: 0 5px 16px rgba(0, 0, 0, 0.38);
	outline: none;
}

.wgc-btn svg {
	width: 26px;
	height: 26px;
	pointer-events: none;
	flex-shrink: 0;
}

/* ===========================================
   3. Channel brand colours
   =========================================== */
.wgc-channel-phone      { background-color: #4CAF50; }
.wgc-channel-zalo       { background-color: #0068FF; }
.wgc-channel-whatsapp   { background-color: #25D366; }
.wgc-channel-viber      { background-color: #7360F2; }
.wgc-channel-kakaotalk  { background-color: #FAE100; }
.wgc-channel-wechat     { background-color: #07C160; }
.wgc-channel-googlemaps { background-color: #EA4335; }

/* ===========================================
   4. Main toggle button
   =========================================== */
.wgc-toggle {
	position: relative;
	width: 60px;
	height: 60px;
	background-color: #5D4037;
	border: none;
	/* Sits below .wgc-items in the flex column */
	order: 2;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wgc-toggle:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.wgc-widget.is-open .wgc-toggle {
	background-color: #4E342E;
}

/* Icon layers — open icon visible by default */
.wgc-icon-open,
.wgc-icon-close {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.25s ease, transform 0.3s ease;
}

.wgc-icon-open {
	opacity: 1;
	transform: rotate(0deg);
}

.wgc-icon-close {
	opacity: 0;
	transform: rotate(-90deg);
}

.wgc-widget.is-open .wgc-icon-open {
	opacity: 0;
	transform: rotate(90deg);
}

.wgc-widget.is-open .wgc-icon-close {
	opacity: 1;
	transform: rotate(0deg);
}

/* ===========================================
   5. Items container
   =========================================== */
.wgc-items {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	/* Sits above .wgc-toggle in the flex column */
	order: 1;
}

/* --- Hidden state (each button) --- */
.wgc-items .wgc-btn {
	opacity: 0;
	transform: scale(0.4) translateY(16px);
	pointer-events: none;
	/* Default transition (used when closing — no stagger, all collapse fast) */
	transition: opacity 0.18s ease, transform 0.18s ease;
	transition-delay: 0s;
}

/* --- Open state (each button) --- */
.wgc-widget.is-open .wgc-items .wgc-btn {
	opacity: 1;
	transform: scale(1) translateY(0);
	pointer-events: auto;
	transition-duration: 0.28s;
}

/*
 * Stagger: bottom item (nth-last-child(1)) nearest the toggle appears first.
 * Works regardless of how many channels are enabled (1-7).
 */
.wgc-widget.is-open .wgc-items .wgc-btn:nth-last-child(1) { transition-delay: 0.00s; }
.wgc-widget.is-open .wgc-items .wgc-btn:nth-last-child(2) { transition-delay: 0.05s; }
.wgc-widget.is-open .wgc-items .wgc-btn:nth-last-child(3) { transition-delay: 0.10s; }
.wgc-widget.is-open .wgc-items .wgc-btn:nth-last-child(4) { transition-delay: 0.15s; }
.wgc-widget.is-open .wgc-items .wgc-btn:nth-last-child(5) { transition-delay: 0.20s; }
.wgc-widget.is-open .wgc-items .wgc-btn:nth-last-child(6) { transition-delay: 0.25s; }
.wgc-widget.is-open .wgc-items .wgc-btn:nth-last-child(7) { transition-delay: 0.30s; }

/* ===========================================
   6. Reduced-motion preference
   =========================================== */
@media (prefers-reduced-motion: reduce) {
	.wgc-btn,
	.wgc-icon-open,
	.wgc-icon-close,
	.wgc-items .wgc-btn {
		transition: none !important;
		transition-delay: 0s !important;
	}
}
