/**
 * Global Modal Styles
 * Iframe modal overlay system matching calendar modal design
 *
 * @package GospelHope
 */

/* Modal Overlay */
.globalModal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.globalModal[aria-hidden="false"],
.globalModal--active {
	display: flex;
	animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* Overlay Background */
.globalModal__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(26, 43, 71, 0.8);
	backdrop-filter: blur(8px);
	cursor: pointer;
}

/* Modal Container */
.globalModal__container {
	position: relative;
	background: #fff;
	border-radius: 20px;
	width: 90%;
	max-width: 1200px;
	height: 90vh;
	max-height: 800px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
	z-index: 1;
	display: flex;
	flex-direction: column;
	animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Close Button */
.globalModal__close {
	position: absolute;
	top: 1.25rem;
	right: 1.25rem;
	background: #f0f2f5;
	border: none;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	color: var(--color-navy, #1a2b47);
	cursor: pointer;
	z-index: 2;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-size: 1.5rem;
}

.globalModal__close:hover,
.globalModal__close:focus {
	background: var(--color-lime, #8dc63f);
	color: #fff;
	transform: rotate(90deg);
	outline: none;
}

.globalModal__close:focus-visible {
	outline: 2px solid var(--color-lime);
	outline-offset: 2px;
}

.globalModal__close svg {
	width: 20px;
	height: 20px;
}

/* Modal Content */
.globalModal__content {
	flex: 1;
	border-radius: 20px;
	overflow: hidden;
	position: relative;
}

/* Iframe */
.globalModal__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	border-radius: 20px;
}

/* Body class when modal is open */
.globalModal--open {
	overflow: hidden;
}

/* Mobile Styles */
@media (max-width: 768px) {
	.globalModal__container {
		width: 95%;
		height: 95vh;
		max-height: none;
		border-radius: 16px;
	}

	.globalModal__content {
		border-radius: 16px;
	}

	.globalModal__iframe {
		border-radius: 16px;
	}

	.globalModal__close {
		top: 1rem;
		right: 1rem;
		width: 36px;
		height: 36px;
	}

	.globalModal__close svg {
		width: 18px;
		height: 18px;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.globalModal,
	.globalModal__container,
	.globalModal__close {
		animation: none;
		transition: none;
	}
}
