/**
 * BCC User Widget Styles
 * Styles for the user popover widget
 */

/* ==============================
   WIDGET WRAPPER
   ============================== */
.bcc-user-widget-wrapper {
	position: relative;
	display: inline-flex;
}

/* ==============================
   TRIGGER BUTTON
   ============================== */
.bcc-user-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: inherit;
	line-height: 1.5;
	text-decoration: none !important;
	transition: all 0.3s ease;
	color: inherit;
}

/* Reset link styles - remove purple/default colors */
a.bcc-user-trigger,
a.bcc-user-trigger:link,
a.bcc-user-trigger:visited,
a.bcc-user-trigger:hover,
a.bcc-user-trigger:active,
button.bcc-user-trigger,
button.bcc-user-trigger:hover {
	text-decoration: none !important;
	color: inherit;
}

.bcc-user-trigger:focus {
	outline: none;
}

.bcc-user-trigger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Trigger with icon on the left */
.bcc-user-trigger.icon-left {
	flex-direction: row;
}

/* Trigger with icon on the right */
.bcc-user-trigger.icon-right {
	flex-direction: row-reverse;
}

/* Trigger icon container */
.bcc-user-trigger-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.bcc-user-trigger-icon i,
.bcc-user-trigger-icon svg {
	display: block;
	color: inherit;
	fill: currentColor;
}

.bcc-user-trigger-icon img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Trigger text */
.bcc-user-trigger-text {
	white-space: nowrap;
}

/* Display Type: Button */
.bcc-user-trigger-button {
	/* Button styles are handled by Elementor controls */
}

/* Display Type: Text Link */
.bcc-user-trigger-text-link {
	background: transparent;
	border: none;
	padding: 0;
	text-decoration: underline;
}

.bcc-user-trigger-text-link:hover {
	text-decoration: none;
}

/* Display Type: Icon Only */
.bcc-user-trigger-icon,
.bcc-user-trigger.bcc-user-trigger-icon {
	padding: 0;
	min-width: auto;
	width: auto;
	height: auto;
	background: transparent !important;
	border: none !important;
}

.bcc-user-trigger-icon .bcc-user-trigger-icon,
.bcc-user-trigger.bcc-user-trigger-icon .bcc-user-trigger-icon {
	margin: 0;
}

.bcc-user-trigger-icon .bcc-user-trigger-text,
.bcc-user-trigger.bcc-user-trigger-icon .bcc-user-trigger-text {
	display: none;
}

/* Remove default hover styles for icon-only mode */
.bcc-user-trigger-icon:hover,
.bcc-user-trigger.bcc-user-trigger-icon:hover {
	background: transparent !important;
}

/* ==============================
   POPOVER
   ============================== */
.bcc-user-popover {
	/* Offset custom properties (controlled by Elementor) */
	--popover-offset-x: 0px;
	--popover-offset-y: 0px;

	position: absolute;
	top: 100%;
	z-index: 99999;
	background-color: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	width: 250px;
	padding: 20px;
	margin-top: calc(10px + var(--popover-offset-y));
	margin-left: var(--popover-offset-x);

	/* Hidden by default - display:none prevents flash on page load */
	display: none;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform-origin: top center;
}

/* Popover positions */
.bcc-user-popover[data-position="bottom-left"],
.bcc-user-widget-wrapper[data-position="bottom-left"] .bcc-user-popover {
	left: 0;
	right: auto;
	transform-origin: top left;
}

.bcc-user-popover[data-position="bottom-center"],
.bcc-user-widget-wrapper[data-position="bottom-center"] .bcc-user-popover {
	left: 50%;
	transform: translateX(-50%);
	transform-origin: top center;
}

.bcc-user-popover[data-position="bottom-right"],
.bcc-user-widget-wrapper[data-position="bottom-right"] .bcc-user-popover {
	right: 0;
	left: auto;
	transform-origin: top right;
}

