/* ── Modal shell ─────────────────────────────────────────────── */
.ugmi-im-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.ugmi-im-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.ugmi-im-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 22, 38, 0.82);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	cursor: pointer;
}

/* ── Dialog ──────────────────────────────────────────────────── */
.ugmi-im-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 720px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 20px;
	border: none;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.08),
		0 32px 80px rgba(15, 22, 38, 0.45),
		0 8px 24px rgba(15, 22, 38, 0.2);
	overflow: hidden;
	transform: scale(0.94) translateY(24px);
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.ugmi-im-modal.is-open .ugmi-im-modal__dialog {
	transform: scale(1) translateY(0);
}

.ugmi-im-modal--has-sidebar .ugmi-im-modal__dialog {
	max-width: 920px;
}

.ugmi-im-modal--custom-width .ugmi-im-modal__dialog {
	width: min(var(--ugmi-im-width), calc(100vw - 40px));
	max-width: min(var(--ugmi-im-width), calc(100vw - 40px));
}

.ugmi-im-modal--custom-height .ugmi-im-modal__dialog {
	height: min(var(--ugmi-im-height), calc(100vh - 40px));
}

.ugmi-im-modal--has-media:not(.ugmi-im-modal--custom-height):not(.ugmi-im-modal--has-sidebar) .ugmi-im-modal__dialog {
	height: min(75vh, 600px);
}

/* ── Two-column layout (sidebar + main) ──────────────────────── */
.ugmi-im-modal__layout {
	display: grid;
	grid-template-columns: 380px 1fr;
	min-height: 0;
	align-items: stretch;
}

.ugmi-im-modal--has-sidebar .ugmi-im-modal__dialog {
	display: flex;
	flex-direction: column;
	height: auto;
	max-height: calc(100vh - 40px);
}

.ugmi-im-modal--has-sidebar .ugmi-im-modal__layout {
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

/* ── Brand panel (left sidebar) ──────────────────────────────── */
.ugmi-im-brand {
	position: relative;
	background: linear-gradient(155deg, #1b263d 0%, #243352 45%, #2a4068 100%);
	color: #fff;
	padding: 20px 28px 28px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	overflow-x: hidden;
	overflow-y: auto;
	min-height: 0;
	align-self: stretch;
}

.ugmi-im-brand::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 80% 60% at 20% 110%, rgba(201, 162, 39, 0.18) 0%, transparent 60%),
		radial-gradient(ellipse 60% 50% at 100% 0%, rgba(255, 255, 255, 0.06) 0%, transparent 55%);
	pointer-events: none;
}

.ugmi-im-brand::after {
	content: "";
	position: absolute;
	top: -40px;
	right: -40px;
	width: 180px;
	height: 180px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.07);
	pointer-events: none;
}

.ugmi-im-brand__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.ugmi-im-brand__logo {
	margin: 0 0 6px;
	max-width: 100%;
	flex-shrink: 0;
}

.ugmi-im-brand__logo-img {
	display: block;
	width: 100%;
	max-width: var(--ugmi-im-logo-width, 316px);
	height: auto;
	object-fit: contain;
}

.ugmi-im-brand__logo-img--png {
	filter: brightness(0) invert(1);
}

.ugmi-im-brand__content {
	flex: 0 1 auto;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ugmi-im-brand__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	background: rgba(201, 162, 39, 0.2);
	border: 1px solid rgba(201, 162, 39, 0.45);
	border-radius: 100px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #f0d080;
	margin: 0 0 10px;
	align-self: flex-start;
}

.ugmi-im-brand__badge-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #c9a227;
	animation: ugmi-im-pulse 2s ease-in-out infinite;
}

@keyframes ugmi-im-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.5; transform: scale(0.85); }
}

.ugmi-im-brand__hook {
	margin: 0 0 8px;
	font-size: 1.65rem;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: #fff;
}

.ugmi-im-brand__desc {
	margin: 0 0 16px;
	font-size: 0.9rem;
	line-height: 1.65;
	color: rgba(255, 255, 255, 0.72);
}

.ugmi-im-brand__trust {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ugmi-im-brand__trust li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.85rem;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.85);
}

.ugmi-im-brand__trust-icon {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	background: rgba(201, 162, 39, 0.25);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 1px;
}

.ugmi-im-brand__trust-icon svg {
	width: 14px;
	height: 14px;
	fill: #f0d080;
}

.ugmi-im-brand__support {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	flex-shrink: 0;
}

.ugmi-im-brand__support-heading {
	margin: 0 0 10px;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.55);
}

.ugmi-im-brand__support-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	color: rgba(255, 255, 255, 0.9);
	text-decoration: none;
	font-size: 0.875rem;
	line-height: 1.4;
	transition: color 0.2s ease;
}

