/**
 * Custom Modal Styles
 * Modales personalizados con diseño moderno y animaciones
 * Uso: Agrega la clase .custom-modal al contenedor principal del modal
 */

/* Contenedor principal del modal */
.custom-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	overflow-y: auto;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(3px);
}

/* Modal visible */
.custom-modal.show {
	display: flex !important;
	align-items: center;
	justify-content: center;
}

/* Diálogo del modal */
.custom-modal .modal-dialog-custom {
	position: relative;
	width: 90%;
	max-width: 900px;
	margin: 2rem auto;
	background: white;
	border-radius: 1rem;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	animation: modalSlideIn 0.3s ease-out;
}

/* Modal grande */
.custom-modal.modal-lg .modal-dialog-custom {
	max-width: 1000px;
}

/* Modal extra grande */
.custom-modal.modal-xl .modal-dialog-custom {
	max-width: 1200px;
}

/* Modal pequeño */
.custom-modal.modal-sm .modal-dialog-custom {
	max-width: 500px;
}

/* Animación de entrada */
@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-50px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Cabecera del modal */
.custom-modal .modal-header-custom {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 1.5rem;
	border-radius: 1rem 1rem 0 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* Variantes de color para la cabecera */
.custom-modal.modal-primary .modal-header-custom {
	background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.custom-modal.modal-success .modal-header-custom {
	background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.custom-modal.modal-danger .modal-header-custom {
	background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
}

.custom-modal.modal-warning .modal-header-custom {
	background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.custom-modal.modal-info .modal-header-custom {
	background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.custom-modal.modal-dark .modal-header-custom {
	background: linear-gradient(135deg, #343a40 0%, #23272b 100%);
}

/* Título del modal */
.custom-modal .modal-header-custom h4,
.custom-modal .modal-header-custom h5 {
	margin: 0;
	font-weight: bold;
	font-size: 1.5rem;
}

.custom-modal .modal-header-custom h4 i,
.custom-modal .modal-header-custom h5 i {
	margin-right: 0.5rem;
}

/* Botón de cerrar */
.custom-modal .btn-close-custom {
	background: transparent;
	border: none;
	color: white;
	font-size: 1.5rem;
	cursor: pointer;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	opacity: 0.8;
}

.custom-modal .btn-close-custom:hover {
	background: rgba(255, 255, 255, 0.2);
	opacity: 1;
	transform: rotate(90deg);
}

.custom-modal .btn-close-custom:active {
	transform: rotate(90deg) scale(0.9);
}

/* Cuerpo del modal */
.custom-modal .modal-body-custom {
	padding: 2rem;
	max-height: 70vh;
	overflow-y: auto;
}

/* Scroll personalizado para el cuerpo del modal */
.custom-modal .modal-body-custom::-webkit-scrollbar {
	width: 8px;
}

.custom-modal .modal-body-custom::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 10px;
}

.custom-modal .modal-body-custom::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 10px;
}

.custom-modal .modal-body-custom::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* Pie del modal */
.custom-modal .modal-footer-custom {
	padding: 1rem 1.5rem;
	border-top: 1px solid #dee2e6;
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	border-radius: 0 0 1rem 1rem;
}

/* Responsive para móviles */
@media (max-width: 768px) {
	.custom-modal .modal-dialog-custom {
		width: 95%;
		margin: 1rem auto;
	}
	
	.custom-modal .modal-header-custom {
		padding: 1rem;
	}
	
	.custom-modal .modal-header-custom h4,
	.custom-modal .modal-header-custom h5 {
		font-size: 1.2rem;
	}
	
	.custom-modal .modal-body-custom {
		padding: 1rem;
		max-height: 60vh;
	}
	
	.custom-modal .modal-footer-custom {
		padding: 0.75rem 1rem;
	}
}

/* Animación de salida (opcional) */
.custom-modal.hiding {
	animation: modalSlideOut 0.3s ease-out forwards;
}

@keyframes modalSlideOut {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(-50px);
	}
}

/* Overlay con efecto de blur mejorado */
.custom-modal::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: inherit;
	z-index: -1;
}

/* Sombra adicional para mayor profundidad */
.custom-modal.show .modal-dialog-custom {
	box-shadow: 
		0 10px 40px rgba(0, 0, 0, 0.3),
		0 0 0 1px rgba(255, 255, 255, 0.1);
}
