/* گفتیران - استایل پایه ویجت گفتگو | باران سایت */
#goftiran-widget, #goftiran-widget * {
	box-sizing: border-box;
	font-family: 'Vazirmatn', Tahoma, sans-serif !important;
	direction: rtl;
}

#goftiran-widget {
	position: fixed;
	z-index: 999999;
}

/* موقعیت آیکون شناور */
.goftiran-pos-bottom-right { bottom: var(--goftiran-my); right: var(--goftiran-mx); }
.goftiran-pos-bottom-left  { bottom: var(--goftiran-my); left: var(--goftiran-mx); }
.goftiran-pos-top-right    { top: var(--goftiran-my); right: var(--goftiran-mx); }
.goftiran-pos-top-left     { top: var(--goftiran-my); left: var(--goftiran-mx); }

#goftiran-launcher {
	border: none;
	border-radius: 50%;
	background: var(--goftiran-icon-bg, #2f6feb);
	color: #fff;
	font-size: 26px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 24px rgba(0,0,0,.2);
	position: relative;
	transition: transform .2s ease, box-shadow .2s ease;
}
#goftiran-launcher:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 28px rgba(0,0,0,.25); }
#goftiran-launcher .goftiran-close-i { display: none; }
#goftiran-widget.goftiran-open #goftiran-launcher .goftiran-close-i { display: flex; }
#goftiran-widget.goftiran-open #goftiran-launcher > i:first-child { display: none; }

.goftiran-pulse {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(47,111,235,.6);
	animation: goftiran-pulse-anim 2s infinite;
	pointer-events: none;
}
@keyframes goftiran-pulse-anim {
	0%   { box-shadow: 0 0 0 0 rgba(47,111,235,.5); }
	70%  { box-shadow: 0 0 0 14px rgba(47,111,235,0); }
	100% { box-shadow: 0 0 0 0 rgba(47,111,235,0); }
}

#goftiran-launcher-text {
	position: absolute;
	bottom: calc(var(--goftiran-my) + 4px);
	background: #fff;
	color: #222;
	padding: 8px 14px;
	border-radius: 999px;
	box-shadow: 0 6px 18px rgba(0,0,0,.15);
	font-size: 13px;
	white-space: nowrap;
	pointer-events: none;
	opacity: .97;
}
.goftiran-pos-bottom-right ~ #goftiran-launcher-text,
.goftiran-pos-bottom-right #goftiran-launcher-text { right: calc(var(--goftiran-mx) + 74px); }
.goftiran-pos-bottom-left #goftiran-launcher-text { left: calc(var(--goftiran-mx) + 74px); }
#goftiran-widget.goftiran-open #goftiran-launcher-text { display: none; }

/* باکس چت */
#goftiran-box {
	position: fixed;
	bottom: calc(var(--goftiran-my) + 80px);
	width: var(--goftiran-box-w, 380px);
	height: var(--goftiran-box-h, 560px);
	max-width: calc(100vw - 24px);
	max-height: calc(100vh - 110px);
	background: #fff;
	border-radius: var(--goftiran-radius, 16px);
	box-shadow: 0 16px 48px rgba(0,0,0,.22);
	display: none;
	flex-direction: column;
	overflow: hidden;
}
.goftiran-pos-bottom-right #goftiran-box { right: var(--goftiran-mx); }
.goftiran-pos-bottom-left  #goftiran-box { left: var(--goftiran-mx); }
.goftiran-pos-top-right    #goftiran-box { top: calc(var(--goftiran-my) + 80px); right: var(--goftiran-mx); }
.goftiran-pos-top-left     #goftiran-box { top: calc(var(--goftiran-my) + 80px); left: var(--goftiran-mx); }

#goftiran-widget.goftiran-open #goftiran-box { display: flex; }

#goftiran-box.goftiran-fullscreen {
	position: fixed !important;
	inset: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	max-width: 100vw !important;
	max-height: 100vh !important;
	border-radius: 0 !important;
}

