/**
 * Floating Chatbot Widget Stylesheet (Tidio-Style)
 *
 * @package AnacondawebChatbot
 */

/* Variables and resets for widget scoping */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.acb-widget-container {
	position: fixed;
	bottom: 25px;
	right: 25px;
	z-index: 999999;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.acb-widget-container * {
	box-sizing: border-box;
}

/* 1. Launcher Button */
.acb-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 50%, #c084fc 0%, #3b82f6 40%, #4338ca 100%);
	background-size: 200% 200%;
	animation: acb-bg-fluid 5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
	box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	position: relative;
}

@keyframes acb-bg-fluid {
	0% { background-position: 0% 0%; }
	50% { background-position: 100% 100%; }
	100% { background-position: 0% 100%; }
}

.acb-launcher:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.acb-launcher:active {
	transform: scale(0.95);
}

.acb-launcher svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: #fff;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.3s ease;
}

.acb-launcher.open svg {
	transform: rotate(90deg);
}

.acb-launcher-close-icon {
	display: none;
}

.acb-launcher.open .acb-launcher-chat-icon {
	display: none;
}

.acb-launcher.open .acb-launcher-close-icon {
	display: block;
}

/* Launcher Notification Badge */
.acb-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	background: #ef4444;
	color: white;
	font-size: 11px;
	font-weight: bold;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
	animation: acb-pulse 2s infinite;
}

@keyframes acb-pulse {
	0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
	70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
	100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 2. Chat Window Box */
.acb-chat-window {
	position: absolute;
	bottom: 75px;
	right: 0;
	width: 370px;
	height: 570px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 30px rgba(15, 23, 42, 0.15);
	border: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: scale(0.9) translateY(20px);
	opacity: 0;
	pointer-events: none;
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	transform-origin: bottom right;
}

.acb-widget-container.open .acb-chat-window {
	transform: scale(1) translateY(0);
	opacity: 1;
	pointer-events: auto;
}

/* Responsive adjustment for small screens */
@media (max-width: 480px) {
	.acb-widget-container {
		bottom: 15px;
		right: 15px;
	}
	.acb-chat-window {
		position: fixed;
		bottom: 0;
		right: 0;
		width: 100vw;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
		border: none;
		transform-origin: bottom right;
	}
}

/* 3. Chat Header */
.acb-header {
	background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%);
	color: #fff;
	padding: 20px;
	display: flex;
	align-items: center;
	position: relative;
	border-bottom: 1px solid rgba(255,255,255,0.08);
}

.acb-avatar-container {
	position: relative;
	margin-right: 12px;
	width: 44px;
	height: 44px;
}

.acb-avatar-img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255,255,255,0.2);
}

.acb-online-dot {
	width: 10px;
	height: 10px;
	background-color: #10b981;
	border-radius: 50%;
	position: absolute;
	bottom: 2px;
	right: 2px;
	border: 2px solid #0f172a;
}

.acb-online-dot-pulse {
	width: 10px;
	height: 10px;
	background-color: #10b981;
	border-radius: 50%;
	position: absolute;
	bottom: 2px;
	right: 2px;
	border: 2px solid #0f172a;
	animation: acb-dot-pulse 1.8s infinite ease-in-out;
}

@keyframes acb-dot-pulse {
	0% { transform: scale(1); opacity: 1; }
	100% { transform: scale(2.4); opacity: 0; }
}

.acb-header-info {
	flex-grow: 1;
}

.acb-header-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.3px;
	color: #fff;
}

.acb-header-subtitle {
	margin: 2px 0 0 0;
	font-size: 11px;
	color: #94a3b8;
	display: flex;
	align-items: center;
	gap: 4px;
}

