/**
 * CFS Dialog Component Styles
 * Adaptive dialog system for mobile and desktop
 */

/* Backdrop (overlay) */
.cfs-dialog-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 9998;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.cfs-dialog-backdrop.visible {
	opacity: 1;
}

/* Dialog container - Desktop default */
.cfs-dialog-container {
	position: fixed;
	left: 50%;
	top: 50%;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	z-index: 9999;
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.9);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.cfs-dialog-container.visible {
	opacity: 1 !important;
	transform: translate(-50%, -50%) scale(1) !important;
}

/* Dialog header */
.cfs-dialog-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #e0e0e0;
	flex-shrink: 0;
}

.cfs-dialog-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	color: #2c3e50;
}

.cfs-dialog-close {
	background: transparent;
	border: none;
	font-size: 2rem;
	line-height: 1;
	color: #7f8c8d;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: background-color 0.2s, color 0.2s;
}

.cfs-dialog-close:hover {
	background-color: #f0f0f0;
	color: #2c3e50;
}

.cfs-dialog-close:active {
	background-color: #e0e0e0;
}

/* Dialog content */
.cfs-dialog-content {
	padding: 24px;
	overflow-y: auto;
	flex: 1;
	min-height: 0; /* Allow flex shrink */
}

/* Dialog footer */
.cfs-dialog-footer {
	padding: 16px 24px;
	border-top: 1px solid #e0e0e0;
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	flex-shrink: 0;
}

.cfs-dialog-footer:empty {
	display: none;
}

/* Full height variant */
.cfs-dialog-container.full-height {
	max-height: 95vh;
}

/* Mobile styles */
@media (max-width: 768px) {
	.cfs-dialog-container.mobile {
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		transform: translateY(100%);
		width: 100%;
		max-width: 100%;
		border-radius: 16px 16px 0 0;
		max-height: 85vh;
	}
	
	.cfs-dialog-container.mobile.visible {
		transform: translateY(0);
		opacity: 1;
	}
	
	.cfs-dialog-container.mobile.full-height {
		max-height: 95vh;
	}
	
	/* Add pull indicator for mobile */
	.cfs-dialog-container.mobile .cfs-dialog-header::before {
		content: '';
		position: absolute;
		top: 8px;
		left: 50%;
		transform: translateX(-50%);
		width: 40px;
		height: 4px;
		background: #d0d0d0;
		border-radius: 2px;
	}
	
	.cfs-dialog-header {
		padding-top: 24px; /* Extra space for pull indicator */
	}
	
	.cfs-dialog-title {
		font-size: 1.25rem;
	}
	
	.cfs-dialog-content {
		padding: 20px;
	}
	
	.cfs-dialog-footer {
		padding: 16px 20px;
		flex-direction: column;
	}
	
	.cfs-dialog-footer button {
		width: 100%;
	}
}

/* Animations for better UX */
@media (prefers-reduced-motion: reduce) {
	.cfs-dialog-backdrop,
	.cfs-dialog-container {
		transition: none;
	}
}
