/* FoxChat — Chatbot Widget CSS
   Standalone — no external dependencies */

/* ── Trigger Button ── */

.fc-trigger {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.fc-trigger__btn {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: linear-gradient(135deg, #8C52FF 0%, #7c3aed 100%);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 24px rgba(140,82,255,0.4), 0 0 0 0 rgba(140,82,255,0.3);
	transition: all 0.3s;
	position: relative;
	padding: 3px;
	overflow: hidden;
	animation: fc-shadow-pulse 2.5s ease-in-out infinite;
}

.fc-trigger__photo {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #fff;
}

.fc-trigger__btn:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 32px rgba(140,82,255,0.5);
	animation: none;
}

/* Ripple rings */
.fc-trigger__btn::before {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2.5px solid rgba(140,82,255,0.5);
	opacity: 0;
	animation: fc-ripple 3s ease-out infinite;
}
.fc-trigger__btn::after {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid rgba(124,58,237,0.4);
	opacity: 0;
	animation: fc-ripple 3s ease-out 1.5s infinite;
}

@keyframes fc-ripple {
	0%   { opacity: 0.6; transform: scale(1); }
	100% { opacity: 0;   transform: scale(1.6); }
}
@keyframes fc-shadow-pulse {
	0%, 100% { box-shadow: 0 4px 24px rgba(140,82,255,0.4), 0 0 0 0px rgba(140,82,255,0.2); }
	50%       { box-shadow: 0 6px 32px rgba(124,58,237,0.5), 0 0 0 8px rgba(140,82,255,0.08); }
}

/* Online dot */
.fc-trigger__online {
	position: absolute;
	bottom: 4px;
	right: 4px;
	width: 14px;
	height: 14px;
	background: #22C55E;
	border: 2.5px solid #fff;
	border-radius: 50%;
	z-index: 2;
	animation: fc-online-blink 2s ease-in-out infinite;
}
@keyframes fc-online-blink {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.5; }
}

/* Open state */
.fc-trigger__icon--close { display: none; }
.fc-trigger.is-open .fc-trigger__icon--chat  { display: none; }
.fc-trigger.is-open .fc-trigger__icon--close { display: block; }
.fc-trigger.is-open .fc-trigger__btn::before { display: none; }
.fc-trigger.is-open .fc-trigger__btn::after  { display: none; }
.fc-trigger.is-open .fc-trigger__online      { display: none; }
.fc-trigger.is-open .fc-trigger__btn {
	background: #8C52FF;
	overflow: visible;
	animation: none;
	box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* ── Greeting Bubble ── */

.fc-trigger__greeting {
	display: none;
	align-items: center;
	gap: 6px;
	background: #fff;
	padding: 7px 12px;
	border-radius: 10px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.12);
	font-size: 12px;
	font-weight: 500;
	color: #1f2937;
	max-width: 220px;
	line-height: 1.4;
	animation: fc-fade-in 0.3s ease-out;
}
.fc-trigger__greeting.is-visible { display: flex; }
.fc-trigger.is-open .fc-trigger__greeting { display: none !important; }

.fc-trigger__close-greeting {
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px;
	color: #9ca3af;
	display: flex;
}

/* ── Panel ── */

.fc-panel {
	position: fixed;
	bottom: 100px;
	right: 24px;
	width: 380px;
	max-height: 520px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 48px rgba(0,0,0,0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 9998;
	opacity: 0;
	transform: translateY(20px) scale(0.95);
	pointer-events: none;
	transition: all 0.25s ease-out;
}
.fc-panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* ── Header ── */

.fc-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: linear-gradient(135deg, #8C52FF 0%, #7B3FE4 50%, #7c3aed 100%);
	position: relative;
	overflow: hidden;
}
.fc-header::before {
	content: '';
	position: absolute;
	top: -20px; right: -20px;
	width: 80px; height: 80px;
	background: rgba(255,255,255,0.06);
	border-radius: 50%;
	pointer-events: none;
}

.fc-header__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	border: 2.5px solid rgba(255,255,255,0.5);
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	position: relative;
}
.fc-header__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.fc-header__avatar::after {
	content: '';
	position: absolute;
	bottom: 1px; right: 1px;
	width: 10px; height: 10px;
	background: #22C55E;
	border: 2px solid #fff;
	border-radius: 50%;
}

.fc-header__info { flex: 1; min-width: 0; }
.fc-header__name {
	font-size: 15px;
	font-weight: 600;
	color: #fff;
}
.fc-header__role {
	font-size: 12px;
	color: rgba(255,255,255,0.75);
}

.fc-header__close {
	margin-left: auto;
	background: rgba(255,255,255,0.12);
	border: none;
	cursor: pointer;
	padding: 6px;
	color: rgba(255,255,255,0.8);
	display: flex;
	align-items: center;
	border-radius: 50%;
	transition: all 0.15s;
	position: relative;
	z-index: 2;
}
.fc-header__close:hover {
	background: rgba(255,255,255,0.25);
	color: #fff;
}

/* ── Messages ── */

.fc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 240px;
	max-height: 360px;
	background: #fff;
}

.fc-msg { display: flex; }
.fc-msg--bot  { justify-content: flex-start; }
.fc-msg--user { justify-content: flex-end; }

