/* CSS actualizado para mantener 2 campos por línea en móvil */

/* Mantener la configuración actual para la mayoría de estilos */
:root {
	--primary-color: #1a73e8;
	--secondary-color: #f8f9fa;
	--accent-color: #4285f4;
	--text-color: #333;
	--border-color: #ddd;
}

/* Estilos generales */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: 'Segoe UI', Roboto, Arial, sans-serif;
	background-color: #f5f5f5;
	color: var(--text-color);
	line-height: 1.6;
	display: flex;
	justify-content: center;
}

/* Encabezado */
header {
	background: linear-gradient(135deg, #4CAF50, #388E3C);
	color: white;
	border-radius: 10px 10px 0 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

#backIcono {
	cursor: pointer;
	display: none;
}

header img {
	width: 80px;
	padding-left: 20px;
	padding-right: 20px;
}

h1 {
	font-size: 1.5rem;
	font-weight: 500;
	text-align: center;
}

/* Contenedor principal */
.form-container {
	width: 100%;
	max-width: 1024px;
	background-color: white;
	border-radius: 10px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

/* Formulario de búsqueda */
.search-form {
	padding-left: 10px;
	padding-right: 10px;
	padding-top: 10px;
	background-color: white;
}

.form-section {
	margin-bottom: 20px;
}

.section-title {
	background-color: var(--secondary-color);
	padding: 10px;
	margin-bottom: 15px;
	border-radius: 5px;
	text-align: center;
	font-weight: 500;
	color: var(--primary-color);
}

/* CAMBIO IMPORTANTE: Utiliza un grid de 2 columnas por defecto */
.form-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 15px;
}

/* En pantallas más grandes, aumentamos a 4 columnas */
@media (min-width: 768px) {
	.form-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.form-group {
	margin-bottom: 15px;
}

label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	font-size: 0.9rem;
}

input[type="text"],
select {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	font-size: 0.9rem;
	transition: border-color 0.3s;
}

input[type="text"]:focus,
select:focus {
	border-color: var(--accent-color);
	outline: none;
	box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

/* Estilos para los botones */
.buttons-row {
	display: flex;
	justify-content: center;
	gap: 15px;
	margin-top: 20px;
}

button {
	background-color: #4CAF50;
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9rem;
	transition: background-color 0.3s;
}

/* Estilo específico para botones con iconos */
.boton-icono {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* En dispositivos móviles queremos que sean cuadrados y pequeños */
@media (max-width: 768px) {
	.boton-icono {
		width: 40px;
		height: 40px;
		padding: 0;
		border-radius: 4px;
	}
}

button:hover {
	background-color: #45a049;
}

#limpiarButton {
	background-color: #4CAF50;
	color: white;
}

#limpiarButton:hover {
	background-color: #45a049;
}

/* Tabla de resultados */
.resultadosTable {
	overflow-x: auto;
	padding: 0 20px 20px 20px;
	margin-top: 20px;
	width: 90%;
}

table {
	width: 100%;
	border-collapse: collapse;
	background-color: #fff;
	font-size: 0.9rem;
}

th,
td {
	padding: 12px 15px;
	text-align: center;
	border-bottom: 1px solid var(--border-color);
}

th {
	background-color: var(--secondary-color);
	font-weight: 600;
	color: var(--primary-color);
	text-align: center;
}

tbody tr:hover {
	background-color: rgba(0, 0, 0, 0.02);
}

.colum1 {
	width: 10%;
}

.colum2 {
	width: 70%;
}

.colum3 {
	width: 15%;
}

.colum4 {
	width: 5%;
}

/* Campos obligatorios con asterisco */
.required::after {
	content: " *";
	color: #e53935;
	font-weight: bold;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* Estilos para la paginación */
#navegacion-paginas {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 20px;
	margin-bottom: 20px;
}

#navegacion-paginas button {
	padding: 10px 15px;
	border: 1px solid #ddd;
	border-radius: 5px;
	background-color: #4CAF50;
	color: white;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

#navegacion-paginas button:hover {
	background-color: #45a049;
}

#navegacion-paginas button:disabled {
	background-color: #ddd;
	color: #6c757d;
	cursor: not-allowed;
}

#controles-paginas {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 20px;
	margin-bottom: 20px;
}

#pagina-actual {
	font-size: 0.9rem;
	color: #555;
}

#registros-por-pagina {
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 0.9rem;
	width: 125px;
}

#totalRegistros {
	text-align: center;
	margin-top: 10px;
	font-size: 0.9rem;
	color: #555;
}

/* Nuevos estilos para centrar el título y la tabla */
#resultadosTitulo {
	text-align: center;
}

#resultados-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	padding-left: 15px;
	padding-right: 15px;
}

.error-message {
	color: red;
	font-size: 14px;
	margin-top: 10px;
	display: none;
}

.success-message {
	color: green;
	font-size: 14px;
	margin-top: 10px;
	display: none;
}

/* Responsive para dispositivos móviles */
@media (max-width: 768px) {
	/* Ya no cambiamos el grid-template-columns para mantener 2 columnas */

	/* Ajustamos otros elementos para móvil */
	.buttons-row {
		flex-direction: row;
		/* Mantener en fila para mostrar botones horizontalmente */
		justify-content: center;
		gap: 10px;
		/* Reducir el espacio entre botones */
	}

	.buttons-row button {
		width: auto;
		/* No ocupar todo el ancho */
		margin-bottom: 0;
		padding: 8px;
		/* Reducir el padding para hacer los botones más pequeños */
		font-size: 0.8rem;
		/* Texto más pequeño */
	}

	/* Hacer los iconos más pequeños */
	.buttons-row .boton-icono i {
		font-size: 0.9rem;
	}
}

/* Overlay de carga */
#loadingOverlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 9999;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	display: none;
	/* Oculto inicialmente */
}

/* Spinner */
.loader {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #3498db;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin-bottom: 15px;
}

.loading-text {
	color: white;
	font-size: 18px;
	font-weight: bold;
}

#atras {
	cursor: pointer;
}