.ugmi-im-brand__support-link:hover {
	color: #f0d080;
}

.ugmi-im-brand__support-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	flex-shrink: 0;
}

.ugmi-im-brand__support-icon svg {
	width: 16px;
	height: 16px;
	fill: #f0d080;
}

.ugmi-im-brand__legacy-content {
	margin-top: 16px;
	font-size: 0.9rem;
	line-height: 1.65;
	color: rgba(255, 255, 255, 0.85);
}

.ugmi-im-brand__legacy-content a {
	color: #f0d080;
}

/* ── Content panel (right side) ──────────────────────────────── */
.ugmi-im-content-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	min-height: 0;
	align-self: stretch;
}

.ugmi-im-modal--has-sidebar .ugmi-im-content-panel {
	overflow-y: auto;
	min-height: 0;
}

.ugmi-im-content-panel__header {
	padding: 36px 36px 0;
	flex-shrink: 0;
}

.ugmi-im-content-panel__header .ugmi-im-modal__title {
	margin: 0 0 4px;
	font-size: 1.35rem;
	font-weight: 700;
	color: #1b263d;
	line-height: 1.3;
}

.ugmi-im-content-panel__subtitle {
	margin: 0;
	font-size: 0.875rem;
	color: #6b7280;
}

.ugmi-im-content-panel__body {
	padding: 24px 36px 36px;
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

/* ── Header ──────────────────────────────────────────────────── */
.ugmi-im-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 24px;
	flex-shrink: 0;
	background: #fff;
}

.ugmi-im-modal__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	color: #1b263d;
	line-height: 1.3;
}

/* ── Close button ────────────────────────────────────────────── */
.ugmi-im-modal__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(27, 38, 61, 0.07);
	color: #1b263d;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
	flex-shrink: 0;
}

.ugmi-im-modal__close:hover {
	background: rgba(27, 38, 61, 0.14);
	transform: rotate(90deg);
}

.ugmi-im-modal__close--panel {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 10;
}

.ugmi-im-modal__header .ugmi-im-modal__close:hover {
	transform: rotate(90deg);
}

/* ── Body & content ──────────────────────────────────────────── */
.ugmi-im-modal__body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
}

.ugmi-im-modal--has-media .ugmi-im-modal__body {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ugmi-im-modal__content {
	padding: 24px 36px 36px;
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.ugmi-im-modal__content--panel {
	padding: 0;
	flex: 1;
}

.ugmi-im-modal--has-media .ugmi-im-modal__content {
	padding: 0;
}

.ugmi-im-modal--has-sidebar.ugmi-im-modal--has-media .ugmi-im-modal__content {
	padding: 0;
}

.ugmi-im-modal--has-media .ugmi-im-modal__editor-content {
	padding: 24px 36px 0;
	flex-shrink: 0;
}

.ugmi-im-content-panel__body .ugmi-im-modal__editor-content {
	padding: 0 0 16px;
}

.ugmi-im-modal__editor-content {
	font-size: 0.95rem;
	line-height: 1.7;
	color: #2c3344;
}

.ugmi-im-modal__editor-content > :first-child {
	margin-top: 0;
}

.ugmi-im-modal__editor-content > :last-child {
	margin-bottom: 0;
}

.ugmi-im-modal__editor-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.ugmi-im-modal__editor-content h1,
.ugmi-im-modal__editor-content h2,
.ugmi-im-modal__editor-content h3 {
	color: #1b263d;
	margin-top: 1.2em;
	margin-bottom: 0.5em;
}

/* Shortcodes inside modal (e.g. announcements list) */
.ugmi-im-modal__editor-content .ugmi-list__title {
	font-size: 1rem;
	margin-bottom: 14px;
}

.ugmi-im-modal__editor-content .ugmi-list__link {
	padding: 12px 0;
}

.ugmi-im-modal__editor-content .ugmi-list__footer {
	margin-top: 14px;
}

/* ── Media stage ─────────────────────────────────────────────── */
.ugmi-im-modal__media-stage {
	position: relative;
	flex: 1 1 auto;
	width: 100%;
	min-height: 0;
	overflow: hidden;
	background: #fff;
}

.ugmi-im-modal__media-slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.ugmi-im-modal__media-slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

.ugmi-im-modal__media-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.ugmi-im-modal__media-slide--pdf {
	background: #fff;
}

.ugmi-im-modal__pdf-viewer {
	display: block;
	width: 100%;
	height: 100%;
	border: none;
	background: #fff;
}

.ugmi-im-modal--media-fill .ugmi-im-modal__content {
	padding: 0;
}

.ugmi-im-modal--media-fill:not(.ugmi-im-modal--has-sidebar) .ugmi-im-modal__header {
	padding-bottom: 0;
}

.ugmi-im-modal__media-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	margin: 0;
	padding: 28px 16px 12px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
	color: #fff;
	font-size: 0.8rem;
	text-align: center;
}

.ugmi-im-modal__gallery-nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #1b263d;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	transition: background 0.2s, transform 0.2s;
}

