/**
 * Frontend Styles - Wesal Widget
 * 
 * @package Wesal
 */

/* === Widget Container === */
.wesal-widget {
	position: fixed;
	bottom: 30px;
	right: 30px;
	z-index: 10000;
	font-family: inherit;
}

.wesal-widget[data-platform="whatsapp"] {
	--wesal-accent: #25D366;
	--wesal-accent-dark: #128C7E;
	--wesal-accent-shadow: rgba(37, 211, 102, 0.4);
	--wesal-accent-shadow-strong: rgba(37, 211, 102, 0.6);
	--wesal-accent-soft: #f0fdf4;
}

.wesal-widget[data-platform="telegram"] {
	--wesal-accent: #0088cc;
	--wesal-accent-dark: #0066aa;
	--wesal-accent-shadow: rgba(0, 136, 204, 0.4);
	--wesal-accent-shadow-strong: rgba(0, 136, 204, 0.6);
	--wesal-accent-soft: #e6f4fb;
}

/* === Main Button === */
.wesal-widget-button {
	width: 70px;
	height: 70px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 25px var(--wesal-accent-shadow);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	border: none;
	animation: wesal-pulse 2s infinite;
	position: relative;
}

.wesal-widget[data-platform="whatsapp"] .wesal-widget-button {
	background: linear-gradient(135deg, var(--wesal-accent) 0%, var(--wesal-accent-dark) 100%);
}

.wesal-widget[data-platform="telegram"] .wesal-widget-button {
	background: linear-gradient(135deg, var(--wesal-accent) 0%, var(--wesal-accent-dark) 100%);
}

.wesal-widget-button:hover {
	transform: scale(1.1) rotate(10deg);
	box-shadow: 0 12px 35px var(--wesal-accent-shadow-strong);
}

.wesal-widget-button,
.wesal-header-avatar,
.wesal-chat-now {
	color: #ffffff;
}

.wesal-widget-button svg {
	width: 36px;
	height: 36px;
	fill: currentColor;
}

/* === Status Indicator === */
.wesal-status-indicator {
	position: absolute;
	top: -5px;
	left: -5px;
	width: 20px;
	height: 20px;
	background: #10B981;
	border: 3px solid white;
	border-radius: 50%;
	animation: wesal-blink 1.5s infinite;
}

/* === Widget Panel === */
.wesal-widget-panel {
	position: absolute;
	bottom: 90px;
	right: 0;
	width: 320px;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
	opacity: 0;
	transform: translateY(20px) scale(0.9);
	visibility: hidden;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	padding: 25px;
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.wesal-widget-panel.wesal-active {
	opacity: 1;
	transform: translateY(0) scale(1);
	visibility: visible;
}

/* === Close Button === */
.wesal-close-widget {
	position: absolute;
	top: 15px;
	left: 15px;
	background: none;
	border: none;
	font-size: 20px;
	color: #9ca3af;
	cursor: pointer;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.3s ease;
}

.wesal-close-widget svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.wesal-close-widget:hover {
	background: #fee2e2;
	color: #ef4444;
}

/* === Widget Header === */
.wesal-widget-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 2px solid #f0f0f0;
}

.wesal-header-avatar {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 24px;
}

.wesal-header-avatar svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}

.wesal-header-info h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #1f2937;
	line-height: 1.3;
}

.wesal-header-info p {
	margin: 0;
	font-size: 14px;
	color: #6b7280;
	font-weight: 500;
}

/* === Widget Message === */
.wesal-widget-message {
	background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
	border-radius: 18px;
	padding: 18px;
	margin-bottom: 20px;
	font-size: 15px;
	line-height: 1.6;
	color: #374151;
}

.wesal-widget[data-platform="whatsapp"] .wesal-widget-message {
	border-right: 4px solid var(--wesal-accent);
}

.wesal-widget[data-platform="telegram"] .wesal-widget-message {
	border-right: 4px solid var(--wesal-accent);
}

/* === Quick Actions === */
.wesal-quick-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.wesal-quick-btn {
	background: white;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	padding: 12px 16px;
	color: #374151;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
}

.wesal-quick-btn:hover {
	background: var(--wesal-accent-soft);
	transform: translateX(-5px);
}

.wesal-widget[data-platform="whatsapp"] .wesal-quick-btn:hover {
	border-color: var(--wesal-accent);
}

