/* Button Styles */
.sg-floating-button {
	position: fixed;
	z-index: 9998;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border-radius: 4px;
	cursor: pointer;
	font-family: inherit;
	font-weight: 600;
	font-size: 14px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	transition: transform 0.2s ease;
}
.sg-floating-button:hover {
	transform: translateY(-2px);
}

.sg-pos-right {
	top: 50%;
	right: 0;
	transform: translateY(-50%) rotate(-90deg);
	transform-origin: right bottom;
	border-radius: 4px 4px 0 0;
}
.sg-pos-right:hover {
	transform: translateY(-50%) rotate(-90deg) translateX(2px);
}

.sg-pos-left {
	top: 50%;
	left: 0;
	transform: translateY(-50%) rotate(90deg);
	transform-origin: left bottom;
	border-radius: 4px 4px 0 0;
}
.sg-pos-left:hover {
	transform: translateY(-50%) rotate(90deg) translateX(-2px);
}

.sg-pos-bottom {
	bottom: 20px;
	right: 20px;
	border-radius: 30px;
}

/* Button Themes */
.sg-style-dark { background: #111; color: #fff; }
.sg-style-light { background: #fff; color: #111; border: 1px solid #ddd; }
.sg-style-brand { background: var(--e-global-color-primary, #0073aa); color: #fff; }

/* Overlay Styles */
.sg-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
}
.sg-overlay.active {
	display: flex;
}

body.admin-bar .sg-overlay {
	top: var(--wp-admin--admin-bar--height, 32px);
	height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
}
@media screen and (max-width: 782px) {
	body.admin-bar .sg-overlay {
		top: 46px;
		height: calc(100vh - 46px);
	}
}

.sg-overlay-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(44, 44, 44, 0.4); /* Soften the overlay background */
	backdrop-filter: blur(5px);
}

/* Premium Panel Styling */
.sg-panel {
	position: relative;
	background: #FAF8F5; /* Main background from palette */
	width: 90%;
	max-width: 680px; /* Slightly wider for elegant spacing */
	max-height: 85vh;
	overflow-y: auto;
	border-radius: 12px; /* Soft rounded corners */
	border: 1px solid #E5DEC9; /* Border from palette */
	box-shadow: 0 12px 36px rgba(44, 44, 44, 0.08); /* Light, elegant shadow */
	display: flex;
	flex-direction: column;
}

/* Scrollbar styling for the panel */
.sg-panel::-webkit-scrollbar {
    width: 6px;
}
.sg-panel::-webkit-scrollbar-track {
    background: transparent;
}
.sg-panel::-webkit-scrollbar-thumb {
    background: #E5DEC9;
    border-radius: 3px;
}

/* Modal vs Slide-in */
.sg-type-modal .sg-panel {
	animation: sg-fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.sg-type-slide {
	justify-content: stretch;
	align-items: stretch;
}
.sg-type-slide .sg-panel {
	position: absolute;
	right: 0;
	top: 0;
	height: 100%;
	max-height: 100%;
	border-radius: 0;
	border: none;
	border-left: 1px solid #E5DEC9;
	animation: sg-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	width: 440px;
	max-width: 90vw;
}

@keyframes sg-fade-up {
	from { opacity: 0; transform: translateY(20px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sg-slide-in {
	from { transform: translateX(100%); }
	to { transform: translateX(0); }
}

/* Premium Panel Content */
.sg-header {
	display: flex;
	justify-content: center; /* Center the title */
	align-items: center;
	padding: 32px 32px 24px;
	position: relative;
	background: #F3EEE8; /* Secondary background for header */
	border-bottom: 1px solid #E5DEC9;
	border-radius: 12px 12px 0 0;
}

.sg-type-slide .sg-header {
	border-radius: 0;
}

.sg-header h2 {
	margin: 0;
	font-family: 'Cormorant Garamond', serif;
	font-size: 32px;
	font-weight: 600;
	color: #2C2C2C; /* Primary text */
	letter-spacing: 0.02em;
}

.sg-close {
	position: absolute;
	right: 24px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #2C2C2C;
	cursor: pointer;
	padding: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	opacity: 0.6;
}

.sg-close:hover {
	opacity: 1;
	background: rgba(216, 198, 175, 0.2); /* Accent color with low opacity for hover */
}

.sg-body {
	padding: 40px 32px;
}

.sg-chart-container {
	display: flex;
	justify-content: center;
}

.sg-chart-container img {
	box-shadow: 0 4px 12px rgba(44, 44, 44, 0.05); /* Very subtle shadow on the image itself */
}

.sg-chart-container p {
	color: #2C2C2C;
	font-family: 'Cormorant Garamond', serif;
	font-size: 20px;
	font-style: italic;
	text-align: center;
}

/* Responsive Styles */
@media screen and (max-width: 1024px) {
	.sg-panel {
		width: 95%;
	}
	.sg-type-slide .sg-panel {
		width: 380px;
	}
}

@media screen and (max-width: 767px) {
	.sg-floating-button {
		padding: 10px 14px;
		font-size: 13px;
	}
	.sg-pos-bottom {
		bottom: 10px;
		right: 10px;
	}
	
	.sg-panel {
		width: 100%;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
		border: none;
		margin: 0;
	}
	.sg-type-modal .sg-panel {
		animation: sg-fade-up-mobile 0.3s ease;
	}
	.sg-type-slide .sg-panel {
		width: 100%;
		max-width: 100%;
	}
	
	.sg-header {
		padding: 24px 20px 20px;
		border-radius: 0;
	}
	
	.sg-header h2 {
		font-size: 28px;
	}
	
	.sg-close {
		right: 16px;
	}
	
	.sg-body {
		padding: 24px 20px;
	}
}

@keyframes sg-fade-up-mobile {
	from { opacity: 0; transform: translateY(100%); }
	to { opacity: 1; transform: translateY(0); }
}