.acb-close-btn {
	background: transparent;
	border: none;
	color: rgba(255,255,255,0.6);
	font-size: 20px;
	cursor: pointer;
	padding: 5px;
	transition: color 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.acb-close-btn:hover {
	color: #fff;
}

/* 4. Chat Body / Message List */
.acb-body {
	flex-grow: 1;
	padding: 20px;
	overflow-y: auto;
	background: #f8fafc;
	display: flex;
	flex-direction: column;
	gap: 15px;
	scroll-behavior: smooth;
}

/* Custom Scrollbar for Chat Body */
.acb-body::-webkit-scrollbar {
	width: 5px;
}
.acb-body::-webkit-scrollbar-track {
	background: transparent;
}
.acb-body::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 10px;
}
.acb-body::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* Message Bubble Container */
.acb-message-row {
	display: flex;
	width: 100%;
	animation: acb-fade-in 0.25s ease-out forwards;
}

@keyframes acb-fade-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.acb-message-row.acb-row-bot {
	justify-content: flex-start;
}

.acb-message-row.acb-row-visitor {
	justify-content: flex-end;
}

.acb-message-bubble {
	max-width: 80%;
	padding: 12px 16px;
	font-size: 13px;
	line-height: 1.5;
	box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.acb-row-bot .acb-message-bubble {
	background: #fff;
	color: #000000;
	border-radius: 16px;
	border-top-left-radius: 4px;
	border: 1px solid #e2e8f0;
}

.acb-row-bot .acb-message-bubble * {
	color: #000000;
}

.acb-row-visitor .acb-message-bubble {
	background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
	color: #fff;
	border-radius: 16px;
	border-top-right-radius: 4px;
}

.acb-row-visitor .acb-message-bubble * {
	color: #fff;
}

/* Typing Indicator */
.acb-typing-indicator {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 6px;
}

.acb-typing-indicator span {
	width: 6px;
	height: 6px;
	background: #94a3b8;
	border-radius: 50%;
	display: inline-block;
	animation: acb-bounce 1.4s infinite ease-in-out both;
}

.acb-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.acb-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes acb-bounce {
	0%, 80%, 100% { transform: scale(0); }
	40% { transform: scale(1.0); }
}

/* 5. Options / Quick Replies */
.acb-options-container {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	margin-top: 5px;
	animation: acb-fade-in 0.3s ease-out forwards;
}

.acb-option-btn {
	background: #fff !important;
	border: 1px solid #e2e8f0 !important;
	color: #000000 !important;
	padding: 10px !important;
	border-radius: 12px !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	cursor: pointer !important;
	text-align: left !important;
	transition: all 0.2s ease !important;
	display: flex !important;
	align-items: center !important;
	gap: 12px !important;
	box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
	opacity: 1 !important;
}

.acb-option-btn:disabled,
.acb-option-btn[disabled] {
	opacity: 0.8 !important;
	cursor: default !important;
	pointer-events: none !important;
	box-shadow: none !important;
}

.acb-option-btn:hover {
	background: #f8fafc !important;
	border-color: #cbd5e1 !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05) !important;
}

.acb-opt-icon {
	width: 36px !important;
	height: 36px !important;
	border-radius: 10px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0 !important;
	background: #f1f5f9 !important;
	color: #000000 !important;
	opacity: 1 !important;
}

.acb-opt-icon svg {
	width: 18px;
	height: 18px;
	stroke: currentColor !important;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
}

/* Icon colors */
.acb-opt-icon.blue { background: #e0e7ff !important; color: #3b82f6 !important; }
.acb-opt-icon.green { background: #d1fae5 !important; color: #10b981 !important; }
.acb-opt-icon.purple { background: #f3e8ff !important; color: #a855f7 !important; }
.acb-opt-icon.amber { background: #fef3c7 !important; color: #f59e0b !important; }
.acb-opt-icon.rose { background: #ffe4e6 !important; color: #f43f5e !important; }

.acb-opt-text {
	flex-grow: 1;
	color: #000000 !important;
}

.acb-option-btn::after {
	content: "→";
	opacity: 0;
	transform: translateX(-5px);
	transition: all 0.2s ease;
	color: #94a3b8;
}

.acb-option-btn:hover::after {
	opacity: 1;
	transform: translateX(0);
}

/* 6. Form Inputs inside Chat */
.acb-card-input-form {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 15px;
	width: 100%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	display: flex;
	flex-direction: column;
	gap: 12px;
	animation: acb-fade-in 0.3s ease-out forwards;
}

.acb-card-input-form label {
	font-size: 11px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	margin-bottom: -4px;
}

.acb-card-input-form input,
.acb-card-input-form select,
.acb-card-input-form textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 13px;
	color: #1e293b;
	background-color: #fff;
	transition: border-color 0.2s;
	outline: none;
}

.acb-card-input-form input:focus,
.acb-card-input-form select:focus,
.acb-card-input-form textarea:focus {
	border-color: #0284c7;
	box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.acb-card-input-form button {
	width: 100%;
	padding: 10px;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	font-size: 13px;
	text-align: center;
	border: none;
}

.acb-card-input-form button.acb-submit-btn,
.acb-card-input-form button:not(.acb-cancel-btn) {
	background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.acb-card-input-form button.acb-submit-btn:hover,
.acb-card-input-form button:not(.acb-cancel-btn):hover {
	opacity: 0.95;
	transform: translateY(-1px);
}

.acb-card-input-form button.acb-cancel-btn {
	background: transparent;
	color: #64748b;
	border: 1px solid transparent;
	margin-top: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.acb-card-input-form button.acb-cancel-btn:hover {
	background: #f8fafc;
	color: #334155;
	border-color: #e2e8f0;
}

/* Feedback rating helpfulness buttons */
.acb-feedback-row {
	display: flex;
	gap: 10px;
	margin-top: 5px;
}

.acb-feedback-btn {
	flex: 1;
	padding: 8px;
	border: 1px solid #cbd5e1;
	background: white;
	border-radius: 8px;
	cursor: pointer;
	font-size: 12px;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.acb-feedback-btn:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

.acb-feedback-btn.satisfied:hover {
	background: #dcfce7;
	border-color: #86efac;
	color: #15803d;
}

.acb-feedback-btn.unsatisfied:hover {
	background: #fee2e2;
	border-color: #fca5a5;
	color: #b91c1c;
}

/* 7. Chat Footer / Text Input Area */
.acb-footer {
	background: #fff;
	padding: 12px 16px;
	border-top: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	gap: 10px;
}

.acb-input-container {
	flex-grow: 1;
	position: relative;
}

.acb-text-input {
	width: 100%;
	border: none;
	outline: none;
	resize: none;
	font-size: 13px;
	line-height: 1.4;
	color: #1e293b;
	padding: 8px 0;
	font-family: inherit;
	background: transparent;
	max-height: 80px;
}

.acb-text-input::placeholder {
	color: #94a3b8;
}

.acb-send-btn {
	background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%);
	border: none;
	padding: 8px 10px 8px 12px;
	border-radius: 8px;
	cursor: pointer;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.acb-send-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(30, 58, 138, 0.35);
	color: #fff;
}

.acb-send-btn svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
	margin-right: 2px;
}

/* Disable state of footer when not typing */
.acb-footer.disabled {
	background: #f8fafc;
	pointer-events: none;
}
.acb-footer.disabled .acb-text-input::placeholder {
	color: #cbd5e1;
}

/* Powered by label */
.acb-powered-by {
	font-size: 9px;
	color: #cbd5e1;
	text-align: center;
	padding: 4px;
	background: #f8fafc;
	border-top: 1px solid #f1f5f9;
}
.acb-powered-by a {
	color: #cbd5e1;
	text-decoration: none;
}
.acb-powered-by a:hover {
	color: #94a3b8;
}

/* Standardize all options as cards, removing the previous blue action button overrides */

/* Fix select dropdown to not look disabled/gray */
.acb-card-input-form select {
	color: #1e293b;
	background-color: #fff;
	-webkit-appearance: menulist;
	-moz-appearance: menulist;
	appearance: menulist;
	cursor: pointer;
}

.acb-card-input-form select option {
	color: #1e293b;
	background-color: #fff;
}