.wesal-widget[data-platform="telegram"] .wesal-quick-btn:hover {
	border-color: var(--wesal-accent);
}

.wesal-quick-btn.wesal-selected {
	color: white;
	border-color: transparent;
}

.wesal-widget[data-platform="whatsapp"] .wesal-quick-btn.wesal-selected {
	background: var(--wesal-accent);
}

.wesal-widget[data-platform="telegram"] .wesal-quick-btn.wesal-selected {
	background: var(--wesal-accent);
}

.wesal-quick-btn i {
	font-size: 16px;
}

.wesal-quick-btn svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* === Chat Now Button === */
.wesal-chat-now {
	width: 100%;
	color: white;
	border: none;
	padding: 16px;
	border-radius: 12px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.wesal-chat-now svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.wesal-widget[data-platform="whatsapp"] .wesal-chat-now {
	background: linear-gradient(135deg, var(--wesal-accent) 0%, var(--wesal-accent-dark) 100%);
	box-shadow: 0 4px 15px var(--wesal-accent-shadow);
}

.wesal-widget[data-platform="telegram"] .wesal-chat-now {
	background: linear-gradient(135deg, var(--wesal-accent) 0%, var(--wesal-accent-dark) 100%);
	box-shadow: 0 4px 15px var(--wesal-accent-shadow);
}

.wesal-chat-now:hover {
	transform: translateY(-2px);
}

.wesal-widget[data-platform="whatsapp"] .wesal-chat-now:hover {
	box-shadow: 0 8px 25px var(--wesal-accent-shadow-strong);
}

.wesal-widget[data-platform="telegram"] .wesal-chat-now:hover {
	box-shadow: 0 8px 25px var(--wesal-accent-shadow-strong);
}

/* === Powered By === */
.wesal-powered-by {
	margin-top: 14px;
	text-align: center;
	font-size: 12px;
	font-family: inherit;
}

.wesal-powered-by a {
	color: #9ca3af;
	text-decoration: none;
	transition: color 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.wesal-powered-by a:hover {
	color: #6b7280;
}

.wesal-powered-logo {
	width: 16px;
	height: 16px;
	object-fit: contain;
	display: inline-block;
}

/* === Animations === */
@keyframes wesal-pulse {
	0% {
		box-shadow: 0 8px 25px var(--wesal-accent-shadow);
	}
	50% {
		box-shadow: 0 8px 25px var(--wesal-accent-shadow-strong);
	}
	100% {
		box-shadow: 0 8px 25px var(--wesal-accent-shadow);
	}
}

@keyframes wesal-blink {
	0%, 50% {
		opacity: 1;
	}
	51%, 100% {
		opacity: 0.3;
	}
}

/* === Responsive === */
@media (max-width: 768px) {
	.wesal-widget {
		right: calc(20px + env(safe-area-inset-right));
		bottom: calc(20px + env(safe-area-inset-bottom));
	}
	
	.wesal-widget-button {
		width: 60px;
		height: 60px;
	}
	
	.wesal-widget-panel {
		width: 300px;
		right: 0;
		padding: 20px;
	}

	.wesal-widget-message {
		padding: 14px;
		font-size: 14px;
	}

	.wesal-quick-btn {
		padding: 10px 14px;
		font-size: 13px;
	}

	.wesal-chat-now {
		padding: 14px;
		font-size: 15px;
	}
}

@media (max-width: 480px) {
	.wesal-widget {
		right: calc(16px + env(safe-area-inset-right));
		left: calc(16px + env(safe-area-inset-left));
		bottom: calc(16px + env(safe-area-inset-bottom));
	}

	.wesal-widget-panel {
		width: auto;
		left: 0;
		right: 0;
		bottom: 85px;
		max-height: calc(100vh - 160px);
		overflow-y: auto;
		padding: 18px;
	}

	.wesal-widget-button {
		width: 56px;
		height: 56px;
	}

	.wesal-widget-button svg {
		width: 30px;
		height: 30px;
	}

	.wesal-header-avatar {
		width: 44px;
		height: 44px;
	}

	.wesal-header-info h3 {
		font-size: 16px;
	}

	.wesal-header-info p {
		font-size: 13px;
	}

	.wesal-widget-message {
		font-size: 13px;
		line-height: 1.5;
	}
}