/**
 * Modal Component - Standalone, no Bootstrap
 * Backdrop built into modal structure
 */

.modal-component {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1050;
	display: none;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.modal-component.show {
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
	pointer-events: auto;
}

/* Backdrop - built into modal */
.modal-component-backdrop {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	background-color: rgba(0, 0, 0, 0.5) !important;
	z-index: 1040 !important;
	pointer-events: auto !important;
	cursor: pointer !important;
}

/* Dialog container */
.modal-component-dialog {
	position: relative;
	width: 90%;
	max-width: 500px;
	margin: 1.75rem auto;
	z-index: 1051;
	pointer-events: none;
}

.modal-component-dialog.large {
	max-width: 800px;
}

.modal-component-dialog.small {
	max-width: 400px;
}

/* Content box */
.modal-component-content {
	position: relative;
	background-color: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	z-index: 1052;
	pointer-events: auto;
	max-height: 90vh;
	overflow: hidden;
}

/* Header */
.modal-component-header {
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid #e9ecef;
	border-radius: 12px 12px 0 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	flex-shrink: 0;
}

.modal-component-header.plain {
	background: #f8f9fa;
	color: #212529;
}

.modal-component-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	display: flex;
	align-items: center;
}

.modal-component-title i {
	margin-inline-end: 0.5rem;
}

.modal-component-close {
	background: none !important;
	border: none !important;
	color: white !important;
	font-size: 1.5rem !important;
	line-height: 1 !important;
	cursor: pointer !important;
	padding: 0 !important;
	width: 30px !important;
	height: 30px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	border-radius: 50% !important;
	transition: background-color 0.2s ease !important;
	opacity: 0.8 !important;
	pointer-events: auto !important;
	z-index: 1053 !important;
	position: relative !important;
}

.modal-component-close:hover {
	opacity: 1;
	background-color: rgba(255, 255, 255, 0.2);
}

.modal-component-header.plain .modal-component-close {
	color: #212529;
}

.modal-component-header.plain .modal-component-close:hover {
	background-color: rgba(0, 0, 0, 0.1);
}

/* Body - scrollable */
.modal-component-body {
	padding: 1.5rem;
	flex: 1 1 auto;
	overflow-y: auto;
	overflow-x: hidden;
}

/* Footer */
.modal-component-footer {
	padding: 1rem 1.5rem;
	border-top: 1px solid #e9ecef;
	border-radius: 0 0 12px 12px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	flex-shrink: 0;
}

/* Prevent body scroll */
body.modal-component-open {
	overflow: hidden !important;
}

/* Button styles */
.modal-btn {
	border-radius: 8px;
	padding: 0.5rem 1.25rem;
	font-weight: 500;
	transition: all 0.3s ease;
	border: none;
	cursor: pointer;
}

.modal-btn-primary {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
}

.modal-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modal-btn-secondary {
	background: #6c757d;
	color: white;
}

.modal-btn-secondary:hover {
	background: #5a6268;
}

.modal-form-control {
	border-radius: 8px;
	border: 1px solid #e0e0e0;
	padding: 0.5rem 1rem;
	width: 100%;
}

.modal-form-control:focus {
	border-color: #667eea;
	box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
	outline: none;
}