/* Popover open state */
.bcc-user-popover.is-open {
	display: block !important;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Animation: Fade */
.bcc-user-popover[data-animation="fade"] {
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Animation: Fade & Slide */
.bcc-user-popover[data-animation="fade-slide"] {
	transform: translateY(-10px);
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.bcc-user-popover[data-animation="fade-slide"][data-position="bottom-center"] {
	transform: translateX(-50%) translateY(-10px);
}

.bcc-user-popover[data-animation="fade-slide"].is-open {
	transform: translateY(0);
}

.bcc-user-popover[data-animation="fade-slide"][data-position="bottom-center"].is-open {
	transform: translateX(-50%) translateY(0);
}

/* Animation: Scale */
.bcc-user-popover[data-animation="scale"] {
	transform: scale(0.9);
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.bcc-user-popover[data-animation="scale"][data-position="bottom-center"] {
	transform: translateX(-50%) scale(0.9);
}

.bcc-user-popover[data-animation="scale"].is-open {
	transform: scale(1);
}

.bcc-user-popover[data-animation="scale"][data-position="bottom-center"].is-open {
	transform: translateX(-50%) scale(1);
}

/* ==============================
   USER INFO SECTION
   ============================== */
.bcc-user-info-section,
.bcc-company-info-section {
	display: flex;
	flex-direction: column;
	margin-bottom: 5px;
}

.bcc-user-label {
	font-size: 12px;
	color: #666666;
	margin-bottom: 2px;
}

.bcc-user-name {
	font-size: 16px;
	font-weight: 600;
	color: #333333;
	line-height: 1.3;
}

.bcc-company-name {
	font-size: 14px;
	color: #555555;
	line-height: 1.3;
}

/* ==============================
   DIVIDER
   ============================== */
.bcc-popover-divider {
	width: 100%;
	height: 1px;
	background-color: #e0e0e0;
	margin: 15px 0;
	display: block;
}

/* ==============================
   POPOVER LINKS
   ============================== */
.bcc-popover-links {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.bcc-popover-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
	border-radius: 6px;
	text-decoration: none;
	color: #333333;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 0.2s ease, color 0.2s ease;
	cursor: pointer;
	border: none;
	background: transparent;
	width: 100%;
	text-align: left;
}

.bcc-popover-link:hover {
	background-color: #f5f5f5;
	color: #000000;
	text-decoration: none;
}

.bcc-popover-link:focus {
	outline: none;
}

.bcc-popover-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.bcc-popover-link-text {
	flex: 1;
	text-align: left;
}

.bcc-popover-link-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 10px;
	flex-shrink: 0;
}

.bcc-popover-link-icon i,
.bcc-popover-link-icon svg {
	display: block;
	width: 16px;
	height: 16px;
	color: inherit;
	fill: currentColor;
}

.bcc-popover-link-icon img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ==============================
   EDITOR PREVIEW
   ============================== */
.elementor-editor-active .bcc-user-widget-wrapper,
.elementor-editor-active .bcc-user-widget-wrapper * {
	box-sizing: border-box;
}

/* Keep wrapper inline in editor - don't break header layouts */
.elementor-editor-active .bcc-user-widget-wrapper {
	display: inline-flex;
}

/* In editor: popover works normally via click (controlled by JS and is-open class) */
/* Enable pointer events so clicking works in the editor */
.elementor-editor-active .bcc-user-trigger {
	cursor: pointer;
	display: inline-flex;
}

/* CRITICAL: Force popover to be HIDDEN in editor by default */
/* This prevents the popover from blocking other elements during editing */
/* Using display:none as it cannot be overridden by Elementor's inline styles */
.elementor-editor-active .bcc-user-popover,
.elementor-editor-active .bcc-user-widget-wrapper .bcc-user-popover,
.elementor-editor-preview .bcc-user-popover,
body.elementor-editor-active .bcc-user-popover {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/* Only show popover when it explicitly has the is-open class (via JS click) */
.elementor-editor-active .bcc-user-popover.is-open,
.elementor-editor-active .bcc-user-widget-wrapper .bcc-user-popover.is-open,
.elementor-editor-preview .bcc-user-popover.is-open,
body.elementor-editor-active .bcc-user-popover.is-open {
	display: block !important;
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
	z-index: 99999;
}

/* Ensure editor preview elements have default colors if not styled */
.elementor-editor-active .bcc-user-name {
	color: #333333;
}

.elementor-editor-active .bcc-company-name {
	color: #555555;
}

.elementor-editor-active .bcc-popover-link {
	color: #333333;
}

.elementor-editor-active .bcc-popover-divider {
	background-color: #e0e0e0;
	height: 1px;
	margin: 15px 0;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 767px) {
	.bcc-user-popover {
		width: 220px;
		padding: 15px;
	}

	.bcc-user-name {
		font-size: 15px;
	}

	.bcc-company-name {
		font-size: 13px;
	}

	.bcc-popover-link {
		padding: 8px 10px;
		font-size: 13px;
	}
}

/* ==============================
   ACCESSIBILITY
   ============================== */
@media (prefers-reduced-motion: reduce) {
	.bcc-user-trigger,
	.bcc-user-popover,
	.bcc-popover-link {
		transition: none;
	}
}
