/* GSSMG Gravity Photo Slots — frontend styles.
 *
 * Functional defaults (sizing, click area, hidden-state enforcement) are required for the
 * plugin to work out of the box. Visual styling (colors, shapes, hover) is provided as a
 * sensible starting point — override freely in your theme/Elementor with higher specificity,
 * or disable this stylesheet entirely via the gssmg_gps_load_css filter.
 */

/* ---------- Native input: hide accessibly without breaking <label for> click association ---------- */
.gssmg-gps-native-input {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* GF rules description we suppress */
.gssmg-gps-hidden {
	display: none !important;
}

/* ---------- Wrapper (positioning context for the remove button) ---------- */
div.gssmg-gps-wrapper {
    background: #eaa12d;
    border-radius: 50%;
    cursor: pointer;
    width: 70px;
    height: 70px;
    display: flex;
    place-content: center;
    align-items: center;
    position: relative;
}

/* ---------- Slot (the clickable label) ---------- */
label.gssmg-gps-slot {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	cursor: pointer;
	background: #D9D9D9;
	color: #888;
	border-radius: 50%;
	overflow: hidden;
	transition: background-color 0.15s ease;
	box-sizing: border-box;

	&:hover {
		background: #e9a02c;
	}
}


/* Visible focus when the (hidden) input has keyboard focus */
.gssmg-gps-native-input:focus + .gssmg-gps-wrapper .gssmg-gps-slot,
.gssmg-gps-wrapper:focus-within .gssmg-gps-slot {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* ---------- Empty-state icon (built-in SVG or admin-uploaded image) ---------- */
.gssmg-gps-slot__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: 70%;
	max-height: 70%;
	pointer-events: none;
	
	svg {
		display: block;
		width: 35px;
		height: 35px;

		* {
			stroke: white;
		}
	}
}


.gssmg-gps-slot__icon-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* ---------- Filled state (image preview) ---------- */
.gssmg-gps-slot--image {
	background: transparent;
}

img.gssmg-gps-slot__preview {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

/* ---------- Filled state (PDF / non-image / oversized) ---------- */
.gssmg-gps-slot--doc {
	flex-direction: column;
	gap: 2px;
	padding: 4px;
	background: #fff8e6;
	color: #8a6d00;
}

.gssmg-gps-slot__filename {
	font-size: 9px;
	line-height: 1.1;
	text-align: center;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-all;
	pointer-events: none;
}

/* ---------- Remove button ---------- */
div.gssmg-gps-remove {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 25px;
	height: 25px;
	padding: 0;
	margin: 0;
	border: 2px solid #fff;
	background: #123656;
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	z-index: 2;
	transition: all .15s ease-in-out;

	span {
		display: block;
		line-height: 0.9;
		font-size: 20px;
		font-weight: bold;
	}

	&:hover {
		background: #e9a02c;
	}

	&[hidden] {
		display: none;
	}
}


/* ---------- Debug visualization (engaged when admin enables Debug Mode) ---------- */
body.gssmg-gps-debug-on .gssmg-gps-wrapper {
	outline: 1px dashed #ff00ff;
	outline-offset: -1px;
}

body.gssmg-gps-debug-on .gssmg-gps-slot {
	outline: 1px dashed #00bcd4;
	outline-offset: -1px;
}

body.gssmg-gps-debug-on .gssmg-gps-remove {
	outline: 1px dashed #ffeb3b;
}

body.gssmg-gps-debug-on .gssmg-gps-slot::after {
	content: attr(for);
	position: absolute;
	bottom: 2px;
	left: 0;
	right: 0;
	font-size: 8px;
	color: #ff00ff;
	text-align: center;
	pointer-events: none;
	font-family: monospace;
	background: rgba(255, 255, 255, 0.7);
}
