/**
 * Rowsbot Frontend Widget Styles
 *
 * @package Rowsbot_Pro
 * @author  SellPlug
 * @link    https://sellplug.com/rowsbot
 */

/* ==========================================================================
   1. CSS VARIABLES & ROOT CONFIGURATION
   ========================================================================== */

:root {
	--rowsbot-pro-primary: #2563eb;
}

/* ==========================================================================
   2. MAIN WIDGET CONTAINER & POSITIONING
   ========================================================================== */

#rowsbot-pro-widget {
	position: fixed;
	bottom: 24px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	display: none;
}

#rowsbot-pro-widget.rowsbot-pro-pos-right {
	right: 24px;
}

#rowsbot-pro-widget.rowsbot-pro-pos-left {
	left: 24px;
}

/* ==========================================================================
   3. LAUNCHER BUBBLE ICON
   ========================================================================== */

#rowsbot-pro-bubble {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--rowsbot-pro-primary);
	color: #fff;
	font-size: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
	transition: transform 0.2s;
}

#rowsbot-pro-bubble:hover {
	transform: scale(1.08);
}

/* ==========================================================================
   4. CHAT BOX CONTAINER & HEADER
   ========================================================================== */

#rowsbot-pro-box {
	display: none;
	position: absolute;
	bottom: 68px;
	width: 340px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	flex-direction: column;
}

.rowsbot-pro-pos-right #rowsbot-pro-box {
	right: 0;
}

.rowsbot-pro-pos-left #rowsbot-pro-box {
	left: 0;
}

#rowsbot-pro-box.rowsbot-pro-open {
	display: flex;
}

#rowsbot-pro-header {
	background: var(--rowsbot-pro-primary);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

#rowsbot-pro-title {
	font-weight: 700;
	font-size: 15px;
}

#rowsbot-pro-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 20px;
	cursor: pointer;
}

/* ==========================================================================
   5. MESSAGE LOG, BUBBLES & TYPING ANIMATION
   ========================================================================== */

#rowsbot-pro-messages {
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 180px;
	max-height: 320px;
}

.rowsbot-pro-msg {
	max-width: 82%;
	padding: 9px 13px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.5;
	word-break: break-word;
}

.rowsbot-pro-msg-bot {
	background: #eff6ff;
	color: #1e293b;
	align-self: flex-start;
	border-bottom-left-radius: 3px;
}

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

.rowsbot-pro-typing span {
	display: inline-block;
	width: 7px;
	height: 7px;
	background: #94a3b8;
	border-radius: 50%;
	margin: 0 2px;
	animation: rbp-b 1s infinite;
}

.rowsbot-pro-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.rowsbot-pro-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes rbp-b {
	0%,
	80%,
	100% {
		transform: translateY(0);
	}

	40% {
		transform: translateY(-6px);
	}
}

/* ==========================================================================
   6. INPUT BAR & CONTROLS
   ========================================================================== */

#rowsbot-pro-input-area {
	display: flex;
	border-top: 1px solid #e2e8f0;
	padding: 10px 12px;
	gap: 8px;
	align-items: center;
}

#rowsbot-pro-input {
	flex: 1;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 8px 11px;
	font-size: 14px;
	outline: none;
	color: #1e293b;
}

#rowsbot-pro-input::placeholder, 
#rowsbot-pro-input:-ms-input-placeholder,
#rowsbot-pro-input::-ms-input-placeholder {
	color: #94a3b8;
}

#rowsbot-pro-input:focus {
	border-color: var(--rowsbot-pro-primary);
}

#rowsbot-pro-send {
	background: var(--rowsbot-pro-primary);
	color: #fff;
	border: none;
	border-radius: 8px;
	width: 36px;
	height: 36px;
	font-size: 16px;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
}

/* ==========================================================================
   7. LEAD CAPTURE FORM & FEEDBACK
   ========================================================================== */

#rowsbot-pro-lead-form {
	padding: 14px;
	border-top: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

#rowsbot-pro-lead-form:empty {
	display: none;
}

#rowsbot-pro-lead-form input,
#rowsbot-pro-lead-form select {
	width: 100%;
	border: 1px solid #cbd5e1;
	border-radius: 7px;
	padding: 8px 11px;
	font-size: 13px;
	box-sizing: border-box;
	color: #1e293b;
}

#rowsbot-pro-lead-form button {
	background: var(--rowsbot-pro-primary);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
}

.rowsbot-pro-gdpr-label {
	display: block;
	font-size: 12px;
	line-height: 1.4;
	margin: 8px 0;
}

.rowsbot-pro-gdpr-checkbox {
	margin-right: 6px;
}

.rowsbot-pro-lead-success {
	color: #16a34a;
	font-weight: 600;
	text-align: center;
	padding: 10px;
}

/* ==========================================================================
   8. REVIEW CALL-TO-ACTION & RESPONSIVE RULES
   ========================================================================== */

.rowsbot-pro-review-cta {
	background: #fefce8;
	border: 1px solid #fde047;
	border-radius: 9px;
	padding: 10px;
	margin: 8px 14px;
	font-size: 13px;
	text-align: center;
}

.rowsbot-pro-review-link {
	color: var(--rowsbot-pro-primary);
	font-weight: 600;
}

@media (max-width: 480px) {
	#rowsbot-pro-box {
		width: calc(100vw - 32px);
	}
}