.fc-msg__bubble {
	max-width: 85%;
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.5;
	border-radius: 14px;
}
.fc-msg--bot  .fc-msg__bubble {
	background: #f9fafb;
	color: #1f2937;
	border-bottom-left-radius: 4px;
}
.fc-msg--user .fc-msg__bubble {
	background: #8C52FF;
	color: #fff;
	border-bottom-right-radius: 4px;
}
.fc-msg--in { animation: fc-fade-in 0.3s ease-out; }

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

/* ── Chips ── */

.fc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 4px 0;
}
.fc-chip {
	padding: 7px 14px;
	border: 1.5px solid #e5e7eb;
	border-radius: 20px;
	background: #fff;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	transition: all 0.15s;
	font-family: inherit;
}
.fc-chip:hover          { border-color: #8C52FF; color: #8C52FF; background: #F3EEFF; }
.fc-chip.is-selected    { border-color: #8C52FF; background: #8C52FF; color: #fff; }
.fc-chip:disabled       { cursor: default; opacity: 0.6; }
.fc-chip.is-selected:disabled { opacity: 1; }

/* ── Typing ── */

.fc-typing {
	display: flex;
	gap: 4px;
	padding: 12px 16px;
	background: #f9fafb;
	border-radius: 14px;
	border-bottom-left-radius: 4px;
	width: fit-content;
	animation: fc-fade-in 0.2s ease-out;
}
.fc-typing span {
	width: 7px; height: 7px;
	border-radius: 50%;
	background: #d1d5db;
	animation: fc-dot 1.2s ease-in-out infinite;
}
.fc-typing span:nth-child(2) { animation-delay: 0.2s; }
.fc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes fc-dot {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
	30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Phone Capture ── */

.fc-phone-capture {
	padding: 0 4px;
	margin-top: 4px;
}
.fc-phone-row {
	display: flex;
	align-items: center;
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	transition: border-color 0.2s;
}
.fc-phone-row:focus-within { border-color: #8C52FF; }

.fc-phone-prefix {
	padding: 10px 8px 10px 14px;
	font-size: 14px;
	font-weight: 600;
	color: #6b7280;
	white-space: nowrap;
}
.fc-phone-input {
	flex: 1;
	padding: 10px 4px;
	border: none;
	outline: none;
	font-size: 15px;
	font-family: inherit;
	color: #111827;
	background: transparent;
	min-width: 0;
}
.fc-phone-input::placeholder { color: #9ca3af; }
.fc-phone-input.is-error     { color: #EF4444; }
.fc-phone-input.is-error::placeholder { color: #F87171; }

.fc-phone-send {
	width: 42px; height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #8C52FF;
	color: #fff !important;
	border: none;
	cursor: pointer;
	border-radius: 0 10px 10px 0;
	transition: opacity 0.15s;
	flex-shrink: 0;
	font-size: 26px;
	line-height: 1;
}
.fc-phone-send:hover    { opacity: 0.85; }
.fc-phone-send:disabled { opacity: 0.5; cursor: default; }

.fc-phone-trust {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	color: #9ca3af;
	margin-top: 6px;
	padding-left: 2px;
}

/* ── WhatsApp Link ── */

.fc-wa-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	background: #E7F7ED;
	border-radius: 8px;
	color: #128C7E;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
}
.fc-wa-link:hover { background: #D1F2E0; text-decoration: none; }

/* ── Menu Buttons ── */

.fc-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 0;
}
.fc-menu-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 16px;
	background: #fff;
	border: 1.5px solid #8C52FF;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 500;
	color: #1f2937;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.15s;
	white-space: nowrap;
}
.fc-menu-btn:hover           { background: #F3EEFF; border-color: #7B3FE4; color: #7B3FE4; }
.fc-menu-btn.is-selected     { background: #8C52FF; border-color: #8C52FF; color: #fff; }
.fc-menu-btn:disabled        { cursor: default; opacity: 0.5; }
.fc-menu-btn.is-selected:disabled { opacity: 1; }

/* ── Date Picker ── */

.fc-date-picker {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	padding: 4px 0 8px;
}

.fc-date-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 8px 4px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.15s;
}
.fc-date-btn:hover           { border-color: #8C52FF; background: #F3EEFF; }
.fc-date-btn.is-selected     { border-color: #8C52FF; background: #8C52FF; color: #fff; }
.fc-date-btn:disabled        { cursor: default; opacity: 0.5; }
.fc-date-btn.is-selected:disabled { opacity: 1; }

.fc-date-btn__day {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: #6b7280;
}
.fc-date-btn.is-selected .fc-date-btn__day { color: rgba(255,255,255,0.8); }

.fc-date-btn__date {
	font-size: 13px;
	font-weight: 600;
	color: #1f2937;
}
.fc-date-btn.is-selected .fc-date-btn__date { color: #fff; }

/* ── Mobile: Full-screen ── */

@media (max-width: 767px) {
	.fc-trigger { bottom: 76px; right: 16px; }
	.fc-trigger__btn { width: 60px; height: 60px; }
	.fc-trigger__greeting { font-size: 11px; padding: 6px 10px; max-width: 180px; }

	.fc-panel {
		top: 0; left: 0; right: 0; bottom: 0;
		width: 100%;
		max-height: 100%;
		border-radius: 0;
	}
	.fc-panel.is-open { transform: translateY(0) scale(1); }

	.fc-messages { max-height: none; flex: 1; min-height: 0; }

	.fc-trigger.is-open .fc-trigger__btn { display: none; }
}