#goftiran-header {
	background: var(--goftiran-primary, #2f6feb);
	color: #fff;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}
#goftiran-header-info { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
#goftiran-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; display: inline-block; }
#goftiran-status-dot.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
#goftiran-header-actions { display: flex; gap: 4px; }
.goftiran-icon-btn {
	background: rgba(255,255,255,.15);
	border: none;
	color: #fff;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
	font-size: 13px;
}
.goftiran-icon-btn:hover { background: rgba(255,255,255,.3); }

#goftiran-social-panel {
	display: flex;
	gap: 10px;
	padding: 10px 16px;
	background: #f8f9fb;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
}
#goftiran-social-panel a {
	width: 34px; height: 34px;
	border-radius: 50%;
	background: #fff;
	display: flex; align-items: center; justify-content: center;
	color: #444;
	box-shadow: 0 2px 6px rgba(0,0,0,.08);
	text-decoration: none;
}

.goftiran-panel {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
}
.goftiran-hidden { display: none !important; }

.goftiran-welcome {
	background: #f1f5fb;
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 14px;
	line-height: 1.8;
	margin: 0 0 14px;
}

.goftiran-faq-title { font-size: 13px; color: #888; margin-bottom: 8px; }
.goftiran-faq-btn {
	display: block;
	width: 100%;
	text-align: right;
	background: #fff;
	border: 1px solid #e2e5ea;
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 8px;
	cursor: pointer;
	font-size: 13.5px;
	transition: border-color .15s, background .15s;
}
.goftiran-faq-btn:hover { border-color: var(--goftiran-primary); background: #f8faff; }
#goftiran-faq-answer {
	background: #eef4ff;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 13.5px;
	margin-bottom: 14px;
	line-height: 1.8;
}

#goftiran-start-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
#goftiran-start-form label { font-size: 13px; color: #555; display: flex; flex-direction: column; gap: 5px; }
#goftiran-start-form input {
	border: 1px solid #dfe3e8;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	outline: none;
	transition: border-color .15s;
}
#goftiran-start-form input:focus { border-color: var(--goftiran-primary); }
.goftiran-honeypot { position: absolute !important; left: -9999px !important; opacity: 0; height:0; width:0; }

.goftiran-btn-primary {
	background: var(--goftiran-primary, #2f6feb);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 11px;
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	transition: filter .15s;
}
.goftiran-btn-primary:hover { filter: brightness(1.08); }
.goftiran-field-error { border-color: #e33 !important; }

/* حباب پیام‌ها */
.goftiran-msg { display: flex; margin-bottom: 10px; }
.goftiran-msg-bubble {
	max-width: 78%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 13.8px;
	line-height: 1.75;
	position: relative;
}
.goftiran-msg.visitor { justify-content: flex-start; }
.goftiran-msg.admin { justify-content: flex-end; }
.goftiran-msg.visitor .goftiran-msg-bubble { background: #eef2f6; color: #222; border-bottom-left-radius: 4px; }
.goftiran-msg.admin .goftiran-msg-bubble { background: var(--goftiran-primary, #2f6feb); color: #fff; border-bottom-right-radius: 4px; }
.goftiran-msg-time { font-size: 10px; opacity: .65; display: block; margin-top: 4px; }

#goftiran-send-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #eee;
	flex-shrink: 0;
}
#goftiran-send-form textarea {
	flex: 1;
	resize: none;
	border: 1px solid #dfe3e8;
	border-radius: 12px;
	padding: 9px 12px;
	font-size: 13.8px;
	max-height: 90px;
	outline: none;
}
#goftiran-send-form textarea:focus { border-color: var(--goftiran-primary); }
#goftiran-send-form button {
	background: var(--goftiran-primary, #2f6feb);
	color: #fff;
	border: none;
	width: 40px; height: 40px;
	border-radius: 50%;
	cursor: pointer;
	flex-shrink: 0;
	display: flex; align-items: center; justify-content: center;
}

#goftiran-copyright {
	text-align: center;
	font-size: 11px;
	color: #9aa0a6;
	padding: 6px 8px 10px;
	flex-shrink: 0;
}
#goftiran-copyright a { color: #6b7280; text-decoration: none; }
#goftiran-copyright a.goftiran-pro-label { color: #d63384; font-weight: 700; }

#goftiran-resize-handle {
	position: absolute;
	top: 6px;
	left: 6px;
	width: 16px;
	height: 16px;
	cursor: nwse-resize;
	opacity: .35;
}

/* ریسپانسیو موبایل */
@media (max-width: 480px) {
	#goftiran-box {
		width: calc(100vw - 20px) !important;
		height: calc(100vh - 100px) !important;
		right: 10px !important;
		left: 10px !important;
		bottom: 90px !important;
	}
	#goftiran-launcher-text { display: none !important; }
}
