/* Golsorkh Live Chat — floating widget
   All colors/sizes come from CSS custom properties injected inline by
   GLC_Frontend so every value is fully editable from wp-admin. */

#glc-chat-root, #glc-chat-root * { box-sizing: border-box; }

#glc-chat-root {
	font-family: var(--glc-font, inherit);
	direction: rtl;
	line-height: 1.6;
}

/* ---------- Launcher ---------- */
.glc-launcher {
	position: fixed;
	bottom: var(--glc-bottom-spacing, 20px);
	z-index: 2147483000;
	width: var(--glc-launcher-size, 62px);
	height: var(--glc-launcher-size, 62px);
	border-radius: 50%;
	background: var(--glc-launcher-bg, #C2185B);
	color: var(--glc-launcher-icon, #fff);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 24px rgba(0,0,0,.22);
	transition: transform .18s ease, box-shadow .18s ease;
}
#glc-chat-root[data-position="right"] .glc-launcher { right: var(--glc-side-spacing, 20px); }
#glc-chat-root[data-position="left"] .glc-launcher { left: var(--glc-side-spacing, 20px); }
.glc-launcher:hover { transform: scale(1.06); box-shadow: 0 10px 30px rgba(0,0,0,.28); }
.glc-launcher:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.glc-launcher img { width: 55%; height: 55%; object-fit: contain; }
.glc-launcher-icon-close { display: none; }
#glc-chat-root.glc-widget-open .glc-launcher-icon-open { display: none; }
#glc-chat-root.glc-widget-open .glc-launcher-icon-close { display: flex; }

.glc-unread-dot {
	position: absolute;
	top: -2px;
	inset-inline-end: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: #ff3b30;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: none;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
}

/* ---------- Window ---------- */
.glc-window {
	position: fixed;
	bottom: calc(var(--glc-bottom-spacing, 20px) + var(--glc-launcher-size, 62px) + 18px);
	z-index: 2147483000;
	width: var(--glc-window-width, 380px);
	height: var(--glc-window-height, 580px);
	max-width: calc(100vw - 24px);
	max-height: calc(100vh - var(--glc-bottom-spacing, 20px) - var(--glc-launcher-size, 62px) - 58px);
	background: #fff;
	border-radius: var(--glc-radius, 18px);
	box-shadow: 0 20px 60px rgba(0,0,0,.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(.97);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
#glc-chat-root[data-position="right"] .glc-window { right: var(--glc-side-spacing, 20px); }
#glc-chat-root[data-position="left"] .glc-window { left: var(--glc-side-spacing, 20px); }
.glc-window.glc-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
	.glc-window, .glc-launcher { transition: none; }
}

/* ---------- Header ---------- */
.glc-header {
	background: linear-gradient(135deg, var(--glc-header-bg, #C2185B), var(--glc-header-bg-2, #6B1029));
	color: var(--glc-header-text, #fff);
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}
.glc-header-title { font-weight: 700; font-size: 15px; }
.glc-header-sub { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.glc-online-dot { width: 7px; height: 7px; border-radius: 50%; background: #35d07f; display: inline-block; }
.glc-header-close {
	background: rgba(255,255,255,.16);
	border: none;
	color: inherit;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}
.glc-header-close:hover { background: rgba(255,255,255,.28); }

/* ---------- Body ---------- */
.glc-body {
	flex: 1;
	overflow-y: auto;
	background: var(--glc-body-bg, #FAF5F3);
	padding: 16px;
	scrollbar-width: thin;
}
.glc-body::-webkit-scrollbar { width: 6px; }
.glc-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 3px; }

.glc-messages { display: flex; flex-direction: column; margin-bottom: 6px; }
.glc-msg-row { clear: both; overflow: hidden; margin-bottom: 10px; }
.glc-msg-bubble {
	display: inline-block;
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 13.5px;
	line-height: 1.75;
	position: relative;
	animation: glc-pop .18s ease;
}
@keyframes glc-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.glc-msg-row.visitor .glc-msg-bubble {
	float: right;
	background: var(--glc-visitor-bubble, #C2185B);
	color: var(--glc-visitor-text, #fff);
	border-bottom-right-radius: 4px;
}
.glc-msg-row.admin .glc-msg-bubble, .glc-msg-row.bot .glc-msg-bubble {
	float: left;
	background: var(--glc-admin-bubble, #fff);
	color: var(--glc-admin-text, #3A2530);
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.glc-msg-row p { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }
.glc-msg-time { display: block; font-size: 10px; opacity: .7; margin-top: 3px; }
.glc-bot-tag { float: left; clear: both; font-size: 10.5px; color: #a8598a; margin: 0 2px 3px; }
.glc-msg-image { max-width: 200px; border-radius: 10px; display: block; margin-top: 2px; }
.glc-msg-video { max-width: 220px; border-radius: 10px; display: block; margin-top: 2px; }
.glc-msg-file { color: inherit; text-decoration: underline; display: inline-block; margin-top: 2px; }
.glc-msg-row audio { max-width: 220px; margin-top: 2px; }

.glc-uploading .glc-msg-bubble { opacity: .55; }
.glc-upload-failed .glc-msg-bubble { outline: 2px solid #ff3b30; }

/* ---------- FAQ menu ---------- */
.glc-faq-menu { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; clear: both; }
.glc-faq-title { font-size: 12px; color: #8a6a72; font-weight: 600; margin-bottom: 2px; }
.glc-faq-btn {
	background: #fff;
	border: 1.5px solid var(--glc-accent, #C2185B);
	color: var(--glc-accent, #C2185B);
	border-radius: 999px;
	padding: 9px 16px;
	font-size: 13px;
	text-align: right;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.glc-faq-btn:hover { background: var(--glc-accent, #C2185B); color: var(--glc-accent-text, #fff); }

/* ---------- Pre-chat form ---------- */
.glc-prechat p { font-size: 13px; color: #6b4b53; margin-top: 0; }
.glc-prechat input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #e6d5da;
	border-radius: 10px;
	margin-bottom: 10px;
	font-size: 13.5px;
	font-family: inherit;
}
.glc-prechat-submit { width: 100%; justify-content: center; border-radius: 10px !important; }

/* ---------- Footer / input ---------- */
.glc-footer { flex-shrink: 0; background: #fff; border-top: 1px solid #eee0dc; padding: 10px 12px; }
.glc-input-row { display: flex; align-items: flex-end; gap: 6px; }
.glc-icon-btn {
	background: transparent;
	border: none;
	color: #9a7079;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}
.glc-icon-btn:hover { background: #f4e8ea; color: var(--glc-accent, #C2185B); }
#glc-text-input {
	flex: 1;
	resize: none;
	border: 1px solid #e6d5da;
	border-radius: 18px;
	padding: 9px 14px;
	font-size: 13.5px;
	max-height: 90px;
	font-family: inherit;
	line-height: 1.5;
}
#glc-text-input:focus { outline: none; border-color: var(--glc-accent, #C2185B); }
.glc-send-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--glc-accent, #C2185B);
	color: var(--glc-accent-text, #fff);
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: transform .12s ease;
}
.glc-send-btn:hover { transform: scale(1.06); }

.glc-recording-row { display: none; align-items: center; gap: 10px; padding: 4px 6px; }
.glc-rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; animation: glc-blink 1s infinite; }
@keyframes glc-blink { 50% { opacity: .3; } }
#glc-rec-timer { font-size: 13px; color: #6b4b53; flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
	.glc-launcher {
		right: 12px !important;
		left: auto !important;
		bottom: 12px !important;
	}
	#glc-chat-root[data-position="left"] .glc-launcher {
		left: 12px !important;
		right: auto !important;
	}
	.glc-window {
		width: calc(100vw - 24px) !important;
		height: calc(100vh - 110px) !important;
		max-height: none !important;
		right: 12px !important;
		left: 12px !important;
		bottom: 86px !important;
	}
}

/* ---------- Elementor "open chat" button ---------- */
.glc-elementor-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border: none;
	border-radius: 10px;
	background: #C2185B;
	color: #fff;
	font-size: 15px;
	cursor: pointer;
	font-family: inherit;
}
.glc-elementor-btn:hover { filter: brightness(1.05); }
.glc-elementor-btn-icon { font-size: 16px; line-height: 1; }
