/* WP Float Hub – Frontend Styles */

/* =====================================================
   Base widget container
   ===================================================== */
.fh-widget {
	position: fixed;
	z-index: 9999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}

.fh-widget *,
.fh-widget *::before,
.fh-widget *::after {
	box-sizing: inherit;
}

/* =====================================================
   Toggle button
   ===================================================== */
.fh-toggle-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	cursor: pointer;
	border-radius: 50%;
	background: var(--fh-primary, #0073aa);
	color: #fff;
	box-shadow: 0 4px 14px rgba(0,0,0,0.22);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	padding: 0;
	position: relative;
	outline-offset: 3px;
}

.fh-toggle-btn:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.fh-toggle-btn:focus-visible {
	outline: 3px solid var(--fh-primary, #0073aa);
}

.fh-btn-img {
	width: 55%;
	height: 55%;
	object-fit: contain;
	pointer-events: none;
}

/* Variant: icon + text */
.fh-btn-variant-icon_text {
	border-radius: var(--fh-radius, 12px);
	padding: 0 14px;
	min-width: var(--fh-btn-size, 56px);
}

.fh-btn-label {
	font-size: 0.85em;
	font-weight: 600;
	white-space: nowrap;
}

/* Variant: bare (no shadow) */
.fh-btn-variant-icon_bare {
	box-shadow: none;
}

/* =====================================================
   Panel – base
   ===================================================== */
.fh-panel {
	position: absolute;
	min-width: 280px;
	max-width: 340px;
	background: var(--fh-bg-panel, #ffffff);
	color: var(--fh-text, #333333);
	border-radius: var(--fh-radius, 12px);
	overflow: hidden;
	will-change: transform, opacity;
}

/* Position the panel relative to the button */
.fh-pos-bottom .fh-pos-right .fh-panel,
.fh-pos-right .fh-panel {
	bottom: calc(var(--fh-btn-size, 56px) + 12px);
	right: 0;
}

.fh-pos-left .fh-panel {
	bottom: calc(var(--fh-btn-size, 56px) + 12px);
	left: 0;
}

.fh-pos-top .fh-panel {
	top: calc(var(--fh-btn-size, 56px) + 12px);
	right: 0;
}

.fh-pos-top.fh-pos-left .fh-panel {
	top: calc(var(--fh-btn-size, 56px) + 12px);
	left: 0;
}

/* Keep panel within viewport – handled by JS too */
.fh-panel {
	bottom: calc(var(--fh-btn-size, 56px) + 12px);
	right: 0;
}

.fh-panel[hidden] {
	display: none;
}

/* Panel header (close button row) */
.fh-panel-header {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 8px 10px 0;
	min-height: 36px;
	position: relative;
}

.fh-panel-header-title {
	flex: 1;
	font-size: 0.9em;
	font-weight: 600;
	color: var(--fh-text, #333);
	padding-left: 4px;
}

.fh-panel-close {
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
	opacity: 0.5;
	padding: 4px;
	line-height: 1;
	border-radius: 4px;
	transition: opacity 0.15s;
	flex-shrink: 0;
}

.fh-panel-close:hover {
	opacity: 1;
}

/* =====================================================
   Style: Flat
   ===================================================== */
.fh-style-flat .fh-panel {
	border: 2px solid var(--fh-primary, #0073aa);
	box-shadow: none;
}

.fh-style-flat .fh-toggle-btn {
	border-radius: 4px;
	box-shadow: none;
	border: 2px solid rgba(255,255,255,0.3);
}

/* =====================================================
   Style: Glass
   ===================================================== */
.fh-style-glass .fh-panel {
	background: rgba(255,255,255,0.72);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border: 1px solid rgba(255,255,255,0.4);
	box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.fh-style-glass .fh-toggle-btn {
	background: rgba(0, 115, 170, 0.85);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

/* =====================================================
   Style: Material
   ===================================================== */
.fh-style-material .fh-panel {
	box-shadow: 0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.10);
}

.fh-style-material .fh-toggle-btn {
	box-shadow: 0 4px 14px rgba(0,0,0,0.22), 0 1px 4px rgba(0,0,0,0.12);
}

.fh-style-material .fh-toggle-btn:hover {
	box-shadow: 0 8px 24px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.15);
}

/* =====================================================
   Style: Neumorphic
   ===================================================== */
.fh-style-neumorphic .fh-panel {
	background: #e8ecef;
	box-shadow:
		6px 6px 14px rgba(0,0,0,0.14),
		-6px -6px 14px rgba(255,255,255,0.8);
	border: none;
}

.fh-style-neumorphic .fh-toggle-btn {
	background: #e8ecef;
	color: var(--fh-primary, #0073aa);
	box-shadow:
		4px 4px 10px rgba(0,0,0,0.15),
		-4px -4px 10px rgba(255,255,255,0.8);
}

.fh-style-neumorphic .fh-toggle-btn:hover {
	box-shadow:
		2px 2px 6px rgba(0,0,0,0.15),
		-2px -2px 6px rgba(255,255,255,0.8),
		inset 2px 2px 5px rgba(0,0,0,0.1),
		inset -2px -2px 5px rgba(255,255,255,0.7);
}

.fh-style-neumorphic .fh-btn-img {
	filter: none;
}

/* =====================================================
   Opening animations
   ===================================================== */

/* --- Popup (default) --- */
.fh-open-popup .fh-panel {
	transform-origin: bottom right;
}
.fh-open-popup.fh-pos-left .fh-panel {
	transform-origin: bottom left;
}
.fh-open-popup.fh-pos-top .fh-panel {
	transform-origin: top right;
}
.fh-open-popup.fh-pos-top.fh-pos-left .fh-panel {
	transform-origin: top left;
}

.fh-open-popup .fh-panel--entering {
	animation: fh-popup-in 250ms ease-out forwards;
}
.fh-open-popup .fh-panel--leaving {
	animation: fh-popup-out 200ms ease-in forwards;
}

@keyframes fh-popup-in {
	from { opacity: 0; transform: scale(0.8); }
	to   { opacity: 1; transform: scale(1); }
}
@keyframes fh-popup-out {
	from { opacity: 1; transform: scale(1); }
	to   { opacity: 0; transform: scale(0.8); }
}

/* --- Slide --- */
.fh-open-slide .fh-panel {
	position: fixed;
}
.fh-open-slide.fh-pos-right .fh-panel {
	right: 0;
	top: 0;
	bottom: 0;
	left: auto;
	height: 100%;
	border-radius: 0;
	max-width: 340px;
	overflow-y: auto;
}
.fh-open-slide.fh-pos-left .fh-panel {
	left: 0;
	right: auto;
	top: 0;
	bottom: 0;
	height: 100%;
	border-radius: 0;
	max-width: 340px;
	overflow-y: auto;
}
.fh-open-slide.fh-pos-bottom .fh-panel {
	bottom: 0;
	left: 0;
	right: 0;
	top: auto;
	width: 100%;
	max-width: 100%;
	border-radius: var(--fh-radius, 12px) var(--fh-radius, 12px) 0 0;
}
.fh-open-slide.fh-pos-top .fh-panel {
	top: 0;
	left: 0;
	right: 0;
	bottom: auto;
	width: 100%;
	max-width: 100%;
	border-radius: 0 0 var(--fh-radius, 12px) var(--fh-radius, 12px);
}

.fh-open-slide.fh-pos-right .fh-panel--entering {
	animation: fh-slide-right-in 300ms ease-out forwards;
}
.fh-open-slide.fh-pos-right .fh-panel--leaving {
	animation: fh-slide-right-out 300ms ease-in forwards;
}
.fh-open-slide.fh-pos-left .fh-panel--entering {
	animation: fh-slide-left-in 300ms ease-out forwards;
}
.fh-open-slide.fh-pos-left .fh-panel--leaving {
	animation: fh-slide-left-out 300ms ease-in forwards;
}

@keyframes fh-slide-right-in  { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes fh-slide-right-out { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes fh-slide-left-in   { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes fh-slide-left-out  { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* --- Edge bar --- */
.fh-open-edge .fh-panel {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	top: auto;
	width: 100%;
	max-width: 100%;
	border-radius: 0;
	padding: 12px 24px;
	display: flex;
	gap: 20px;
	align-items: flex-start;
	overflow-x: auto;
}
.fh-open-edge.fh-pos-top .fh-panel {
	top: 0;
	bottom: auto;
}
.fh-open-edge .fh-panel--entering {
	animation: fh-edge-in 300ms ease-out forwards;
}
.fh-open-edge .fh-panel--leaving {
	animation: fh-edge-out 300ms ease-in forwards;
}
@keyframes fh-edge-in  { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fh-edge-out { from { transform: translateY(0); } to { transform: translateY(100%); } }

/* --- Circular menu (panel hidden; items positioned by JS) --- */
.fh-open-circular .fh-panel {
	background: transparent;
	box-shadow: none;
	border: none;
	overflow: visible;
	min-width: 0;
	max-width: none;
}

.fh-circular-item {
	position: absolute;
	transform-origin: center center;
	animation: fh-circular-appear 200ms ease-out forwards;
	opacity: 0;
}

@keyframes fh-circular-appear {
	from { opacity: 0; transform: scale(0.6); }
	to   { opacity: 1; transform: scale(1); }
}

/* =====================================================
   Modules
   ===================================================== */
.fh-modules {
	padding: 8px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-height: 80vh;
	overflow-y: auto;
}

.fh-module {
	width: 100%;
}

/* =====================================================
   Module: Quick Pages
   ===================================================== */
.fh-quick-pages-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.fh-quick-page-item {
	display: block;
}

.fh-quick-page-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: calc(var(--fh-radius, 12px) - 4px);
	color: var(--fh-text, #333);
	text-decoration: none;
	font-size: 0.9em;
	font-weight: 500;
	transition: background 0.15s, color 0.15s;
}

.fh-quick-page-link:hover {
	background: var(--fh-primary, #0073aa);
	color: #fff;
}

.fh-item-icon {
	font-size: 1.2em;
	line-height: 1;
	flex-shrink: 0;
	width: 22px;
	text-align: center;
}

.fh-item-label {
	flex: 1;
}

/* =====================================================
   Module: Search
   ===================================================== */
.fh-search-form {
	display: block;
}

.fh-search-row {
	display: flex;
	border: 1.5px solid rgba(0,0,0,0.15);
	border-radius: calc(var(--fh-radius, 12px) - 4px);
	overflow: hidden;
}

.fh-search-input {
	flex: 1;
	padding: 9px 12px;
	border: none;
	background: transparent;
	color: var(--fh-text, #333);
	font-size: 0.9em;
	outline: none;
}

.fh-search-input::placeholder {
	color: rgba(0,0,0,0.35);
}

.fh-search-btn {
	background: var(--fh-primary, #0073aa);
	border: none;
	color: #fff;
	padding: 0 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	transition: opacity 0.15s;
}

.fh-search-btn:hover {
	opacity: 0.85;
}

/* =====================================================
   Module: Contact Form
   ===================================================== */

/* Contact title button inherits fh-quick-page-link styles */
button.fh-quick-page-link {
	width: 100%;
	background: none;
	border: none;
	font-family: inherit;
	cursor: pointer;
	text-align: left;
}

button.fh-quick-page-link .fh-chevron {
	margin-left: auto;
	opacity: 0.45;
}

.fh-contact-panel {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* When contact panel is promoted to .fh-panel level */
.fh-panel--contact-open > .fh-contact-panel {
	padding: 0 16px 16px;
}

.fh-contact-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Honeypot – screen-reader only, invisible */
.fh-hp {
	position: absolute;
	left: -9999px;
	opacity: 0;
	pointer-events: none;
	tab-index: -1;
}

.fh-field-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.fh-field-group label {
	font-size: 0.82em;
	font-weight: 600;
	color: var(--fh-text, #333);
	opacity: 0.75;
}

.fh-input,
.fh-textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1.5px solid rgba(0,0,0,0.14);
	border-radius: calc(var(--fh-radius, 12px) - 6px);
	background: transparent;
	color: var(--fh-text, #333);
	font-size: 0.9em;
	font-family: inherit;
	outline: none;
	transition: border-color 0.15s;
}

.fh-input:focus,
.fh-textarea:focus {
	border-color: var(--fh-primary, #0073aa);
}

.fh-textarea {
	resize: vertical;
	min-height: 80px;
}

.fh-field-error {
	font-size: 0.78em;
	color: #d63638;
	min-height: 1.2em;
}

.fh-input.fh-input--error,
.fh-textarea.fh-input--error {
	border-color: #d63638;
}

.fh-form-footer {
	display: flex;
	justify-content: flex-end;
}

.fh-submit-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 20px;
	background: var(--fh-primary, #0073aa);
	color: #fff;
	border: none;
	border-radius: calc(var(--fh-radius, 12px) - 4px);
	cursor: pointer;
	font-size: 0.9em;
	font-weight: 600;
	transition: opacity 0.15s;
}

.fh-submit-btn:hover {
	opacity: 0.88;
}

.fh-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.fh-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,0.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: fh-spin 0.7s linear infinite;
}

@keyframes fh-spin {
	to { transform: rotate(360deg); }
}

.fh-form-feedback {
	padding: 8px 10px;
	border-radius: 6px;
	font-size: 0.88em;
	text-align: center;
}

.fh-form-feedback--success {
	background: #edfaed;
	color: #1e7e34;
	border: 1px solid #b8e2b8;
}

.fh-form-feedback--error {
	background: #fde8e8;
	color: #a00;
	border: 1px solid #f5c6c6;
}

.fh-form-feedback[hidden] {
	display: none;
}

/* =====================================================
   Dark mode – auto (follows OS + body class/attr)
   ===================================================== */
@media (prefers-color-scheme: dark) {
	.fh-dark-auto .fh-panel {
		--fh-bg-panel: rgba(28, 28, 32, 0.97);
		--fh-text: #e2e2e6;
	}
	.fh-dark-auto .fh-style-glass .fh-panel {
		background: rgba(28,28,32,0.78);
		border-color: rgba(255,255,255,0.08);
	}
	.fh-dark-auto .fh-search-row {
		border-color: rgba(255,255,255,0.18);
	}
	.fh-dark-auto .fh-input,
	.fh-dark-auto .fh-textarea {
		border-color: rgba(255,255,255,0.18);
	}
	.fh-dark-auto .fh-search-input::placeholder {
		color: rgba(255,255,255,0.35);
	}
}

body.dark .fh-dark-auto .fh-panel,
body[data-theme="dark"] .fh-dark-auto .fh-panel {
	--fh-bg-panel: rgba(28, 28, 32, 0.97);
	--fh-text: #e2e2e6;
}

/* Always dark */
.fh-dark-dark .fh-panel {
	--fh-bg-panel: rgba(28, 28, 32, 0.97);
	--fh-text: #e2e2e6;
}

/* =====================================================
   Reduced motion
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
	.fh-open-popup .fh-panel--entering,
	.fh-open-popup .fh-panel--leaving,
	.fh-open-slide .fh-panel--entering,
	.fh-open-slide .fh-panel--leaving,
	.fh-open-edge .fh-panel--entering,
	.fh-open-edge .fh-panel--leaving,
	.fh-circular-item {
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}
