/**
 * Public Front-end Styles for Floating Action Utility Plugin
 */

/* Hide Perfecty Push Native Bell (Orb handles UI) */
.perfecty-push-settings-container {
    display: none !important;
}

/* Container and Positioning */
:root {
	--brand-blue: #C5D752;
	--brand-green: #B1D235;
	--brand-dark: #264A53;
	--brand-text: #3B4656;
	--brand-offwhite: #F5F5F0;
	--brand-shadow: #D9D0C5;
	--brand-green-hover: #C3D063;
}

.faup-fab-container {
	position: fixed;
	bottom: 30px;
	right: 30px;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Primary Trigger FAB styling */
.faup-primary-fab {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background-color: var(--faup-primary-bg, #6200ee);
	color: var(--faup-primary-icon, #ffffff);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	outline: none;
	position: relative;
	z-index: 1000;
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease, box-shadow 0.3s ease;
}

.faup-primary-fab:hover {
	transform: scale(1.05);
	background-color: var(--faup-primary-hover) !important;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.faup-primary-fab:active {
	transform: scale(0.95);
}

/* Toggle Menu Icons */
.faup-primary-fab svg {
	position: absolute;
	transition: transform 0.4s ease, opacity 0.3s ease;
	width: 28px;
	height: 28px;
}

.faup-primary-fab .faup-icon-close {
	opacity: 0;
	transform: rotate(-90deg);
}

.faup-primary-fab .faup-icon-open {
	opacity: 1;
	transform: rotate(0deg);
}

/* Active State Trigger Toggle Icons */
.faup-fab-container.faup-active .faup-primary-fab {
	background-color: #d32f2f !important; /* Visual cue when open */
	color: #ffffff !important;
	transform: rotate(135deg); /* Spin primary button on open */
}

.faup-fab-container.faup-active .faup-primary-fab:hover {
	transform: rotate(135deg) scale(1.05);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.faup-fab-container.faup-active .faup-primary-fab:active {
	transform: rotate(135deg) scale(0.95);
}

.faup-fab-container.faup-active .faup-primary-fab .faup-icon-close {
	opacity: 1;
	transform: rotate(0deg);
}

.faup-fab-container.faup-active .faup-primary-fab .faup-icon-open {
	opacity: 0;
	transform: rotate(90deg);
}

/* Sub Action Buttons Container (centered mathematically on the primary FAB) */
.faup-sub-buttons {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	z-index: 999;
}

/* Sub Action Buttons Default (Collapsed) State */
.faup-sub-btn {
	position: absolute !important;
	top: -24px;
	left: -24px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background-color: var(--faup-sub-bg, #03dac6);
	color: var(--faup-sub-icon, #000000);
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	outline: none;
	opacity: 0;
	transform: translate(0px, 0px) scale(0); /* Start centered inside primary button */
	transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
	text-decoration: none;
}

/* Dynamic Positioning via CSS variables */
.faup-pos-1 { --pos-x: -130px; --pos-y: 0px; }
.faup-pos-2 { --pos-x: -112.6px; --pos-y: -65px; }
.faup-pos-3 { --pos-x: -65px; --pos-y: -112.6px; }
.faup-pos-4 { --pos-x: 0px; --pos-y: -130px; }

/* Apply translation to active sub-buttons and user container */
.faup-fab-container.faup-active .faup-sub-btn,
.faup-fab-container.faup-active .faup-user-container {
	opacity: 1;
	transform: translate(var(--pos-x), var(--pos-y)) scale(1);
}

.faup-fab-container.faup-active .faup-sub-btn:hover {
	transform: translate(var(--pos-x), var(--pos-y)) scale(1.1);
	background-color: var(--brand-green) !important;
	color: #ffffff !important;
}

/* Specific exception: Push Notification success active state (green) shouldn't lose its color on hover or otherwise */
.faup-fab-container.faup-active .faup-sub-btn#faup-btn-push.success-active,
.faup-fab-container.faup-active .faup-sub-btn#faup-btn-push.success-active:hover {
	background-color: var(--faup-active-bg) !important;
	color: #ffffff !important;
}

/* User Account Container (acts as a sub-button wrapper) */
.faup-user-container {
	position: absolute !important;
	top: -24px;
	left: -24px;
	width: 48px;
	height: 48px;
	opacity: 0;
	transform: translate(0px, 0px) scale(0);
	transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
	z-index: 999;
}

/* User Account button itself needs to fill container */
#faup-btn-user {
	position: absolute !important;
	top: 0;
	left: 0;
	opacity: 1;
	transform: scale(1);
	padding: 0;
	overflow: hidden;
}

/* User Account Button hover handles scaling of inner button */
.faup-fab-container.faup-active .faup-user-container #faup-btn-user:hover {
	transform: scale(1.1);
	background-color: var(--brand-green) !important;
	color: #ffffff !important;
}
/* User avatar and placeholder */
.faup-user-avatar {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	border: var(--faup-avatar-border-width) solid var(--faup-avatar-border-color);
	box-sizing: border-box;
}

/* Utility class to hide elements */
.faup-hidden {
	display: none !important;
}

/* User Account Secondary Fan-out Menu */
.faup-user-menu {
	position: absolute;
	bottom: 55px; /* Above the user button */
	right: 0; /* Align right to avoid screen edge clipping */
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	padding: 8px 0;
	min-width: 160px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px) scale(0.9);
	transform-origin: bottom right;
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.faup-user-container.faup-user-menu-active .faup-user-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.faup-user-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.faup-user-list li {
	margin: 0;
	padding: 0;
}

.faup-user-list a {
	display: block;
	padding: 8px 16px;
	color: var(--brand-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 0.2s, color 0.2s;
}

.faup-user-list a:hover {
	background-color: var(--brand-offwhite);
	color: var(--brand-blue);
}

/* SVG icons size */
.faup-svg {
	width: 22px;
	height: 22px;
}


/* Tooltips */
.faup-tooltip-container {
	position: relative;
}

.faup-sub-btn:hover {
	z-index: 1001 !important;
}

.faup-tooltip {
	position: absolute;
	bottom: 125%;
	left: 50%;
	z-index: 1002;
	transform: translateX(-50%) translateY(8px);
	background-color: rgba(33, 33, 33, 0.95);
	color: #ffffff;
	padding: 5px 10px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Small arrow for tooltips */
.faup-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border-width: 5px;
	border-style: solid;
	border-color: rgba(33, 33, 33, 0.95) transparent transparent transparent;
}

.faup-sub-btn:hover .faup-tooltip {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Accessible Native HTML5 <dialog> Feedback Modal */
.faup-feedback-dialog {
	border: none;
	border-radius: 12px;
	padding: 24px;
	width: 90%;
	max-width: 480px;
	box-shadow: 0 10px 30px var(--brand-shadow);
	background-color: #ffffff;
	position: fixed;
	top: 50%;
	left: 50%;
	margin: 0;
	transform: translate(-50%, -50%) scale(0.9);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15), opacity 0.3s ease, visibility 0.3s;
	z-index: 1000000;
	display: block; /* Overrides default browser display to make our animation transition smooth */
}

/* Open state using CSS class mapping */
.faup-feedback-dialog[open] {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, -50%) scale(1);
	pointer-events: auto;
}

/* Backdrop Blur (Glassmorphism effect) */
.faup-feedback-dialog::backdrop {
	background-color: rgba(38, 74, 83, 0.4); /* brand-dark at 40% */
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.faup-feedback-dialog[open]::backdrop {
	opacity: 1;
}

.faup-dialog-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #eaeaea;
	padding-bottom: 12px;
	margin-bottom: 16px;
}

.faup-dialog-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--brand-dark);
}

.faup-dialog-close-btn {
	background: transparent;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: var(--brand-text);
	padding: 0;
	transition: color 0.2s ease;
}

.faup-dialog-close-btn:hover {
	color: #d32f2f;
}

#faup-feedback-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

#faup-feedback-form label,
#faup-login-form label {
	font-size: 13px;
	font-weight: 600;
	color: var(--brand-text);
}

#faup-feedback-form textarea,
#faup-login-form input[type="text"],
#faup-login-form input[type="password"] {
	width: 100%;
	padding: 10px;
	border: 1.5px solid var(--brand-shadow);
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.4;
	resize: vertical;
	box-sizing: border-box;
	outline: none;
	transition: border-color 0.2s ease;
}

#faup-feedback-form textarea:focus,
#faup-login-form input[type="text"]:focus,
#faup-login-form input[type="password"]:focus {
	border-color: var(--brand-blue);
}

.faup-dialog-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 10px;
}

.faup-feedback-msg {
	font-size: 12px;
	font-weight: 500;
	max-width: 250px;
}

.faup-feedback-msg.success {
	color: #27ae60;
}

.faup-feedback-msg.error {
	color: #c0392b;
}

/* Button style for modal footer */
.faup-dialog-footer button[type="submit"] {
	padding: 8px 18px;
	background-color: var(--brand-green);
	color: var(--brand-dark);
	border: none;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.faup-dialog-footer button[type="submit"]:hover {
	filter: brightness(1.1);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.faup-dialog-footer button[type="submit"]:disabled {
	background-color: #bdc3c7;
	cursor: not-allowed;
	box-shadow: none;
}