.ugmi-im-modal__gallery-nav:hover {
	background: #fff;
	transform: translateY(-50%) scale(1.05);
}

.ugmi-im-modal__gallery-nav--prev { left: 12px; }
.ugmi-im-modal__gallery-nav--next { right: 12px; }

.ugmi-im-modal__gallery-dots {
	position: absolute;
	bottom: 12px;
	left: 50%;
	z-index: 3;
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
}

.ugmi-im-modal__gallery-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	transition: background 0.2s, transform 0.2s;
}

.ugmi-im-modal__gallery-dot.is-active {
	background: #fff;
	transform: scale(1.15);
}

/* ── Footer ──────────────────────────────────────────────────── */
.ugmi-im-modal__footer {
	padding: 16px 36px 24px;
	background: #fff;
	font-size: 0.875rem;
	color: #6b7280;
	flex-shrink: 0;
	position: relative;
	z-index: 2;
}

.ugmi-im-modal__footer--panel {
	padding: 0;
	margin-top: auto;
}

.ugmi-im-modal__footer p {
	margin: 0;
}

/* ── Optional borders ────────────────────────────────────────── */
.ugmi-im-modal--bordered .ugmi-im-modal__dialog {
	border: 1px solid #e8ecf2;
}

.ugmi-im-modal--bordered .ugmi-im-modal__header,
.ugmi-im-modal--bordered .ugmi-im-modal__header--panel {
	border-bottom: 1px solid #e8ecf2;
}

.ugmi-im-modal--bordered .ugmi-im-modal__footer {
	border-top: 1px solid #e8ecf2;
}

.ugmi-im-modal--bordered.ugmi-im-modal--has-sidebar .ugmi-im-content-panel {
	border-left: 1px solid #e8ecf2;
}

/* ── Open button (shortcode) ─────────────────────────────────── */
.ugmi-im-open-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	background: #1b263d;
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease;
}

.ugmi-im-open-btn:hover {
	background: #2a4068;
	transform: translateY(-1px);
}

body.ugmi-im-modal-open {
	overflow: hidden;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 720px) {
	.ugmi-im-modal--hide-mobile {
		display: none !important;
	}

	.ugmi-im-modal {
		padding: 0;
		align-items: flex-end;
	}

	.ugmi-im-modal__dialog {
		max-height: 96vh;
		border-radius: 20px 20px 0 0;
		max-width: 100%;
		transform: translateY(100%);
	}

	.ugmi-im-modal.is-open .ugmi-im-modal__dialog {
		transform: translateY(0);
	}

	.ugmi-im-modal--custom-width .ugmi-im-modal__dialog {
		width: 100%;
		max-width: 100%;
	}

	.ugmi-im-modal--custom-height .ugmi-im-modal__dialog {
		height: min(var(--ugmi-im-height), 96vh);
	}

	.ugmi-im-modal--has-media:not(.ugmi-im-modal--custom-height):not(.ugmi-im-modal--has-sidebar) .ugmi-im-modal__dialog {
		height: min(85vh, 96vh);
	}

	.ugmi-im-modal__layout {
		grid-template-columns: 1fr;
	}

	.ugmi-im-brand {
		padding: 16px 24px 20px;
	}

	.ugmi-im-brand__logo {
		margin-bottom: 4px;
	}

	.ugmi-im-brand__hook {
		font-size: 1.25rem;
	}

	.ugmi-im-brand__desc {
		margin-bottom: 12px;
	}

	.ugmi-im-brand__support {
		margin-top: 16px;
		padding-top: 14px;
	}

	.ugmi-im-content-panel {
		max-height: none;
	}

	.ugmi-im-content-panel__header {
		padding: 20px 24px 0;
	}

	.ugmi-im-content-panel__body {
		padding: 16px 24px 28px;
	}

	.ugmi-im-modal__header {
		padding: 20px 56px 0 24px;
	}

	.ugmi-im-modal__content {
		padding: 16px 24px 24px;
	}

	.ugmi-im-modal--has-media .ugmi-im-modal__editor-content {
		padding: 16px 24px 0;
	}

	.ugmi-im-modal__footer {
		padding: 14px 24px 20px;
	}

	.ugmi-im-modal__title {
		font-size: 1.15rem;
	}

	.ugmi-im-modal__gallery-nav {
		width: 32px;
		height: 32px;
		font-size: 1.2rem;
	}
}
